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
=force-new-lines-for-long-words | |
-ms-word-break: break-all | |
word-break: break-all | |
word-break: break-word | |
-webkit-hyphens: auto | |
-moz-hyphens: auto | |
hyphens: auto |
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
const prefetch = document.createElement('link'); | |
prefetch.setAttribute('rel', 'prefetch'); | |
prefetch.setAttribute('href', url); | |
document.head.appendChild(prefetch); |
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
// http://mattiaswallander.com/blog/2014/06/23/fps-counter-for-firefox/ | |
(function() { | |
var overlay, lastCount, lastTime, timeoutFun; | |
overlay = document.createElement('div'); | |
overlay.style.background = 'rgba(0, 0, 0, .7)'; | |
overlay.style.bottom = '0'; | |
overlay.style.color = '#fff'; | |
overlay.style.display = 'inline-block'; | |
overlay.style.fontFamily = 'Arial'; |
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
const url = origin + '/amp_preconnect_polyfill?' + Math.random(); | |
const xhr = new XMLHttpRequest(); | |
xhr.open('HEAD', url, true); | |
xhr.send(); |
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
//trimmed down version of jack lawsons mediator | |
(function (root) { | |
// We'll generate guids for class instances for easy referencing later on. | |
// Subscriber instances will have an id that can be refernced for quick | |
// lookups. | |
function guidGenerator() { | |
var S4 = function () { | |
return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); |
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
(function(exports) { | |
'use strict'; | |
function foo() {} | |
// Node.js|CommonJS / AMD / Default to window as global | |
if (typeof module !== 'undefined' && module.exports) { | |
module.exports = exports = foo; | |
} else if (typeof define === 'function' && define.amd) { | |
define(function() { |
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
// 4. Conditionally load the webcomponents polyfill if needed by the browser | |
function finishLazyLoading() { | |
window.Polymer = window.Polymer || { | |
dom: 'shady' //'shadow' | |
}; | |
// 6. Fade splash screen, then remove. | |
var onImportLoaded = function() { | |
var loadEl = document.getElementById('splash'); |
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
function BrowserInfo() { | |
this.supported = false; | |
this.isBrowser = true; | |
this.webBrowser = null; | |
this.webBrowserVer = null; | |
this.os = 'unknown os'; | |
var detectedUA = null; | |
if (typeof window === 'undefined' || !window.navigator) { |
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
let body = document.body; | |
let timer; | |
window.addEventListener('scroll', () => { | |
clearTimeout(timer); | |
if (!body.classList.contains('disable-hover')) { | |
body.classList.add('disable-hover'); | |
} | |
timer = setTimeout(() => { | |
body.classList.remove('disable-hover'); | |
}, 500); |