Skip to content

Instantly share code, notes, and snippets.

@kourindouhime
Created October 4, 2018 15:36
Show Gist options
  • Save kourindouhime/93606fb31d531d307ca95f0426a1fc10 to your computer and use it in GitHub Desktop.
Save kourindouhime/93606fb31d531d307ca95f0426a1fc10 to your computer and use it in GitHub Desktop.
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var items = document.getElementsByTagName("*");
var ebashilovo = false;
setInterval(function() {
if (ebashilovo == true) {
for (i of items) {
i.style.transform = "translate("+getRandomInt(0,10)+"px,"+getRandomInt(0,10)+"px)";
}
}
},10)
ebashilovo = true
@7audio
Copy link

7audio commented Oct 4, 2018

(() => {
    function getRandomInt(min, max) {
        return Math.floor(Math.random() * (max - min + 1)) + min;
    }

    var items = document.getElementsByTagName("*");
    var ebashilovo = false;

    setInterval(function() {
        if (ebashilovo == true) {
            for (i of items) {
                i.style.transform = "translate("+getRandomInt(0,50)+"px,"+getRandomInt(0,50)+"px)";
                i.style.transform = "rotate("+getRandomInt(-10,10)+"deg)";
            }
        }
    }, 30);

    ebashilovo = true;
})()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment