Last active
March 6, 2018 04:51
-
-
Save tesiyosi/a8861232f0354d0ba19f4176a1d4b995 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
var divs = document.getElementsByTagName('div'); | |
var mode = Math.floor(Math.random() * 2); | |
for (var i = 0; i < divs.length; i++){ | |
var delay = Math.random() * 1000; | |
var d = divs[i]; | |
setTimeout(function(d) { | |
if (d){ | |
var t = Math.floor(Math.random() * 2000 + 1000); | |
d.style.transition = "all " + t +"ms ease-in"; | |
var deg = Math.random() * 30 - 15; | |
d.style.transform = "translate(0, 800px) rotate(" + deg + "deg)"; | |
} | |
}, delay, d); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment