Created
August 20, 2014 10:07
-
-
Save dannycroft/265354fa89b6c8c43389 to your computer and use it in GitHub Desktop.
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> | |
<title>Animations</title> | |
<body> | |
<script> | |
function createAndAnimate(part) { | |
var element = document.createElement('pre'); | |
element.textContent = part; | |
document.body.appendChild(element); | |
element.animate( | |
[ | |
{ 'transform': 'rotate(0deg)' }, | |
{ 'transform': 'rotate(360deg)' }, | |
], | |
{ | |
'duration': 5000, | |
'iterations': Infinity, | |
'delay': Math.random() * 5000, | |
} | |
); | |
} | |
document.documentElement | |
.outerHTML | |
.split('\n') | |
.forEach(createAndAnimate); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment