Skip to content

Instantly share code, notes, and snippets.

View alexvas123's full-sized avatar

Alexander Vassiliev alexvas123

View GitHub Profile
@alexvas123
alexvas123 / VueJS Navigation
Last active April 30, 2017 18:46
VueJS Navigation
// HTML
<div id="app">
<button @click='homeButton'>HOME</button>
<button @click='menuButton'>MENU</button>
<button @click='contactButton'>CONTACT</button>
<div :style="{display: homeMode}">
<h2>Home</h2>
<p>Home Page</p>
</div>
@alexvas123
alexvas123 / Footer always at the bottom
Created November 1, 2016 12:30
Footer always at the bottom
@alexvas123
alexvas123 / PHP Wordpress login plugin
Created October 20, 2016 19:54
PHP Wordpress login plugin
<?php
/*
Plugin Name: Admin
Plugin URI: http://portfolio.vassiliev.org/
Description: plugin for EveryStaff site
Author: Alexander Vassiliev
Author URI: http://portfolio.vassiliev.org/
*/
function everystaff_admin_theme_style() {
@alexvas123
alexvas123 / Javascript Buttons and Content
Created September 25, 2016 07:25
Javascript Buttons and Content
// BUTTONS AND CONTENT
$("li.button").on("click", function (event) {
event.preventDefault();
var name = $(this).attr("data-story"); // Gets attr data-storey from button
var parent = $(this).closest(".content"); // Finds parent of the button
var container = $(parent).find(".container"); // Finds child with content
var videoLink = $(this).find("a").attr("href"); // Finds li > a link to video
$(container).children().fadeOut("slow"); // Hides content
$('iframe[data-story="' + name + '"]').attr("src", videoLink); // Links to video
@alexvas123
alexvas123 / Vivus SVG animation
Created September 25, 2016 07:23
Vivus SVG animation
// Vivus SVG animation
// Initial CSS: display: none
var details = {
type: "delayed",
duration: 200,
animTimingFunction: Vivus.EASE
};
@alexvas123
alexvas123 / CSS Loop
Created September 25, 2016 07:21
CSS Loop
// CSS Loop
li
@for $i from 1 through 6
&:nth-child(#{$i})
animation-duration: 400ms * $i
@alexvas123
alexvas123 / Button
Created September 3, 2016 12:23
Button
.link-button
text-align: center
a
background-color: $alert-color
border: .2rem solid $alert-color
color: #fff
display: inline-block
font-family: OpenSansBold, $helvetica
font-size: 1.5rem
font-weight: normal
@alexvas123
alexvas123 / CSS Modal
Created September 3, 2016 12:22
CSS Modal
// HTML
<p class="link-button">
<a href="#subscribe">Подписаться</a>
</p>
<div id="subscribe" class="modal">
<div class="content">
<form class="forms">
<h4>Подписка:</h4>
@alexvas123
alexvas123 / Page Scroll to ID
Last active September 3, 2016 12:07
Page Scroll to ID
// jQuery
$("a[href^='#section']").on('click', function (event) {
var target = $(this.getAttribute('href'));
if (target.length) {
event.preventDefault();
$('html, body').stop().animate({
scrollTop: target.offset().top
}, 1000);
}
@alexvas123
alexvas123 / Portfolio Grid
Created July 9, 2016 10:08
Portfolio Grid
// HTML
<section id="portfolio" class="s-portfolio bg-dark">
<div class="section-header">
<h2>Портфолио</h2>
<div class="s-descr-wrap">
<h6>Мои последние работы</h6>
</div>
</div>
<div class="section-content">