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
# Extends the Layer class with a new function that returns the first nested | |
# sublayer from the provided path of names. | |
# e.g., innerCircle = screenLayer.sublayerByPath('Box/Inner_Box/Inner_Circle') | |
Layer.prototype.subLayerByPath = (path = '', delimeter = '/') -> | |
names = path.split(delimeter) | |
layers = this.subLayersByName(names.shift() || '') | |
if (layers.length && names.length) | |
path = names.join(delimeter) | |
return layers[0].subLayerByPath(path) |
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(d,s){s=d.createElement('style');s.innerHTML='::-webkit-scrollbar{display:none}';d.head.appendChild(s)})(document) |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
shell: { | |
exportIcons: { | |
command: 'sketchtool export slices assets/icons.sketch --output=assets/icons/' | |
} | |
}, | |
webfont: { | |
icons: { |
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
string.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); |
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
$('body').bind('click', function() { $('body,html').stop().animate({ scrollTop: $('body').scrollTop() + $('body').height() }, 1000); }); |
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
/* Smooth font */ | |
.smooth-font { | |
transform: rotate(-0.0000000001deg); | |
} | |
/* Center an element vertically + horizontally */ | |
.center { | |
position: absolute; | |
top: 0; | |
right: 0; |
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(!Modernizr.input.placeholder){ | |
$('input[placeholder], textarea[placeholder]').each(function() { | |
$(this).val($(this).attr('placeholder')); | |
$(this).addClass('is-placeholder'); | |
}).blur(function() { | |
if ($(this).val() === '') { | |
$(this).val($(this).attr('placeholder')); | |
$(this).addClass('is-placeholder'); | |
} | |
}).focus(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
// Apply IE10+ detection | |
if ((/*@cc_on!@*/false && document.documentMode === 10) || navigator.userAgent.match(/Trident\/7.0/)) { | |
document.documentElement.className += ' ie10'; | |
} |
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
// Animation | |
$('selector').on('animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd', function() { | |
}); | |
// Transition | |
$('selector').on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function() { | |
}); |