Created
October 22, 2012 09:29
-
-
Save thisislawatts/3930616 to your computer and use it in GitHub Desktop.
iPhone rotatothon
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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html dir="ltr" lang="en-US" id="h" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html dir="ltr" lang="en-US" id="h" class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html dir="ltr" lang="en-US" id="h" class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html ldir="ltr" lang="en-US" class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width" /> | |
<title>iPhone Tilterising</title> | |
<style> | |
div { | |
position: absolute; | |
top: 50%; | |
margin-top: -.5em; | |
left: 0; | |
width: 100%; | |
text-align: center; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="shout"> | |
Easy Now! | |
</div> | |
<script> | |
var element = document.getElementById('shout'), | |
pleasantries = [ | |
'Woah there!', | |
'Steady at the helm', | |
'Stop rocking the boat', | |
'Less caffeine for you' | |
]; // Better phrases! | |
window.addEventListener( "orientationchange", orient ); | |
function orient(e) { | |
element.innerHTML = pleasantries[Math.floor(Math.random() * pleasantries.length)]; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment