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
define(['underscore'], function() { | |
var root = window; | |
function Item (item) { | |
this.type = item.type; | |
this.source = item.source; | |
this.width = item.width; | |
this.height = item.height; | |
this.container = item.container; // A (left), B (right) |
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'; | |
var fs = require('fs'); | |
var _ = require('lodash'); | |
var cache = Object.create(null); | |
exports.renderFile = function (path, options, callback) { |
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 through = require('through'); | |
module.exports = function (file) { | |
if (!/\.html/.test(file)) return through(); | |
var buffer = ''; | |
return through(write, end); |
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'; | |
var fs = require('fs'); | |
var minstache = require('minstache'); | |
var cache = Object.create(null); | |
exports.renderFile = function (path, options, callback) { |
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
module.exports = defaults; | |
function defaults (target, source) { | |
target = target || {}; | |
source = source || {}; | |
var keys = Object.keys(source) || []; | |
if (!keys.length) return target; | |
if (Array.isArray(source)) { |
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 snabbdom = require('snabbdom') | |
var patch = snabbdom.init([ // Init patch function with choosen modules | |
require('snabbdom/modules/class'), // makes it easy to toggle classes | |
require('snabbdom/modules/props'), // for setting properties on DOM elements | |
require('snabbdom/modules/style'), // handles styling on elements with support for animations | |
require('snabbdom/modules/eventlisteners'), // attaches event listeners | |
]) | |
var h = require('snabbdom/h') // helper function for creating VNodes |
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 raf = require('raf') | |
// https://gist.github.com/dezinezync/5487119 | |
var easingFn = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t * t }, | |
// decelerating to zero velocity | |
easeOutQuad: function (t) { return t * (2 - t) }, |