Skip to content

Instantly share code, notes, and snippets.

View panayotoff's full-sized avatar

Chris panayotoff

View GitHub Profile
@panayotoff
panayotoff / Gulpfile.js
Created September 26, 2017 20:57
Example Gulp config for working with WP themes;
/*
Package.json
{
"name": "gulpdev",
"version": "0.0.1",
"description": "",
"main": "index.php",
"scripts": {
"dev": "gulp"
@panayotoff
panayotoff / slugify.js
Created January 24, 2018 11:16
Slugify
export default function slugify(text) {
const a = 'àáäâèéëêìíïîòóöôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·/_,:;';
const b = 'aaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------';
const p = new RegExp(a.split('').join('|'), 'g');
/* eslint-disable */
return text
.toString()
.toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
[
"",
"1, улица",
"2, улица",
"3, улица",
"4, улица",
"5, улица",
"6, улица",
"7, улица",
"8, улица",
@panayotoff
panayotoff / DragSlides.js
Last active March 7, 2018 10:21
Infinite GSAP draggable slider
(function ($, window, undefined) {
var App = (window.App === undefined) ? (window.App = {}) : window.App;
(App.Views === undefined && (App.Views = {}));
App.Views.DragSlides = Backbone.View.extend({
el: '.dragslides',
initialize: function () {
if (!this.$el.length) {
@panayotoff
panayotoff / GSAPSimple.js
Created March 17, 2018 22:52
Simple GSAP fade-in fade-out transition as a VueJS Component
import TweenLite from 'gsap/TweenLite';
import CSSPlugin from 'gsap/CSSPlugin';
/*
* The GSAP-Simple transition is not used, but keep it as a template
* Author: Chris Panayotoff [email protected]
* */
import Vue from 'vue';
@panayotoff
panayotoff / Dynamo.js
Last active May 14, 2018 08:37
Simple VueJS Dynamic component
export default {
name : 'Dynamo',
functional: true,
props : {
template: String
},
render(createElement, context)
{
context.parent.$once('hook:mounted', () => {
context.parent.$forceUpdate()
@panayotoff
panayotoff / MquScroll.js
Last active September 3, 2018 08:42
MquScroll - JS util for creating scrolling animations
var MquScroll = function(options) {
//--------------------------------------------------------------
// Compatibility
//--------------------------------------------------------------
var raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame || function(callback) {
window.setTimeout(callback, 1000 / 60)
};
var passiveSupported = false;
@panayotoff
panayotoff / wp-laravel-mix.config.js
Last active January 21, 2019 12:22
Laravel Mix wordpress config
// File webpack.mix.js
const mix = require('laravel-mix');
const PATHS = {
src: 'src',
dist: '.',
proxy: 'http://localhost:8888/project'
};
const a = new AudioContext();
const oo = a.createOscillator();
oo.connect(a.destination);
oo.type="square";
oo.start();
window.addEventListener("mouseover", e => oo.frequency.linearRampToValueAtTime(e.target .innerHTML.length * 0.1 + 37, a.currentTime + 0.37));
export default class Component {
constructor(element, options) {
this.element = element;
this.element['__component__'] = this;
this.options = {...options, ...parseOptions(this.element)};
}
el(s) {return el(s, this.element)}
els(s) {return els(s, this.element)}
init() {}
destroy() {}