Replicating and improving the lightbox module seen on Medium with fluid transitions.
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
a { | |
transition: all .3s cubic-bezier(.3,2,.5,.8); | |
} |
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
/* ========================================================================== | |
Reliably get viewport dimensions | |
Notes: | |
relies on position:fixed support, but it should work in browsers that | |
partially support position: fixed like iOS4 and such... | |
Usage: | |
* $('.spotlight').css( getViewportDimensions() ); | |
* $('.spotlight').css('height', getViewportDimensions().height); |
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
@media only screen and (-webkit-min-device-pixel-ratio: 1.3), | |
only screen and (min--moz-device-pixel-ratio: 1.3), | |
only screen and (-o-min-device-pixel-ratio: 1.3), | |
only screen and (min-resolution: 125dpi), | |
only screen and (min-resolution: 1.3dppx) { | |
/* Content goes below*/ | |
} |
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
<link href='http://fonts.googleapis.com/css?family=Karla:400,700' rel='stylesheet' type='text/css'> | |
<style> | |
.zmEbayContainer { | |
font-family: Karla, Helvetica Neue; | |
color: #2F353A; | |
width: 80%; | |
background-color: #f1f1f1; | |
margin: 50px auto; | |
padding: 35px 50px; | |
} |
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
// This is needed to prevent onreadystatechange being run twice | |
var ready = false; | |
document.onreadystatechange = function() { | |
if (ready) { | |
return; | |
} | |
// interactive = DOMContentLoaded & complete = window.load |
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
<script> | |
(function(K,i,c,k,o,f,F){K['GoogleAnalyticsObject']=o;K[o]=K[o]||function(){ | |
(K[o].q=K[o].q||[]).push(arguments)},K[o].l=1*new Date();f=i.createElement(c), | |
F=i.getElementsByTagName(c)[0];f.async=1;f.src=k;F.parentNode.insertBefore(f,F) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXX-XX', 'http://yourdomain.com', { | |
//'cookieDomain': 'none' // Use if debugging on localhost | |
}); | |
ga('send', 'pageview'); |
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
@include component('foo') { | |
margin: auto; | |
@include modifier('bar') { | |
padding: 20px; | |
} | |
@include modifier('baz') { | |
padding: 50px; |
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
define(function() { | |
var cssomPrefixes = 'Moz O ms Webkit'.split(' '); | |
var modElem = { | |
elem: document.createElement('modernizr') | |
}; | |
var mStyle = { | |
style: modElem.elem.style | |
}; |
I hereby claim:
- I am mrmartineau on github.
- I am zander (https://keybase.io/zander) on keybase.
- I have a public key whose fingerprint is B686 75C9 8088 B2AD 9B47 74EF 41F1 9641 16AF 831C
To claim this, I am signing this object: