Simple responsive grid layout with a card UI style.
A Pen by Adam Hollister on CodePen.
/*! | |
* load CSS with requestAnimationFrame | |
* stackoverflow.com/questions/28394097/async-loading-css-stylesheet-using-requestanimationframe | |
* gist.github.com/englishextra/10712436aa14df45d7031fd739bf9dfc | |
*/ | |
function loadCSSwithRaf(h, c, m, b) { | |
function l() { | |
var t = window.document.createElement("link"), | |
a = b || window.document.getElementsByTagName("script")[0], | |
s = window.document.styleSheets; |
/*! http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
* requestAnimationFrame polyfill by Erik Moller. fixes from Paul Irish and Tino Zijdel | |
* MIT license | |
*/ | |
(function(){var lastTime=0;var vendors=["ms","moz","webkit","o"];for(var x=0;x<vendors.length&&!window.requestAnimationFrame;++x){window.requestAnimationFrame=window[vendors[x]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[vendors[x]+"CancelAnimationFrame"]||window[vendors[x]+"CancelRequestAnimationFrame"];}if(!window.requestAnimationFrame)window.requestAnimationFrame=function(callback,element){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){callback(currTime+timeToCall);},timeToCall);lastTime=currTime+timeToCall;return id;};if(!window.cancelAnimationFrame)window.cancelAnimationFrame=function(id){clearTimeout(id);};}()); | |
/*! | |
* requestAnimationFrame() shim by |
Simple responsive grid layout with a card UI style.
A Pen by Adam Hollister on CodePen.
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
<useragentswitcher> | |
<folder description="Browsers - Windows"> | |
<folder description="Legacy Browsers"> | |
<useragent description="Arora 0.6.0 - (Vista)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/527 (KHTML, like Gecko, Safari/419.3) Arora/0.6 (Change: )" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/> | |
<useragent description="Avant Browser 1.2" useragent="Avant Browser/1.2.789rel1 (http://www.avantbrowser.com)" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/> | |
<useragent description="Chrome 4.0.249.0 (Win 7)" useragent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.0 Safari/532.5" appcodename="" appname="" appversion="" platform="" vendor="" vendorsub=""/> | |
<useragent description="Chrome 5.0.310.0 (Server 2003)" useragent="Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9" appcodename="" appname="" |
/*------------------------------------------ | |
Responsive Grid Media Queries - 1280, 1024, 768, 480 | |
1280-1024 - desktop (default grid) | |
1024-768 - tablet landscape | |
768-480 - tablet | |
480-less - phone landscape & smaller | |
--------------------------------------------*/ | |
@media all and (min-width: 1024px) and (max-width: 1280px) { } | |
@media all and (min-width: 768px) and (max-width: 1024px) { } |
// long version | |
function loadExt(files, after) { | |
var _this=this; | |
_this.files = files; | |
_this.js = []; | |
_this.head = document.getElementsByTagName("head")[0]; | |
_this.after = after || function(){}; | |
_this.loadStyle = function(file) { | |
var link = document.createElement("link"); | |
link.rel = "stylesheet"; |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
/*! | |
* Open external links in default browser out of Electron / nwjs | |
* gist.github.com/englishextra/b9a8140e1c1b8aa01772375aeacbf49b | |
* stackoverflow.com/questions/32402327/how-can-i-force-external-links-from-browser-window-to-open-in-a-default-browser | |
* github.com/nwjs/nw.js/wiki/shell | |
* electron - file: | nwjs - chrome-extension: | http: Intel XDK | |
* wont do in electron and nw, | |
* so manageExternalLinks will set target blank to links | |
* var win = w.open(url, "_blank"); | |
* win.focus(); |
/*! | |
* Polyfill for Function.prototype.bind | |
* @see {@link https://gist.github.com/Daniel-Hug/5682738} | |
* @see {@link https://gist.github.com/englishextra/db0f22a60e59de86c19f174938c09529} | |
*/ | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = (function () {}).bind || function (b) { | |
if (typeof this !== "function") { | |
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); | |
} |