This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import gsap from 'gsap'; | |
let animationDuration = () => { return (Math.sqrt(window.innerWidth) / 9)}; | |
let secoundStartValue; | |
let secoundStartFn = () => { return animationDuration() * 0.5 } | |
let colors = ['#daa9ae', '#98b8c1', '#d6deeb', '#acb198']; | |
/** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Check if the flexible content field has rows of data: | |
if (have_rows('sections')): | |
// Loop through the rows of data: | |
while (have_rows('sections')) : the_row(); | |
// Load the corresponding template file: | |
include(locate_template('templates/'.get_row_layout().'.php')); | |
endwhile; | |
endif; | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*---------- VIDEO ----------*/ | |
var video = (function() { | |
'use strict'; | |
function video(elem) { | |
// enforces new | |
if (!(this instanceof video)) { | |
return new video(elem); | |
} | |
this.player = document.querySelector(elem); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hide Header on on scroll down | |
var didScroll; | |
var lastScrollTop = 0; | |
var delta = 5; | |
var navbar = document.querySelector(".site-header"); | |
var navbarHeight = navbar.offsetHeight; | |
window.addEventListener("scroll", function(){ | |
didScroll = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_current_url($strip = true) { | |
// filter function | |
static $filter; | |
if ($filter == null) { | |
$filter = function($input) use($strip) { | |
$input = str_ireplace(array( | |
"\0", '%00', "\x0a", '%0a', "\x1a", '%1a'), '', urldecode($input)); | |
if ($strip) { | |
$input = strip_tags($input); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_excerpt($excerpt, $maxLength = 200){ | |
$excerpt = preg_replace(" (\[.*?\])",'',$excerpt); | |
$excerpt = strip_shortcodes($excerpt); | |
$excerpt = strip_tags($excerpt); | |
$fullLength = strlen($excerpt); | |
$excerpt = substr($excerpt, 0, $maxLength); | |
$excerpt = substr($excerpt, 0, strripos($excerpt, " ")); | |
$excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var sassdoc = require('sassdoc'); | |
var input = './assets/scss/**/*.scss'; | |
var output = './assets/css'; | |
var sassOptions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getAbsoluteUrl = (function() { | |
var a; | |
return function(url) { | |
if(!a) a = document.createElement('a'); | |
a.href = url; | |
return a.href; | |
}; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function once(fn, context) { | |
var result; | |
return function() { | |
if(fn) { | |
result = fn.apply(context || this, arguments); | |
fn = null; | |
} | |
return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function poll(fn, callback, errback, timeout, interval) { | |
var endTime = Number(new Date()) + (timeout || 2000); | |
interval = interval || 100; | |
(function p() { | |
// If the condition is met, we're done! | |
if(fn()) { | |
callback(); | |
} | |
// If the condition isn't met but the timeout hasn't elapsed, go again |