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
// create media queries from min/max | |
@mixin respond($min: 0, $max: null, $media: screen) { | |
@if $min > 0 and $max { | |
@include respond-between($min, $max, $media) { @content }; | |
} @else if $min == 0 and $max { | |
@include respond-below($max, $media) { @content }; | |
} @else if $min and $max == null { | |
@include respond-above($min, $media) { @content }; | |
} | |
} |
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 diffCollection(oldColl, newColl, key) { | |
var oldVal = _.map(oldColl, function(model) { | |
return model.get(key); | |
}); | |
var newVal = _.map(newColl, function(model) { | |
return model.get(key); | |
}); | |
var changed = []; |
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 firstdef() { | |
var isDefined = function(arg) { return !_.isUndefined(arg); }; | |
return _.find(arguments, isDefined); | |
} |
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 result(expr, context) { | |
return typeof expr === 'function' ? expr.apply(context) : expr; | |
} |
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 EqualHeights = (function($, _) { | |
function EqualHeights (el, opts) { | |
this.options = _.extend({ item: '.equal-item' }, opts); | |
this.items = $(el).find(this.options.item); | |
$(window).on('resize', _.bind(this.resize, this)).trigger('resize'); | |
} | |
EqualHeights.prototype.resize = function() { | |
this.items.height(getMaxHeight(this.items)); |
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
// requires: respond.scss | |
// https://gist.github.com/krambuhl/9dd229f391aceb3012b4 | |
$vptext-viewport: 960px; | |
$vptext-min: 640px; | |
$vptext-max: 1180px; | |
@mixin viewport-text($font-size: 24px) { | |
font-size: #{($font-size / $vptext-viewport * 100) + vw}; |
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
$grid-max: 12; | |
$grid-column: 80px; | |
$grid-gutter: 0; | |
@function gridw ($span: $grid-max, $offset: 0) { | |
@if $span != -1 { | |
@return ($grid-column * $span) + ($grid-gutter * ($span - 1)) + $offset; | |
} | |
@return -1; |
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
@mixin respond($min: -1, $max: -1, $media: "all") { | |
$query: "only " + $media; | |
@if $min != -1 and $max != -1 { | |
$query: "only " + $media + " and (min-width: " + $min + ") and (max-width: " + ($max - 1) + ")"; | |
} @else if $min == -1 and $max != -1 { | |
$query: "only " + $media + " and (max-width: " + ($max - 1) + ")"; | |
} @else if $min != -1 and $max == -1 { | |
$query: "only " + $media + " and (min-width: " + $min + ")"; | |
} |
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
_.mixin({ | |
bindDelay: function(func, context, wait) { | |
return _.delay(_.bind(func, context || this), wait, _.last(arguments, 3)); | |
}, | |
bindDefer: function(func, context) { | |
return _.defer(_.bind(func, context || this), _.last(arguments, 2)); | |
}, | |
repeat: function(func, interval) { |
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
.icon { | |
display: inline-block; | |
background-size: contain; | |
font-size: 0; | |
color: transparent; | |
} | |
.icon-block { | |
display: block; |