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
var manageEnvironment = function(environment) { | |
environment.addFilter("json", function(value) { | |
return JSON.parse(value); // convert the complete string imported by Nunjucks into JSON and return | |
}); | |
}; | |
gulp.task("nunjucks", function() { | |
// .njk files in pages | |
return ( | |
gulp |
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 findMinMax(arr, start) { | |
var min = parseInt(start[0]) || parseInt(arr[0]); | |
var max = parseInt(start[1]) || parseInt(arr[0]); | |
for (let i = 0, len=arr.length; i < len; i++) { | |
var v = parseInt(arr[i]); | |
min = (v < min) ? v : min; | |
max = (v > max) ? v : max; | |
} |
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
<t4 type="content" name="Text Panel Breakout Image" output="selective-output" process-format="true" modifiers="" format="<div class='image-container'><div class='panel-img' style='background-image: url(<t4 type="content" name="Text Panel Breakout Image" output="normal" modifiers="" formatter="path/*" />);'></div></div>" /> |
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
var flags = { | |
scrolled: false, | |
resized: false | |
} | |
var timers = { | |
scroll: -1, | |
resize: -1, | |
delta: 16.67 // (1/60fps) / 1000ms = 16.67ms per frame | |
} | |
var windowValues = { |
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
@font-context: 16; | |
.em-calc(@target, @property, @context: @font-context) { | |
.loop(length(@target)); | |
.loop(@i) when (@i > 0) { | |
.loop(@i - 1); | |
@{property}+_: (extract(@target, @i) / @context) + 0em; | |
} | |
} |
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
var LazyLoader = function(selector, args) { | |
var fn = { | |
insert: function(){ | |
target.each(function(){ | |
var docFragment = $(document.createDocumentFragment()); | |
docFragment.append('<div class="lazyLoader"><span class="lazyLoader-icon"></span></div>') | |
$(this).prepend(docFragment); | |
}); | |
}, | |
fade: 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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
// map format: | |
// $base: ( | |
// $color: $value [background-color, text-color] | |
// ) |
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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
// Sass - Border Shorthand Mixin | |
// A mixin to simplify writing multiple border shorthands for specific elements. | |
// To-do: | |
// - Improve @if-else chaining | |
// - Nested functions? |
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
// ---- | |
// Sass (v3.4.9) | |
// Compass (v1.0.1) | |
// | |
// a combination of the z-index property map Gist: http://sassmeister.com/gist/29202828a1c37714f5e1 | |
// and Jake Archibald's IE-friendly Sass mediaqueries: http://jakearchibald.github.io/sass-ie/ | |
// thanks to both for their respective contributions. | |
// | |
// this variation uses named breakpoints taken from a map, rather than using hardcoded values within | |
// the mixin call. removes the need for hardcoded arbitrary values within code. |