Advertisement
JakRapp

Waw 3

Sep 10th, 2016
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(){var global=this;var globalName='starField';var numberOfStars=90;var depthDimentsion=2000;var viewingDepth=0.0001;var forwardVelocity=0.3;var d=depthDimentsion*(viewingDepth / 100);var planeDepth=depthDimentsion-d;var fv=planeDepth*(forwardVelocity / 100);var zMultiplier=(depthDimentsion)/ d;var starObjs,starHTML;var posMod,sy,sx,windowCenterY,windowCenterX;var scaleXAdjust,scaleYAdjust;if((document.layers)&&(this.Layer)){starHTML=['<layer id=\"stars','','\" left=\"0\" top=\"0\" width=\"1\" height=\"1"',' bgColor=\"#FFFFFF\"><\/layer>'];}else{starHTML=['<div id="stars','','" style="position:absolute;width:1px;overflow:','hidden;height:1px;background-color:#FFFFFF;','font-size:1px"><\/div>'];}
  2. function compatModeTest(obj){if((document.compatMode)&&(document.compatMode.indexOf('CSS')!=-1)&&(document.documentElement)){return document.documentElement;}else if(document.body){return document.body;}else{return obj;}}
  3. function getWindowState(){var global=this;var readScroll={scrollLeft:NaN,scrollTop:NaN};var readSizeC={clientWidth:NaN,clientHeight:NaN};var readSizeI={innerWidth:NaN,innerHeight:NaN};var readScrollX='scrollLeft';var readScrollY='scrollTop';function getWidthI(){return readSizeI.innerWidth;}
  4. function getWidthC(){return readSizeC.clientWidth|0;}
  5. function getHeightI(){return readSizeI.innerHeight;}
  6. function getHeightC(){return readSizeC.clientHeight|0;}
  7. function getHeightSmart(){return retSmaller(getHeightI(),getHeightC());}
  8. function getWidthSmart(){return retSmaller(getWidthI(),getWidthC());}
  9. function setInnerWH(){theOne.getWidth=getWidthI;theOne.getHeight=getHeightI;}
  10. function retSmaller(inr,other){if(other>inr){setInnerWH();return inr;}else{return other;}}
  11. var theOne={getScrollX:function(){return readScroll[readScrollX]|0;},getScrollY:function(){return readScroll[readScrollY]|0;},getWidth:getWidthC,getHeight:getHeightC};function main(){return theOne;}
  12. function rankObj(testObj){var dv,dhN;if(testObj&&(typeof testObj.clientWidth=='number')&&(typeof testObj.clientHeight=='number')){if(((dv=global.innerHeight-testObj.clientHeight)>=0)&&((dh=global.innerWidth-testObj.clientWidth)>=0)){if(dh==dv){return 0;}else if((dh&&!dv)||(dv&&!dh)){return(dh+dv);}}}
  13. return NaN;}
  14. if((typeof global.innerHeight=='number')&&(typeof global.innerWidth=='number')){readSizeI=global;var bodyRank=rankObj(document.body);var rankDocEl=rankObj(document.documentElement);var selEl=null;if(!isNaN(bodyRank)){if(!isNaN(rankDocEl)){if(bodyRank<rankDocEl){selEl=document.body;}else if(bodyRank>rankDocEl){selEl=document.documentElement;}else{selEl=compatModeTest(document.body);}}else{selEl=document.body;}}else if(!isNaN(rankDocEl)){selEl=document.documentElement;}
  15. if(selEl){readSizeC=selEl
  16. theOne.getWidth=getWidthSmart;theOne.getHeight=getHeightSmart;}else{setInnerWH();}}else{readSizeC=compatModeTest(readSizeC);}
  17. if((typeof global.pageYOffset=='number')&&(typeof global.pageXOffset=='number')){readScroll=global;readScrollY='pageYOffset';readScrollX='pageXOffset';}else{readScroll=compatModeTest(readScroll);}
  18. return(getWindowState=main)();}
  19. var windowState=getWindowState();function readWindow(){scaleYAdjust=(((windowCenterY=(windowState.getHeight()>>1))-16)*zMultiplier);scaleXAdjust=(((windowCenterX=(windowState.getWidth()>>1))-16)*zMultiplier);sy=windowCenterY+windowState.getScrollY();sx=windowCenterX+windowState.getScrollX();}
  20. function getStyleObj(id){var obj=null;if(document.getElementById){obj=document.getElementById(id);}else if(document.all){obj=document.all[id];}else if(document.layers){obj=document.layers[id];}
  21. return((typeof obj!='undefined')&&(typeof obj.style!='undefined'))?obj.style:obj;}
  22. function starObj(id,parent,prv){var next,reset;var divClip,div=getStyleObj('stars'+id);var y,x,z,v,dx,dy,dm,dm2,px,py,widthPos,temp;(reset=function(){px=Math.random()<0.5?+1:-1;py=Math.random()<0.5?+1:-1;y=((Math.random()*Math.random()*scaleYAdjust)+windowCenterY);x=((Math.random()*Math.random()*scaleXAdjust)+windowCenterX);widthPos=(x+zMultiplier);z=0;})();z=Math.random()*planeDepth*0.8;function step(){temp=x*(v=d /(depthDimentsion-z));dm=((dm2=((widthPos*v)-temp)|0)>>1);dy=(y*v);dx=(temp);}
  23. if(div){if(!posMod){posMod=(typeof div.top=='string')?'px':0;}
  24. divClip=((typeof div.clip!='undefined')&&(typeof div.clip!='string'))?div.clip:div;this.position=function(){step();if(((z+=fv)>=planeDepth)||((dy+dm)>windowCenterY)||((dx+dm)>windowCenterX)){reset();step();dm=0;}
  25. div.top=((sy+(py*dy)-dm)|0)+posMod;div.left=((sx+(px*dx)-dm)|0)+posMod;divClip.width=(divClip.height=dm2+posMod);next.position();};}else{this.position=function(){return;};}
  26. if(++id<numberOfStars){next=new starObj(id,parent)}else{next=parent}}
  27. function init(){if(!getStyleObj('stars'+(numberOfStars-1))){setTimeout(starField,200);}else{readWindow();starObjs=new starObj(0,init);init.act();}};init.position=function(){return;}
  28. init.act=function(){readWindow();starObjs.position();setTimeout(init.act,50);};init.act.toString=function(){return globalName+'.act()';};init.toString=function(){while(global[globalName])globalName+=globalName;global[globalName]=this;return globalName+'()';};for(var c=numberOfStars;c--;){starHTML[1]=c;document.write(starHTML.join(''));}
  29. setTimeout(init,200);})();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement