Created
June 26, 2020 21:43
-
-
Save themisir/1355f4da29030c759509b423d540a1de to your computer and use it in GitHub Desktop.
Make things go crazy
This file contains hidden or 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
let crazies = document.querySelectorAll('*') | |
setInterval(() => crazies = document.querySelectorAll('*'), 3000); | |
setInterval(() => crazies.forEach(e => { | |
let x = () => 200 * Math.random() - 100; | |
e.style.marginTop = x(); | |
e.style.marginLeft = x(); | |
e.style.paddingTop = x(); | |
e.style.paddingBottom = x(); | |
e.style.paddingLeft = x(); | |
e.style.paddingRight = x(); | |
e.style.left = x(); | |
e.style.top = x(); | |
e.style.right = x(); | |
e.style.bottom = x(); | |
e.style.transition = 'all 1s linear'; | |
}) , 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment