tűzijáték demó és kód

<!--Simply copy and paste just above </body></html> in your page.-->

<body><SCRIPT TYPE="text/javascript">
<!-- Fireworks Display
<!-- This script and many more from -->
<!-- http://rainbow.arch.scriptmania.com -->

if(!window.fireworks) fireworks=new Object();

if(!fireworks.createLayer)
{

var ns4 = document.layers;
var ie4 = document.all;
fireworks.objNo=0;

fireworks.getObjId = function(){return "fireworks_obj" + fireworks.objNo++;};

fireworks.createLayer = function(theHtml)
{
 var layerId = fireworks.getObjId();

 document.write(ns4 ? "<LAYER  NAME='"+layerId+"'>"+theHtml+"</LAYER>" :
       "<DIV id='"+layerId+"' style='position:absolute'>"+theHtml+"</DIV>" );

 var el =  document.getElementById ? document.getElementById(layerId) :
   document.all   ? document.all[layerId] :
         document.layers[layerId];

 if(ns4)
  el.style=el;

 return el;
}
fireworks.fxLayer = function(theHtml)
{
 if(theHtml == null) return;
 this.el = fireworks.createLayer(theHtml);
}
var proto = fireworks.fxLayer.prototype

proto.moveTo     = function(x,y){this.el.style.left = x;this.el.style.top=y;}
proto.setBgColor = function(color) { this.el.style.backgroundColor = color; }
proto.clip       = function(x1,y1, x2,y2){ this.el.style.clip="rect("+y1+" "+x2+" "+y2+" "+x1+")"; }
if(ns4){
 proto.clip = function(x1,y1, x2,y2){
  this.el.style.clip.top  =y1;this.el.style.clip.left =x1;
  this.el.style.clip.bottom=y2;this.el.style.clip.right =x2;
 }
 proto.setBgColor=function(color) { this.el.bgColor = color; }
}
if(window.opera)
 proto.setBgColor = function(color) { this.el.style.color = color==null?'transparent':color; }

if(window.innerWidth)
{
 gX=function(){return innerWidth;};
 gY=function(){return innerHeight;};
}
else
{
 gX=function(){return document.body.clientWidth;};
 gY=function(){return document.body.clientHeight;};
}
fireworks.fxLayer2 = function(theHtml)
{
 this.superC = fireworks.fxLayer;
 this.superC(theHtml + "C");
}
fireworks.fxLayer2.prototype = new fireworks.fxLayer;
}
fireworks.Spark = function(x, y)
{
 this.superC = fireworks.fxLayer;
 this.superC("*");

 this.dx  = Math.random() * 4 - 2;
 this.dy = Math.random() * 4 - 2;
 this.ay = .09;
 this.x = x;
 this.y = y;
 this.type = 0;
}
fireworks.Spark.prototype = new fireworks.fxLayer;

fireworks.Spark.prototype.fire0 = function()
{
 var a = Math.random() * 6.294;
 var s = Math.random() * 2;
 if(Math.random() >.6) s = 2;
 this.dx = s*Math.sin(a);
 this.dy = s*Math.cos(a) - 2;
}
fireworks.Spark.prototype.fire1 = function()
{
 var a = Math.random() * 6.294;
 var s = Math.random() * 2;
 this.dx = s*Math.sin(a);
 this.dy = s*Math.cos(a) - 2;
}
fireworks.Spark.prototype.fire2 = function()
{
 var a = Math.random() * 6.294;
 var s = 2;
 this.dx = s*Math.sin(a);
 this.dy = s*Math.cos(a) - 2;
}
fireworks.Spark.prototype.fire3 = function()
{
 var a = Math.random() * 6.294;
 var s = a - Math.random();
 this.dx = s*Math.sin(a);
 this.dy = s*Math.cos(a) - 2;
}
fireworks.Spark.prototype.fire4 = function()
{
 var a = Math.random() * 6.294;
 var s = (Math.random() > 0.5) ? 2 : 1;
 if(s==1)this.setBgColor("#FFFFFF");
 s -= Math.random()/4;
 this.dx = s*Math.sin(a);
 this.dy = s*Math.cos(a) - 2;
}
fireworks.Spark.prototype.fire = function(sx, sy, fw, cl)
{
 this.setBgColor(cl);

 if(fw == 1)
  this.fire1();
 else if(fw == 2)
  this.fire2();
 else if(fw == 3)
  this.fire3();
 else if(fw == 4)
  this.fire4();
 else
  this.fire0();

 this.x = sx;
 this.y = sy;
 this.moveTo(sx, sy);
}
fireworks.Spark.prototype.animate = function(step)
{
 this.dy += this.ay;
 this.x += this.dx;
 this.y += this.dy;
 this.moveTo(this.x, this.y);
}
fireworks.Firework = function(numSparks)
{
 window[ this.id = fireworks.getObjId() ] = this;

 this.sparkle = new Array();
 for(i=0 ; i<numSparks; i++)
 {
  this.sparkle[i]=new fireworks.Spark(-10, -10);
  this.sparkle[i].clip(0,0,3,3);
  this.sparkle[i].setBgColor("#00FF00");
 }
 this.step = 0;
 this.timerId = -1;
 this.x = 0;
 this.y = 0;
 this.dx = 0;
 this.dy = 0;
 this.ay = 0.2;
 this.state = "Off";
}
fireworks.Firework.prototype.explode = function()
{
 var fw = Math.floor(Math.random() * 5);

 for(i=0 ; i<this.sparkle.length ; i++)
 {
  this.sparkle[i].fire(this.x, this.y, fw, this.color);
  this.sparkle[i].dx += this.dx;
  this.sparkle[i].dy += this.dy;
 }
}
fireworks.Firework.prototype.getMaxDy = function()
{
 var ydiff = gY() - 30;
 var dy    = 1;
 var dist  = 0;
 var ay    = this.ay;
 while(dist<ydiff)
 {
  dist += dy;
  dy+=ay;
 }
 return -dy;
}
fireworks.Firework.prototype.animate = function()
{
 if(this.state=="Off")
 {
  var colors = new Array("#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#FFFFFF", "#FF00FF");
  this.color = colors[Math.floor(Math.random()*colors.length)];

  this.step = 0;
  this.x = gX()/2;
  this.y = gY()-10;
  this.dy = this.getMaxDy();
  this.dx = Math.random()*-8 + 4;
  this.dy += Math.random()*3;
  for(i=0 ; i<this.sparkle.length ; i++)
   this.sparkle[i].moveTo(-10,-10);
  this.sparkle[0].setBgColor(this.color);
  this.state = "Move";
 }
 else if(this.state=="Move")
 {
  this.x += this.dx;
  this.y += this.dy;
  this.dy += this.ay;
  this.sparkle[0].moveTo(this.x,this.y);
  if(this.dy > 1)
  {
   this.state="Bang"
   this.explode();
  }
 }
 else
 {
  if(this.step > 40)
   this.state="Off";

  this.step++;

  for(i=0 ; i<this.sparkle.length ; i++)
   this.sparkle[i].animate(this.step);
 }
}
fireworks.Firework.prototype.start = function()
{
 if(this.timerId == -1)
 {
  this.state = "Off";
  this.timerId = setInterval("window."+this.id+".animate()", 30);
 }
}
fireworks.Firework.prototype.stop = function()
{
 if(this.timerId != -1)
 {
  clearInterval(this.timerId);
  for(i=0 ; i<this.sparkle.length ; i++)
   this.sparkle[i].moveTo(-10,-10);
  this.timerId = -1;
  this.step = 0;
 }
}
fireworks.DisplayStart = function()
{
 if(fireworks.DisplayLoad)fireworks.DisplayLoad();
 Display1.start();
 Display2.start();
 Display3.start();
}
Display1 = new fireworks.Firework(30);
Display2 = new fireworks.Firework(30);
Display3 = new fireworks.Firework(30);
fireworks.DisplayLoad=window.onload;
window.onload=fireworks.DisplayStart;
// -->
</SCRIPT></body>

 
Oldal információ

Portálépítés és portáldíszítés kezdőknek és haladóknak! Rengetek leírás, JavaScriptek , CSS ,HTML kódok,Naptár,Design!
E-mail:virag-78@gportal.hu
Tárhely: gportal.hu
Kategoria:Portálépítés
Indulás:2005.04.12.
URL: jegvirag.gportal.hu
Facebook: Virág Design
Szerkeszto/Design:Virág

   

Virág1 , Jégvirág , Virgonc , Minta
 
Javascript,Html kód
 
Blog plusz
 
Kiemelt Menü
(Ha a képekre kattintasz akkor az elkövetkező ÜNNEPEKRE,ÉVSZAKOKRA JUTSZ el:( tavaszi menü , nyári menü , őszi menü ,  téli menüjévi menü ,  farsangi menü , valentin napi menü , anyák napi menü  , húsvéti menü , halloween menü , hálaadás menü , karácsonyi menü , születésnapi menü , gyerek napi menü  ) Amiben megtalálsz mindent amihez egy weboldalon szükség lehet.Kellemes weboldalszerkesztést!)
 
Belépés
Felhasználónév:

Jelszó:
SúgóSúgó
Regisztráció
Elfelejtettem a jelszót
 

 

Számláló
Indulás: 2005-04-12
 
Google hirdetés
 
Copyright  © 2005-2024 Virág Design /  www.jegvirag.gportal.hu /  virag-78@gportal.hu

 


Nyereményjáték! Nyerd meg az éjszakai arckrémet! További információkért és játék szabályért kattints! Nyereményjáték!    *****    A legfrissebb hírek Super Mario világából, plusz információk, tippek-trükkök, végigjátszások!    *****    Ha hagyod, hogy magával ragadjon a Mario Golf miliõje, akkor egy egyedi és életre szóló játékélménnyel leszel gazdagabb!    *****    A horoszkóp a lélek tükre, nagyon fontos idõnként megtudni, mit rejteget. Keress meg és nézzünk bele együtt. Várlak!    *****    Dryvit, hõszigetelés! Vállaljuk családi házak, lakások, nyaralók és egyéb épületek homlokzati szigetelését!    *****    rose-harbor.hungarianforum.com - rose-harbor.hungarianforum.com - rose-harbor.hungarianforum.com    *****    Vérfarkasok, boszorkányok, alakváltók, démonok, bukott angyalok és emberek. A világ oly' színes, de vajon békés is?    *****    Az emberek vakok, kiváltképp akkor, ha olyasmivel találkoznak, amit kényelmesebb nem észrevenni... - HUNGARIANFORUM    *****    Valahol Delaware államban létezik egy város, ahol a természetfeletti lények otthonra lelhetnek... Közéjük tartozol?    *****    Minden mágia megköveteli a maga árát... Ez az ár pedig néha túlságosan is nagy, hogy megfizessük - FRPG    *****    Why do all the monsters come out at night? - FRPG - Why do all the monsters come out at night? - FRPG - Aktív közösség    *****    Az oldal egy évvel ezelõtt költözött új otthonába, azóta pedig az élet csak pörög és pörög! - AKTÍV FÓRUMOS SZEREPJÁTÉK    *****    Vajon milyen lehet egy rejtélyekkel teli kisváros polgármesterének lenni? És mi történik, ha a bizalmasod árul el?    *****    A szörnyek miért csak éjjel bújnak elõ? Az ártatlan külsõ mögött is lapulhat valami rémes? - fórumos szerepjáték    *****    Ünnepeld a magyar költészet napját a Mesetárban! Boldog születésnapot, magyar vers!    *****    Amikor nem tudod mit tegyél és tanácstalan vagy akkor segít az asztrológia. Fordúlj hozzám, segítek. Csak kattints!    *****    Részletes személyiség és sors analízis + 3 éves elõrejelzés, majd idõkorlát nélkül felteheted a kérdéseidet. Nézz be!!!!    *****    A horoszkóp a lélek tükre, egyszer mindenkinek érdemes belenéznie. Ez csak intelligencia kérdése. Tedd meg Te is. Várlak    *****    Új kínálatunkban te is megtalálhatod legjobb eladó ingatlanok között a megfelelõt Debrecenben. Simonyi ingatlan Gportal    *****    Szeretnél egy jó receptet? Látogass el oldalamra, szeretettel várlak!