Replicating and improving the lightbox module seen on Medium with fluid transitions.
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
| // 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 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
| <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 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
| @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 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
| /* ========================================================================== | |
| 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 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
| a { | |
| transition: all .3s cubic-bezier(.3,2,.5,.8); | |
| } |
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
| String.prototype.substitute = function (object) { | |
| return this.replace(/\{(.+?)\}/g, function (match, name) { | |
| return name in object ? object[name] : match; | |
| }); | |
| }; |
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
| { | |
| "name": "kickoff", | |
| "version": "1.0.0", | |
| "dependencies": { | |
| "bean": "*", | |
| "bonzo": "*", | |
| "qwery": "*", | |
| "lodash": "*", | |
| "domready": "*" | |
| }, |
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
| - child element | |
| e.g. .form-controlGroup > .form-controlGroup-label | |
| -- modifier element | |
| e.g. .btn.btn--primary | |
| .is- element state | |
| e.g. .btn.btn--primary | |
| aB camel-case descriptors |
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
| Example usage for Kickoff's components |