/**
* FRACTURE
*/
function throttle(fn, threshhold, scope) {
// Define default if not;
threshhold || (threshhold = 250);
// Setup vars
var last,
deferTimer;
// Main func
return function () {
// Applied to
var context = scope || this;
// Set date and store arguments
var now = +new Date,
args = arguments;
if (last && now < last + threshhold) {
// Has been run before and within threshold
// Remove ticking instance
clearTimeout(deferTimer);
// Create new
deferTimer = setTimeout(function () {
// On fire
// Reset time
last = now;
// Run function with original context and arguments
fn.apply(context, args);
}, threshhold);
} else {
// Hasn't been run or outside threshold. Fire immediately
// Reset time
last = now;
// Run function with original context and arguments
fn.apply(context, args);
}
};
}
(function () {
// Init vars
var paths = document.querySelectorAll('svg path'),
i = paths.length - 1,
reverse = false,
run = true,
mouseBoost = true,
shimmer = true;
if (reverse) {
// Reverse paths array
var rPaths = [];
for (var n = 0; n < paths.length; n++) {
rPaths[n] = paths[(paths.length - 1) - n];
}
// Overwrite paths with rPaths
paths = rPaths;
}
if (run) {
// Static interval process
var loop = window.setInterval(function () {
if (i >= 0) {
// Set transform attribute
if (paths[i].getAttribute('data-loaded')) {
paths[i].removeAttribute('data-loaded');
} else {
paths[i].setAttribute('data-loaded', 'true');
}
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.