This file contains 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
/* All 12 Loading.io (plus small version for each) pure CSS loaders in one file, combined with $primary using e.g. template primary-color */ | |
/* You can change the spinner with the classes load1 - load8 and load1-small - load8-small */ | |
/* credits @ https://loading.io and https://github.com/loadingio/css-spinner/ */ | |
/* circle */ | |
.lds-circle, .lds-circle-small { | |
display: inline-block; | |
width: 64px; | |
height: 64px; | |
margin: 8px; |
This file contains 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
{# retrieve configuration #} | |
{{ dump(gantry.config) }} | |
{# retrieve styles configuration #} | |
{{ dump(gantry.config.styles) }} | |
{# retrieve breakpoint configuration #} | |
{{ dump(gantry.config.styles.breakpoints) }} | |
{# you can also obtain particle configurations via gantry.particles #} |
This file contains 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 multiply(arr, n) { | |
if (n <= 0) { // return 0 if count is 0 or negative | |
return 0; | |
} else { // sum up the next n - 1 elements with the current element | |
return multiply(arr, n - 1) + arr[n - 1]; | |
} | |
} |
This file contains 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
// you probably also want to prevent container resizing | |
// please use this CSS which works fine with the default v2 reCAPTCHA: .g-recaptcha { height: 78px; min-height: 78px; } | |
var loadRecaptchaAsync = function() { | |
// determine if container is in viewport | |
// you might pass an offset in pixel - a negative offset will trigger loading earlier, a postive value later | |
// credits @ https://stackoverflow.com/a/33979503/2379196 | |
var isInViewport = function($container, offset) { | |
var containerTop = $container.offset().top; | |
var containerBottom = containerTop + $container.outerHeight(); |
This file contains 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
// to make this code working for your Google Maps <iframe> please change the src-attribute to data-src and add the class g-maps | |
// e.g. <iframe class="g-maps" data-src="{your-google-maps-url}" width="100%" height="400" frameborder="0" style="border:0" allowfullscreen></iframe> | |
// you probably also want to prevent container resizing, please use this CSS with your height value: .g-maps { min-height: 400px; } | |
var loadGMapAsync = function() { | |
// determine if container is in viewport | |
// you might pass an offset in pixel - a negative offset will trigger loading earlier, a postive value later | |
// credits @ https://stackoverflow.com/a/33979503/2379196 | |
var isInViewport = function($container, offset) { | |
var containerTop = $container.offset().top; |
This file contains 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
/* All 8 CSS-Loader (plus small version for each) pure CSS loaders in one file */ | |
/* Uses black on white and not white on turquise like the original */ | |
/* Add <div class="load1 loader">Loading...</div> to your HTML markup */ | |
/* You can change the spinner with the classes load1 - load8 and load1-small - load8-small */ | |
/* credits @ https://github.com/lukehaas/css-loaders */ | |
/* load1 */ | |
.async-gmaps-spinner.load1.loader, | |
.async-gmaps-spinner.load1-small.loader, | |
.async-gmaps-spinner.load1.loader:before, |
This file contains 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
// If you want to explicitly trigger an animation for certain WOW.js elements again. No need to call `init()` and also not wanted (all elements are reset): | |
var triggerAnimation = function(selector, animation) { | |
var $element = $(selector); // get element | |
// re-apply animation (style and class) | |
var applyAnimation = function(){ | |
$element = $(selector); | |
$element.addClass('wow ' + animation + ' animated'); | |
$element.attr('style', 'visibility: visible; animation-name: ' + animation + ';'); | |
}; |
This file contains 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
// This snippet dynamically resets animation after passing the viewport (scrolling, resizing), hence they are reanimated when viewing them again | |
// Helper function for adding elements to box list in WOW, credits @ https://github.com/matthieua/WOW/issues/46#issuecomment-133760823 | |
WOW.prototype.addBox = function(element) { | |
this.boxes.push(element); | |
}; | |
wow = new WOW(); | |
wow.init(); | |
var checkWOWJsReset = function() { | |
var resetWOWJsAnimation = function() { |
This file contains 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
// If you want to explicitly trigger an animation for certain WOW.js elements again. No need to call `init()` and also not wanted (all elements are reset): | |
var triggerAnimation = function(selector, animation) { | |
var $element = $(selector); // get element | |
var element = $element[0]; // get JS element | |
var newone = element.cloneNode(true); // clone it | |
element.parentNode.replaceChild(newone, element); // and replace the old with clone | |
$element = $(selector); // get cloned jQ element | |
$element.addClass('wow ' + animation + ' animated'); // apply animations | |
$element.attr('style', 'visibility: visible; animation-name: ' + animation + ';'); // and styles |
NewerOlder