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 vertical-align { | |
position: relative; | |
top: 50%; | |
-webkit-transform: translateY(-50%); | |
-ms-transform: translateY(-50%); | |
transform: translateY(-50%); | |
} | |
.element p { | |
@include vertical-align; |
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
<html class="no-js"> | |
<head> | |
<!-- no-js detection --> | |
<script>(function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")})(document,window,0);</script><!-- remove this if you are using Modernizr --> | |
</head> | |
<!-- add a class .no-js and remove if there's js. (~ Modernizr ) --> | |
</html> |
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
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if(this.console){ | |
console.log( Array.prototype.slice.call(arguments) ); | |
} | |
}; |
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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.9.1.min.js"><\/script>')</script> |
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
/* delay-in: 0s, delay-out: 5s */ | |
.flyout{ | |
display: block; | |
position: fixed; | |
width: 200px; | |
height: 90%; | |
top:68px; | |
left:-180px; | |
-webkit-transition: all .4s 5s cubic-bezier(0.175, 0.885, 0.320, 1.275); |
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
.you-cant-touch-this{ | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} |
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
//============================== | |
//JAVASCRIPT @MEDIA QUERIES | |
//================================ | |
var widthMax832px = window.matchMedia('(max-width: 832px)'); | |
console.log('widthMax832px: ', widthMax832px); | |
//always check if window.matchMedia exist (older IE can crash on this. If still needed, use Paul Irish polyfill) | |
if(window.matchMedia && window.matchMedia("(max-width: 1201px)").matches) { |
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
/*============================== | |
BROWSER DETECTION | |
================================ | |
quick: console.log(/WebKit/.test(navigator.userAgent)) */ | |
function getBrowser(){ | |
var ua = window.navigator.userAgent.toLowerCase(); | |
var ver = window.navigator.appVersion.toLowerCase(); | |
var name = 'unknown'; | |
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
.product-page dl{ | |
overflow: hidden; | |
width:100%; | |
} | |
.product-page dt{ | |
width: 30%; | |
font-weight: bold; | |
} | |
.product-page dd{ | |
width: 70%; |
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
/* | |
Raphael.js: find the center of element | |
*/ | |
// element = paper.rect(......); | |
var cX = element.getBBox().x + element.getBBox().width/2, | |
cY = element.getBBox().y + element.getBBox().height/2; |