snoweffects
Bu kodu sitenize yerleştiriniz.<script language="JavaScript">var schnee={flockenanzahl:100,flockenfarbe:["#AAAACC","#CCCCDD","#DDDDFF","#F3F3F3","#F0FFFF","#FFFFFF"],flockenschriftart:["Arial","Arial Narrow","Comic Sans MS","Gill Sans","Tahoma","Times","Verdana"],flocke:"*",geschwindigkeit:.3,kleinsteflocke:10,groessteflocke:25,bewegung:30,zindex:2e4,flocken:[],bodywidth:0,bodyheight:0,range:null,count:0,timeout:20,lastinterval:0,eventhandleresize:window.onresize,eventhandleload:window.onload,start:function(){if(this.eventhandleload!=null)this.eventhandleload();this.range=this.groessteflocke-this.kleinsteflocke;this.windowSize();while(this.flockenanzahl>this.flocken.length)this.createFlake(this.flocken.length);this.lastinterval=this.time();window.setInterval(function(){schnee.movin()},this.timeout)},time:function(){return+(new Date)},random:function(e){return Math.floor(Math.random()*e)},createFlake:function(e){var t=document.getElementsByTagName("body")[0];var n=document.createElement("div");n.id="flake"+e;n.style.position="absolute";n.style.left="0px";n.style.top="-"+this.groessteflocke+"px";n.style.color=this.flockenfarbe[this.random(this.flockenfarbe.length-1)];n.style.family=this.flockenschriftart[this.random(this.flockenschriftart.length-1)];n.style.fontSize=this.random(this.range)+this.kleinsteflocke+"px";n.style.zIndex=this.zindex;n.innerHTML=this.flocke;t.appendChild(n);this.flocken[e]={x:this.random(this.bodywidth-this.bewegung-this.groessteflocke-3)+this.bewegung+1,y:-this.groessteflocke-this.random(this.bodyheight),size:this.random(this.range)+this.kleinsteflocke,count:this.random(1e4)}},restartFlake:function(e){this.flocken[e]={x:this.random(this.bodywidth-this.bewegung-this.groessteflocke-3)+this.bewegung+1,y:-this.groessteflocke,size:this.random(this.range)+this.kleinsteflocke,count:this.random(1e4)}},movin:function(){var e=this.time()-this.lastinterval;this.lastinterval=this.time();var t=e*this.geschwindigkeit;this.count+=t/80;for(var n=0;n<this.flocken.length;n++){var r=this.flocken[n];r.y+=t*this.geschwindigkeit*this.groessteflocke/r.size;if(r.y+r.size>=this.bodyheight){this.restartFlake(n);continue}var i=document.getElementById("flake"+n);i.style.left=Math.floor(r.x+Math.sin(r.count+this.count)*this.bewegung)+"px";i.style.top=Math.floor(r.y)+"px"}},windowSize:function(){var e=this.bodywidth;this.bodywidth=this.getWindowWidth()-this.groessteflocke;this.bodyheight=this.getWindowHeight()-this.groessteflocke;var t=this.bodywidth/e;for(var n=0;n<this.flocken.length;n++){var r=this.flocken[n];r.x*=t;if(r.y+r.size>=this.bodyheight)this.restartFlake(n)}},getWindowWidth:function(){var e=Math.max(self.innerWidth||0,window.innerWidth||0);if(document.documentElement)e=Math.max(e,document.documentElement.clientWidth||0);if(document.body){e=Math.max(e,document.body.clientWidth||0);e=Math.max(e,document.body.scrollWidth||0);e=Math.max(e,document.body.offsetWidth||0)}return e},getWindowHeight:function(){var e=Math.max(self.innerHeight||0,window.innerHeight||0);if(document.documentElement)e=Math.max(e,document.documentElement.clientHeight||0);if(document.body){e=Math.max(e,document.body.clientHeight||0);e=Math.max(e,document.body.scrollHeight||0);e=Math.max(e,document.body.offsetHeight||0)}return e},resize:function(){if(this.eventhandleresize!=null)this.eventhandleresize();this.windowSize()}};window.onresize=function(){schnee.resize()};window.onload=function(){schnee.start()}</script>
Önizleme
Bu kodun önizlemesi bu sayfadadır.