Created
September 10, 2014 00:16
-
-
Save thattomperson/b5b8c4c7d545e94d080b to your computer and use it in GitHub Desktop.
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
| (function (a, b) { | |
| a.keydown(function (e) { | |
| if( e.target.type !== 'text') { | |
| switch (e.which) { | |
| case 37: // left | |
| Search.pagination.prev(); | |
| break; | |
| case 39: // right | |
| Search.pagination.next(); | |
| break; | |
| } | |
| } | |
| }); | |
| var konami = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13]; | |
| var rotated = false; | |
| function nextKey(e, i) { | |
| if (konami[i] === 13) { | |
| var deg = 180; | |
| if (rotated) { | |
| rotated = false; | |
| deg = 0 | |
| } else { | |
| rotated = true; | |
| } | |
| b.css({ | |
| transform: 'rotateY(' + deg + 'deg)', | |
| transition: 'transform 2s' | |
| }); | |
| } else { | |
| if (e.which === konami[i]) { | |
| a.one('keydown', function (e) { | |
| nextKey(e, i + 1); | |
| }); | |
| } | |
| } | |
| } | |
| $(document).keydown(function (e) { | |
| nextKey(e, 0); | |
| }); | |
| }($(document), $(document.body))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment