Skip to content

Instantly share code, notes, and snippets.

@tesiyosi
Last active March 6, 2018 04:51
Show Gist options
  • Save tesiyosi/a8861232f0354d0ba19f4176a1d4b995 to your computer and use it in GitHub Desktop.
Save tesiyosi/a8861232f0354d0ba19f4176a1d4b995 to your computer and use it in GitHub Desktop.
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