Fuegos pirotécnicos en el blog – Asesor – School – Auto

Pues ya que está cerca la celebración del año nuevo veamos cómo poner un script que me compartióxulinho que hará que se muestrenfuegos artificiales en el blog.

Es un efecto sencillo pero que puede hacer amenas estas fechas de celebración o cualquier otra. Puedes ver el ejemplo eneste blog de pruebas.

Colocarlo es muy sencillo, sólo entra enDiseño | Edición de HTML y antes de/head agrega lo siguiente:
script type='text/javascript'
//![CDATA[
// Fuegos artificiales
var bits=200; //Número de puntos
var intensity=10; //Intensidad de la explosión (recomendado entre 3 y 10)
var speed=30; //Velocidad (a menor numero, mas rapido)
var colours=new Array("#03f", "#f03", "#0e0", "#93f", "#0cc", "#f93");
//Colores de los fuegos

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=document.createElement("div");
s=b.style;
s.position="absolute";
b.setAttribute("id", "bod");
document.body.appendChild(b);
set_scroll();
set_width();
b.appendChild(div("lg", 3, 4));
b.appendChild(div("tg", 2, 3));
for (var i=0; ibits; i++) b.appendChild(div("bg"+i, 1, 1));
}
function div(id, w, h) {
var d=document.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; ibits; i++) {
X=Math.round(Xpos[i]);
Y=Math.round(Ypos[i]);
Z=document.getElementById("bg"+i).style;
if((X=0)&&(Xswide)&&(Y=0)&&(Yshigh)) {
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 (yposbangheight||xpos0||xpos=swide||ypos=shigh) {
for (i=0; ibits; 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=document.getElementById("bg"+i).style;
Z.backgroundColor=colours[colour];
Z.visibility="visible";
}
bang();
launch();
}
document.getElementById("lg").style.left=xpos+"px";
document.getElementById("lg").style.top=ypos+"px";
document.getElementById("tg").style.left=oldx+"px";
document.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);
document.getElementById("lg").style.backgroundColor=colours[colour];
document.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 (document.body.scrollTop || document.body.scrollLeft) {
sdown=document.body.scrollTop;
sleft=document.body.scrollLeft;
}
else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {
sleft=document.documentElement.scrollLeft;
sdown=document.documentElement.scrollTop;
}
else {
sdown=0;
sleft=0;
}
var s=document.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 (document.documentElement && document.documentElement.clientWidth) {
swide=document.documentElement.clientWidth;
shigh=document.documentElement.clientHeight;
}
else if (document.body.clientWidth) {
swide=document.body.clientWidth;
shigh=document.body.clientHeight;
}
}
window.onload=function() { if (document.getElementById) {
set_width();
write_fire();
launch();
setInterval('stepthrough()', speed);
}}
//
/script
Encolor verde he puesto las indicaciones de la configuración del script.
Al igual que muchos de estos scripts las luces no llegan hasta abajo del blog; para modificar qué tanto abarcarán las luces se puede modificar donde está en negrita
var swide=800;
var shigh=600;
El primer valor es el ancho y el segundo es el alto.
¿Otra opción? Qué tal estaexplosión de estrellas.

Online Classes Cheap car insurance in Virginia Car Insurance Companies HOLLAND MICHIGAN COLLEGE california motorcycle accident lawyer Casino reviews Social media platforms Dayton Freight Lines mesothelioma lawyer california Cheap Car Insurance for Ladies WORLD TRADE CENTER FOOTAGE DONATE YOUR CAR FOR KIDS Best social media platforms for business BEST CRIMINAL LAWYER IN ARIZONA Dwi lawyer Best Criminal Lawyers in Arizona Casino Online casino Donate your Car for Money Criminal defense lawyer yahoo web hosting business voice mail service hosted predictive dialers mesothelioma law firm best mesothelioma lawyers Seo companies DALLAS MESOTHELIOMA ATTORNEYS Business management software primary pulmonary hypertension buy gift card insurance medical temporary HOME PHONE INTERNET BUNDLE mesothelioma care Social media campaigns cloud identity and access management Hire php programmers Donate Cars Illinois Criminal lawyer How to donate a car in California domains yahoo motorcycle accident attorney chicago Neuson Insurance Companies Hire php developers workers compensation lawyer los angeles Mobile casino WordPress hosting Email Bulk Service Forensics Online Course CHEAP AUTO INSURANCE IN VA Criminal lawyer Miami Data Recovery Raid compare life assurance Make money online Australia Structures Annuity Settlement PAPERPORT PROMOTIONAL CODE Live casino Adobe illustrator classes Personal Injury Law Firm Social media examiner purchase structured settlements ONLINE COLLEDGES How to Donate A Car in California personal injury firm Donate cars Illinois Donate Car to Charity California structured settlement broker DUI lawyer emergency response plan ppt broward county dui lawyer accident car florida lawyer mesotheloma WordPress theme designers Php programmers for hire auto insurance yuba city ca DONATE YOUR CAR SACRAMENTO DONATE OLD CARS TO CHARITY Italian cooking school Service business software lawsuit mesothelioma Auto Mobile Insurance Quote workplace accident attorney Register Free Domains Custom WordPress theme designer houston motorcycle accident lawyer CAR DONATE Car Insurance Quotes MN Donating a Car in Maryland philadelphia mesothelioma lawyer motorcycle accident attorney sacramento Donate Car for Tax Credit Hire php developer Bankruptcy lawyer Custom Christmas cards structured settlement cash out Computer science classes online buyer of structured settlement annuity ANNUITY SETTLEMENT Php programmers new mexico mesothelioma lawyer Personal Injury Lawyers New social media platforms Car Donate mesothelioma attorneys Psd to html chicago hair laser removal Donate a Car in Maryland Business finance group Better Conference Calls lease management software pharmacist jobs in chicago Social media platforms for business DONATE CAR FOR TAX CREDIT Better conferencing calls motorcycle accident lawyer san francisco

Share: