A Pen by Michael McMillan on CodePen.
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
####################### | |
# HTML5 Placeholder fallback | |
####################### | |
# http://webdesignerwall.com/tutorials/cross-browser-html5-placeholder-text | |
unless Modernizr.input.placeholder | |
$("[placeholder]").focus(-> | |
input = $(this) | |
if input.val() is input.attr("placeholder") | |
input.val "" | |
input.removeClass "placeholder" |
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 font-face ( $name, $font-files, $eot: false, $weight: false, $style: false) | |
$iefont: unquote("#{$eot}?#iefix") | |
@font-face | |
font-family: quote($name) | |
@if $eot | |
src: font-url($eot) | |
$font-files: font-url($iefont) unquote("format('embedded-opentype')"), $font-files | |
src: $font-files | |
@if $weight | |
font-weight: $weight |
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
// requestAnimationFrame() shim by Paul Irish | |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
window.requestAnimFrame = (function() { | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || | |
function(/* function */ callback, /* DOMElement */ element){ | |
window.setTimeout(callback, 1000 / 60); |
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
Set inline width & height. | |
Video, img alternative natural width & height: 1920 x 1080 | |
21mb video O_O | |
http://codepen.io/MikeMcChillin/pen/wKGFz |
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
isMobile = -> | |
return (/Android|iPhone|iPad|iPod|BlackBerry|Windows Phone/i).test(navigator.userAgent || navigator.vendor || window.opera) | |
if isMobile() is true | |
alert "We're on mobile!" |
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
// Set listeners for click events on elements that have [data-gtm-category] on them | |
$('[data-gtm-category]').on('click', function() { | |
var category = $(this).data('gtm-category'); | |
var action = $(this).data('gtm-action'); | |
var label = $(this).data('gtm-label'); | |
gtmClickTrack(category, action, label); | |
}); | |
// Send the info to Google Analytics | |
var gtmClickTrack = function(category, action, label) { |
OlderNewer