Created
February 23, 2018 14:08
-
-
Save figloalds/44a3d4f8b91e57f0b8cc9dfa208dcc5f 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
// Original code: | |
const $r = ()=>Math.random() | |
const __n= (b,n)=> (b+(n-(Math.random()*(n*2)))).toFixed(2) | |
const __f = (k,v,b,n) => `${k}(${__n(b,n)}${v},${__n(b,n)}${v})` | |
const __w = ()=>__f('translate','px',0,$r()>0.9?12:2); | |
const __el = document.querySelectorAll('*'); | |
const __t = () => setTimeout(()=> {__el.forEach(i=> {i.style.transition="50ms ease-in-out"; i.style.transform = __w();});__t()}, 100+($r()*1600)) | |
__t() | |
// Minified version | |
const $r=()=>Math.random(),__n=(_,t)=>(_+(t-Math.random()*(2*t))).toFixed(2),__f=(_,t,e,n)=>`${_}(${__n(e,n)}${t},${__n(e,n)}${t})`,__w=()=>__f("translate","px",0,$r()>.9?12:2),__el=document.querySelectorAll("*"),__t=()=>setTimeout(()=>{__el.forEach(_=>{_.style.transition="50ms ease-in-out",_.style.transform=__w()}),__t()},100+1600*$r());__t(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment