Skip to content

Instantly share code, notes, and snippets.

@b-coimbra
Created December 18, 2017 14:13
Show Gist options
  • Save b-coimbra/a038144ee53d799cf67198da3392c83a to your computer and use it in GitHub Desktop.
Save b-coimbra/a038144ee53d799cf67198da3392c83a to your computer and use it in GitHub Desktop.
function fun(){if(aZ=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],document.getElementById("animator")){var t=document.getElementById("animator");t.parentNode.removeChild(t)}f=document.createElement("style"),f.setAttribute("id","animator");for(var e=0;e<aZ.length-1;e++)h=Math.floor(Math.random()*(window.screen.width/Math.floor(8*Math.random())-1)),k=Math.floor(Math.random()*(window.screen.height/Math.floor(8*Math.random())-1)),g="@keyframes ${from{left:"+a[0]+"px; top:"+a[1]+"px}to{left:"+h+"px; top:"+k+"px}} @-webkit-keyframes ${from{left:"+a[0]+"px; top:"+a[1]+"px}to{left:"+h+"px; top:"+k+"px}}",a[0]=h,a[1]=k,f.innerHTML+=g.replace(/[\$]/g,aZ[e]);document.head.appendChild(f);for(var n=0;n<document.getElementsByTagName("*").length-1;n++){var o=document.getElementsByTagName("*")[n];-1==v.indexOf(o.tagName)&&(o.style.webkitAnimationName=aZ[Math.floor(Math.random()*(aZ.length-1))],o.style.webkitAnimationDuration=Math.floor(8*Math.random())+"s",o.style.webkitAnimationIterationCount="Infinite",o.style.animationName=aZ[Math.floor(Math.random()*(aZ.length-1))],o.style.animationDuration=Math.floor(8*Math.random())+"s",o.style.animationIterationCount="Infinite",o.style.display="run-in")}}var a=[0,0],v=["SCRIPT","HEAD","BODY","HTML","TITLE","META"];setTimeout(function(){setInterval(fun,2e3)},1500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment