THT DUYURU

chat
takipci
chat
Seçenekler

Fireworks Effect

The Cry - ait Kullanıcı Resmi (Avatar)
Üye
Üyelik tarihi:
10/2007
Nereden:
"-Her Yerden-"
Yaş:
28
Mesajlar:
3.119
Konular:
1761
Teşekkür (Etti):
74
Teşekkür (Aldı):
454
Ticaret:
(0) %
0
1542
13-06-2009 15:01
#1
Fireworks Effect
Kod:
<!--- KAYNAK: http://www.gezginler.net --->
<script type="text/javascript">
// <![CDATA[
var bits=100; // how many bits
var intensity=22; // how 'powerful' is the explosion (from 3 to 10 is best)
var speed=20; // how fast - smaller is faster
var colours=new Array("#03f", "#f03", "#0e0", "#93f", "#0cc", "#f93"); 
//                     blue    red     green   purple  cyan    orange
/****************************
*      Fireworks Effect     *
*(c) 2004-6 mf2fm web-design*
*  http://www.mf2fm.com/rv  *
* DON'T EDIT BELOW THIS BOX *
****************************/
var dx, xpos, ypos, bangheight;
var Xpos=new Array();
var Ypos=new Array();
var dX=new Array();
var dY=new Array();
var decay=new Array();
var colour=0;
var swide=800;
var shigh=600;
function write_fire() {
  var b, s;
  b=********.createElement("div");
  s=b.style;
  s.position="absolute";
  b.setAttribute("id", "bod");
  ********.body.appendChild(b);
  set_scroll();
  set_width();
  b.appendChild(div("lg", 3, 4));
  b.appendChild(div("tg", 2, 3));
  for (var i=0; i<bits; i++) b.appendChild(div("bg"+i, 1, 1));
}
function div(id, w, h) {
  var d=********.createElement("div");
  d.style.position="absolute";
  d.style.overflow="hidden";
  d.style.width=w+"px";
  d.style.height=h+"px";
  d.setAttribute("id", id);
  return (d);
}
function bang() {
  var i, X, Y, Z, A=0;
  for (i=0; i<bits; i++) { 
    X=Math.round(Xpos[i]); 
    Y=Math.round(Ypos[i]);
    Z=********.getElementById("bg"+i).style;
    if((X>=0)&&(X<swide)&&(Y>=0)&&(Y<shigh)) {
      Z.left=X+"px";
      Z.top=Y+"px";
 }
    if ((decay[i]-=1)>14) { 
   Z.width="3px";
   Z.height="3px";
    }
    else if (decay[i]>7) { 
   Z.width="2px";
   Z.height="2px";
    }
    else if (decay[i]>3) { 
   Z.width="1px";
   Z.height="1px";
    } 
    else if (++A) Z.visibility="hidden";
    Xpos[i]+=dX[i];
    Ypos[i]+=(dY[i]+=1.25/intensity);
  }
  if (A!=bits) setTimeout("bang()", speed);
}
 
function stepthrough() { 
  var i, Z;
  var oldx=xpos;
  var oldy=ypos;
  xpos+=dx;
  ypos-=4;
  if (ypos<bangheight||xpos<0||xpos>=swide||ypos>=shigh) {
    for (i=0; i<bits; i++) {
      Xpos[i]=xpos;
      Ypos[i]=ypos;
      dY[i]=(Math.random()-0.5)*intensity;
      dX[i]=(Math.random()-0.5)*(intensity-Math.abs(dY[i]))*1.25;
      decay[i]=Math.floor((Math.random()*16)+16);
      Z=********.getElementById("bg"+i).style;
      Z.backgroundColor=colours[colour];
   Z.visibility="visible";
    }
    bang();
    launch();
  }
  ********.getElementById("lg").style.left=xpos+"px";
  ********.getElementById("lg").style.top=ypos+"px";
  ********.getElementById("tg").style.left=oldx+"px";
  ********.getElementById("tg").style.top=oldy+"px";
} 
function launch() {
  colour=Math.floor(Math.random()*colours.length);
  xpos=Math.round((0.5+Math.random())*swide*0.5);
  ypos=shigh-5;
  dx=(Math.random()-0.5)*4;
  bangheight=Math.round((0.5+Math.random())*shigh*0.4);
  ********.getElementById("lg").style.backgroundColor=colours[colour];
  ********.getElementById("tg").style.backgroundColor=colours[colour];
}
window.onscroll=set_scroll;
function set_scroll() {
  var sleft, sdown;
  if (typeof(self.pageYOffset)=="number") {
    sdown=self.pageYOffset;
    sleft=self.pageXOffset;
  }
  else if (********.body.scrollTop || ********.body.scrollLeft) {
    sdown=********.body.scrollTop;
    sleft=********.body.scrollLeft;
  }
  else if (********.********Element && (********.********Element.scrollTop || ********.********Element.scrollLeft)) {
    sleft=********.********Element.scrollLeft;
 sdown=********.********Element.scrollTop;
  }
  else {
    sdown=0;
    sleft=0;
  }
  var s=********.getElementById("bod").style;
  s.top=sdown+"px";
  s.left=sleft+"px";
}
window.onresize=set_width;
function set_width() {
  if (typeof(self.innerWidth)=="number") {
    swide=self.innerWidth;
    shigh=self.innerHeight;
  }
  else if (********.********Element && ********.********Element.clientWidth) {
    swide=********.********Element.clientWidth;
    shigh=********.********Element.clientHeight;
  }
  else if (********.body.clientWidth) {
    swide=********.body.clientWidth;
    shigh=********.body.clientHeight;
  }
}
window.onload=function() { if (********.getElementById) {
  set_width();
  write_fire();
  launch();
  setInterval('stepthrough()', speed);
}}
// ]]>
</script>
<!--- KAYNAK: http://www.gezginler.net --->
---------------------
Söylediklerim ile kulaklarınız çınlamıyorsa hazmedemiyosunuzdur beni.
CEHENNEM07 Teşekkür etti.

Bookmarks


« Önceki Konu | Sonraki Konu »
Seçenekler