Created
April 2, 2012 05:33
-
-
Save devongovett/2281027 to your computer and use it in GitHub Desktop.
flipped website effect for April Fools day on badassjs.com
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
// Original version | |
(function(){function s(v){document.documentElement.style[['','webkit','Moz','O','ms'].filter(function(p){return p+'Transform' in document.documentElement.style})[0]+'Transform']=v}if (!localStorage||!localStorage.flipped&&location.href!="http://badassjs.com/post/20294238453/webkit-js-yes-it-has-finally-happened-browser"){s('rotate(180deg)');document.links[0].onclick=function(){s('none');document.body.scrollTop=0;this.onclick=null;localStorage&&(localStorage.flipped=1);return !1}}})() | |
// Somewhat prettier version | |
(function() { | |
function s(v) { | |
document.documentElement.style[ | |
['','webkit','Moz','O','ms'].filter(function(p){ | |
return p + 'Transform' in document.documentElement.style | |
})[0]+'Transform' | |
] = v | |
} | |
if (!localStorage || !localStorage.flipped) { | |
s('rotate(180deg)'); | |
document.links[0].onclick = function() { | |
s('none'); | |
document.body.scrollTop = 0; | |
this.onclick = null; | |
localStorage && (localStorage.flipped = 1); | |
return !1 | |
} | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment