Skip to content

Instantly share code, notes, and snippets.

@figloalds
Created February 23, 2018 14:08
Show Gist options
  • Save figloalds/44a3d4f8b91e57f0b8cc9dfa208dcc5f to your computer and use it in GitHub Desktop.
Save figloalds/44a3d4f8b91e57f0b8cc9dfa208dcc5f to your computer and use it in GitHub Desktop.
// 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