Advertisement
Tomlacko

Page Shake + John Cena

Apr 18th, 2017
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function start(){var elems=document.body.getElementsByTagName("*");var pos=[];for(var i=0;i<elems.length;i++){elems[i].style.position="relative";elems[i].style.transition="0.2s ease-in-out";pos.push([parseFloat(elems[i].style.top)||0,parseFloat(elems[i].style.left)||0]);}function repos(){for(var i=0;i<pos.length;i++){elems[i].style.top=pos[i][0]+Math.round(Math.random()*3)-1.5+"px";elems[i].style.left=pos[i][1]+Math.round(Math.random()*3)-1.5+"px";}setTimeout(repos,150);}var cl=true;var elem=document.createElement("img");elem.src="http://i.makeagif.com/media/8-27-2015/YUAPeC.gif";elem.id="jc";elem.style.cssText="position:fixed;top:50px;left:50px;z-index:999999999;width:50%;opacity:0.85;pointer-events:none;transition:opacity 0.5s;";var sn=new Audio("https://www.myinstants.com/media/sounds/and-his-name-is-john-cena-1.mp3");sn.currentTime=0.45;window.addEventListener("click",function(e){if(cl){e.preventDefault();cl=false;document.body.appendChild(elem);sn.play();setTimeout(function(){elem.style.opacity=0;},6700);}});repos();}if(document.readyState==="complete"||document.readyState==="loaded")start();else document.addEventListener("DOMContentLoaded",start);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement