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
var pageVisibilityTimer = false; | |
function isIOS7orNewer() { | |
return (/(iphone|ipad|ipod).+(os\s7|os\s8)/i).test(navigator.userAgent); | |
} | |
function pageVisibilityFix() { | |
pageVisibilityTimer = window.setInterval(function() { | |
window.scrollTo(document.body.scrollLeft, document.body.scrollTop); | |
}, 500); |
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
/*! | |
* Upstatic string ranking algorithm v1.0 | |
* (A port of the Quicksilver string ranking algorithm) | |
* | |
* http://upstatic.io | |
*/ | |
String.prototype.score = function (abbreviation) { |
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
//= require "ranking" | |
/*! | |
* Upstatic AutoSuggest v1.0 | |
* http://upstatic.io | |
*/ | |
(function (window, document, undefined) { | |
"use strict"; |
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
body { | |
@media (max-width: em(319)) { & { font-size: percentage(14/16) }} | |
@media (min-width: em(400)) { & { font-size: percentage(18/16) }} | |
@media (min-width: em(450)) { & { font-size: percentage(19/16) }} | |
@media (min-width: em(500)) { & { font-size: percentage(20/16) }} | |
@media (min-width: em(1100)) and (min-height: em(750)) { & { font-size: percentage(21/16) }} | |
@media (min-width: em(1150)) and (min-height: em(850)) { & { font-size: percentage(22/16) }} | |
@media (min-width: em(1200)) and (min-height: em(900)) { & { font-size: percentage(23/16) }} | |
@media (min-width: em(1250)) and (min-height: em(950)) { & { font-size: percentage(24/16) }} | |
@media (min-width: em(1300)) and (min-height: em(1000)) { & { font-size: percentage(25/16) }} |
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
// Get binary file using XMLHttpRequest | |
function getBinary(file) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", file, false); | |
xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
xhr.send(null); | |
return xhr.responseText; | |
} | |
// Base64 encode binary string |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>iOS 8 scrolls</title> | |
<meta name="viewport" content="width=device-width"> | |
</head> | |
<body style="min-height: 20000px;"> | |
<div class="scroller" style="text-align: center; line-height: 4em; position: fixed; top: 0; left: 0; right: 0; height: 4em; background: red; color: #fff; font-family: sans-serif;">We’re here.</div> | |
<script> |
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
'editor': | |
'lineHeight': 1.45 | |
'softWrap': true | |
'normalizeIndentOnPaste': true | |
'tabLength': 2 | |
'preferredLineLength': 100 | |
'invisibles': | |
'cr': '↩' | |
'eol': '' | |
'space': '·' |
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
// JSON example stuff | |
json = { | |
"image": "logo.jpg", | |
"url": "http://viljamis.com/" | |
}; | |
// Feature detect querySelectorAll | |
if (document.querySelectorAll) { | |
// Callback function which is executed after the JSONP call |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Responsive Nav with jQuery</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<link rel="stylesheet" href="styles.css"> | |
<script src="jquery.js"></script> | |
<script src="responsive-nav.js"></script> | |
<script src="responsive-slides.js"></script> |