2014. május 22., csütörtök
Tűzijáték effekt a blogra :33
Nah hozztam nektek egy kis effektet,hogy szebbé varázsoljátok a blogotokat :33.
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 ? "
"+theHtml+"
" : "
"+theHtml+"
" ); 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
1) { this.state="Bang" this.explode(); } } else { if(this.step > 40) this.state="Off"; this.step++; for(i=0 ; i
<
Nincsenek megjegyzések:
Megjegyzés küldése
Írj nyugodtan ide bármit nagyon kíváncsi vagyok a Te véleményedre*-*
Blogszerkeztője:cukifalat855
Újabb bejegyzés
Régebbi bejegyzés
Főoldal
Feliratkozás:
Megjegyzések küldése (Atom)
Nincsenek megjegyzések:
Megjegyzés küldése
Írj nyugodtan ide bármit nagyon kíváncsi vagyok a Te véleményedre*-*
Blogszerkeztője:cukifalat855