Created
November 4, 2013 10:25
-
-
Save anonymous/7300722 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
| body { | |
| text-align: center; | |
| } | |
| .yay { | |
| font-size: 70px; | |
| } |
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> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| <pre class="yay"></pre> | |
| </body> | |
| </html> |
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
| var things = [ | |
| "✌('ω')✌", | |
| "✌('ω'✌)", | |
| "(ω' ✌)", | |
| "(' ✌ )", | |
| "(✌ )✌", | |
| "✌( )✌", | |
| "✌( ✌)", | |
| "( ✌ ')", | |
| "(✌ 'ω)", | |
| "(✌'ω')✌", | |
| "✌('ω')✌" | |
| ]; | |
| var currentPos = 0; | |
| var yayDiv = document.querySelector('.yay'); | |
| var dt = 0; | |
| var start = 0; | |
| function render(time) { | |
| dt = time - start; | |
| //console.log("Hey", time, start, dt); | |
| if (dt >= (300)) { | |
| currentPos = (currentPos+1) % things.length; | |
| yayDiv.innerText = things[currentPos]; | |
| start = time; | |
| dt = 0; | |
| } | |
| } | |
| function animate(time) { | |
| requestAnimationFrame(animate); | |
| render(time); | |
| } | |
| animate(start); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment