Skip to content

Instantly share code, notes, and snippets.

View Fanckler's full-sized avatar

Serhii Fanckler

View GitHub Profile
@Fanckler
Fanckler / gsap.js
Last active February 7, 2018 15:41
GSAP (draggable-Rotation) с подвязкой слайдера
var wheel = Draggable.create('#nerdwheel-svg', {
type: "rotation",
bounds:{minRotation:0, maxRotation:360},
throwProps: true,
edgeResistance: 1,
onDrag: nextHandler
// function() {
// calcPercent(this.rotation);
@Fanckler
Fanckler / customizer.php
Last active February 8, 2018 21:23
Wordpress customizer editor
<?php
//support
add_theme_support( 'post-thumbnails' );
function invio_scripts() {
wp_enqueue_style('style-css', get_stylesheet_uri() );
wp_enqueue_style('style-ft', get_stylesheet_directory_uri().'/libs/font-awesome-4.7.0/css/font-awesome.css' );
wp_enqueue_style('style-main', get_stylesheet_directory_uri().'/css/style.css');
wp_enqueue_style('style-media', get_stylesheet_directory_uri().'/css/media.css' );
@Fanckler
Fanckler / functions.php
Created February 8, 2018 20:30
customizer2.php
if ( ! class_exists( 'WP_Customize_Control' ) )
return NULL;
/**
* Class to create a custom tags control
*/
class Text_Editor_Custom_Control1 extends WP_Customize_Control
{
/**
* Render the content on the theme customizer page
*/
$('.first').css({
left: -e.pageX / 10 + 100,
top: -e.pageY / 10 + 100
});
$('.second').css({
left: e.pageX / 50 + 200,
top: e.pageY / 50 + 200
});
@Fanckler
Fanckler / index.pug
Last active March 22, 2018 21:57
mouse move
//- Обязательные вложения ointin.fixpoint > fixtarget
li.fb.pointin.fixpoint
a.fixtarget(href='#')
@Fanckler
Fanckler / common.js
Last active March 25, 2018 00:21
CSS triangles SVG animation
var i = 0;
function changeClass(){
$("body").removeClass("figure" + i)
i = (i==4)?1:i+1;
$("body").addClass("figure" + i);
}
var gogo = setInterval(changeClass, 2500);
setTimeout(changeClass, 500);
$('#svg').click(function(event) {
clearInterval(gogo);
@Fanckler
Fanckler / scroll_indicator.js
Created March 31, 2018 12:23
Scroll indicator
//scroll indicator
$(window).scroll(function() {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.querySelector('.scroll-bar span').style.height = scrolled+'%';
});
@Fanckler
Fanckler / video_canvas.js
Created March 31, 2018 15:35
draw video to canvas
//video canvas
var canvas = document.getElementById('canV');
var ctx = canvas.getContext('2d');
var video = document.createElement('video');
video.src = '../video/product.mp4';
video.addEventListener('loadeddata', function() {
video.play(); // start playing
update(); //Start rendering
});
function update() {
@Fanckler
Fanckler / _common.sass
Last active July 16, 2018 10:57
Transition Page (Barba)
body
background: #252627
line-height: 1.4
.barba-container
transition: all 1s ease-in-out
#nav-bar
height: 100vh
width: 60px
position: fixed
left: 0
@Fanckler
Fanckler / PIXI.JS
Last active May 17, 2018 13:10
Шаблон PIXI. с размытием картинок.
import 'pixi.js';
import * as filters from 'pixi-filters';
import {TimelineMax} from 'gsap';
var tl = new TimelineMax();
var app = new PIXI.Application(window.innerWidth, window.innerHeight, {backgroundColor : 0x1099bb}); //создаем сцену с цветом, шириной и высотой
document.body.appendChild(app.view); //добавляем в body созданую сцену.
var container = new PIXI.Container(); // создаем один общий контейнер