Last active
September 8, 2016 04:31
-
-
Save joshkautz/651020844385cb53f9c42036313e78b4 to your computer and use it in GitHub Desktop.
JavaScript to randomly animate all the smiley face emojis supported in-browser, accompanied by relevant HTML display files.
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 http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
html, body { | |
height: 100%; | |
} | |
body { | |
display:flex; | |
justify-content:center; | |
align-items:center; | |
font-size: 200px; | |
overflow: hidden; | |
} | |
</style> | |
<script src="emoji_animation.js"></script> | |
</head> | |
<body></body> | |
</html> |
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 emojis = '๐ ๐ฌ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ โบ๏ธ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ถ ๐ ๐ ๐ ๐ณ ๐ ๐ ๐ ๐ก ๐ ๐ ๐ โน๏ธ ๐ฃ ๐ ๐ซ ๐ฉ ๐ค ๐ฎ ๐ฑ ๐จ ๐ฐ ๐ฏ ๐ฆ ๐ง ๐ข ๐ฅ ๐ช ๐ ๐ญ ๐ต ๐ฒ ๐ท ๐ด'.split( ' ' ); | |
function animate() { | |
setTimeout( function () { | |
document.body.textContent = emojis[ Math.floor( Math.random() * emojis.length ) ]; | |
requestAnimationFrame( animate ); | |
}, 100 ) | |
} | |
requestAnimationFrame( animate ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment