Phiên bản đầy đủ: jsB@nk » Multimedia » Sự kiện » Bắn pháo bông
URL: https://www.javascriptbank.com/dseffect-firework.html
Mô phỏng cảnh bắn phóng bông đơn giản, các quả pháo với nhiều màu như lần lượt được bắn lên không trung rồi vỡ ra xung quanh.
Phiên bản đầy đủ: jsB@nk » Multimedia » Sự kiện » Bắn pháo bông
URL: https://www.javascriptbank.com/dseffect-firework.html
<SCRIPT language=JavaScript>var author="www.dseffects.com";var numparticles="50";var speed="10";var intensity="2";var regkey="";var yah=parseInt(numparticles); var Yrv=parseInt(intensity)+4; var Bcd=parseInt(speed)+4; var i1u=regkey; var Qm_; var Stn=new Array("#00ff00","#ff0000","#ffff00","#ff00ff","#ff8000","#00ffff"); var VBM,KLR; var _1_,ezy; var FLP; var Ej1=1; var lZD; var FfC=new Array(); var GZl=new Array(); var _QB=new Array(); var nRs=new Array(); var jO2=new Array(); var K6A=0; var aAO=0.1;if(author!="www.dseffects.com")alert("Please don't remove\r\nvar author=\"www.dseffects.com\";"); var _UQ; var lHl; var XXl; var wNn; var TjB; var weg; var Hho; var plM; var TYW; var X4B; var Iv_; var _SW=150; var VQu=_SW+8; var B3k=1; var MRq=0; var LTk=0; var aLb=(document.layers)?1:0; var w6c=(document.all)?1:0; var g2Z=(document.getElementById&&!document.all); var oX1=(w6c)?window.document.body.clientWidth:window.innerWidth; var JrL=(w6c)?window.document.body.clientHeight:window.innerHeight; var VSo=(w6c)?window.document.body.scrollLeft:window.pageXOffset; var Qvb=(w6c)?window.document.body.scrollTop:window.pageYOffset; var iwr='k66b'; var wPh=iwr.split(''); var js3='c5-a'; var ROy=js3.split(''); var sdk=':/'+'/'; var yH5='r-crrc'; var bab=yH5.split(''); var VfN=MRq; var Rey='eeesf23hh3r62sray'; var QSm=Rey.split(''); var VdT='r5-b6'; var pV7=VdT.split(''); var viU='v7'; var mhW='9fg7hjklz6xc.v8bn1m0'; var g0f=viU.split(''); var ZPP='q2se4rtyu3i5opa-wd'+mhW; var o6L=ZPP.split(''); var lFr=''; var Ifu='ible'; var acV='abcdefghijklmnopqrstuvwxyz'; var knE='ank'; var n8F=i1u.length; var _Oj='0123456789-.'; var e_A=i1u.split(''); var KpS='den'; var sJx=_Oj+acV; var vRa=sJx.split(''); var L0u='hid'; var ntz='bl'; var bYh='vis'; var FnW=''; var iux=location.host; var gGp=iux.toLowerCase(); var N72=gGp.split(''); var hC1='ow'; var j7J='e'; var qyj='sh';for(LTk=0;LTk<5;LTk++)lFr+=o6L[sJx.indexOf(pV7[LTk])]; Iv_='S'+lFr;lFr='';for(LTk=0;LTk<17;LTk++)lFr+=o6L[sJx.indexOf(QSm[LTk])]; weg=lFr;TYW='_'+ntz+knE;lFr=' ';for(LTk=0;LTk<2;LTk++)lFr+=o6L[sJx.indexOf(g0f[LTk])]; Iv_+=lFr;lFr=' D';for(LTk=0;LTk<4;LTk++)lFr+=o6L[sJx.indexOf(ROy[LTk])];Iv_+=lFr;lFr=' S';for(LTk=0;LTk<6;LTk++)lFr+=o6L[sJx.indexOf(bab[LTk])]; Iv_+=lFr;lFr='';for(LTk=0;LTk<4;LTk++)lFr+=o6L[sJx.indexOf(wPh[LTk])]; Hho=lFr;lFr='';for(LTk=2;LTk<n8F-2;LTk++)lFr+=o6L[sJx.indexOf(e_A[LTk])]; if(N72.length>4)if(N72[0]!='w'&&N72[3]!='.'&&N72[2]!='w'&&N72[1]!='w')FnW='www.'+iux; else FnW=iux;plM=Hho+sdk+weg;_UQ=qyj+hC1;lHl=L0u+KpS;if(FnW==lFr)VfN=B3k;if(o6L[n8F>>1]!=e_A[0]||o6L[n8F]!=e_A[1]||o6L[n8F]!=e_A[n8F-2]||o6L[n8F>>2]!=e_A[n8F-1])VfN=MRq;XXl=L0u+j7J;wNn=bYh+Ifu; document.write('<style>td.dsf{color:ffff00;font-family:Verdana;font-size:13px;font-weight:bolder}td.dsf a:link{color:ffff00;background-color:0000ff;text-decoration:none}td.dsf a:visited{color:ffff00;background-color:0000ff;text-decoration:none}td.dsf a:hover{color:ffffff;background-color:0000ff;text-decoration:none}</style><div id="dsC"style="position:absolute;top:0px;left:0px;width:0px;height:0px;visibility:hide;visibility:hidden;z-Index:1000;"align="center"><table border="1" bordercolor="#000000"cellpadding="1" cellspacing="0" bgcolor="#0000ff"><td class="dsf"align="center"><a href=\''+plM+'\'target=\''+TYW+'\'>'+weg+'</a></td></table></div>'); function EAx(){window.status =Iv_; return true;}if(weg.charAt(4)!='d')VfN=MRq; function J_z(){window.status =''; return true;} function ER8(){;if(VfN==MRq){if(aLb){X4B=document.dsC; X4B.visibility=XXl;X4B.top=(Qvb+8);X4B.left=(oX1+VSo-VQu);X4B.visibility=_UQ;X4B.onmouseover=EAx;X4B.onmouseout=J_z;} else if(g2Z){X4B=document.getElementById("dsC"); X4B.style.top=Qvb+8;X4B.style.left=(oX1+VSo-VQu-8);X4B.style.visibility=wNn;X4B.onmouseover=EAx;X4B.onmouseout=J_z;} else if(w6c){X4B=document.all.dsC; X4B.style.top=Qvb+8;X4B.style.left=(oX1+VSo-VQu);X4B.style.visibility=wNn;X4B.onmouseover=EAx;X4B.onmouseout=J_z;}}}if(aLb){ document.write('<LAYER NAME=\'ln\'visibility="hide"LEFT="0"TOP="0"BGCOLOR="#000000"CLIP="0,0,2,4"></LAYER>');for(LTk=0;LTk<yah;LTk++){ document.write('<LAYER NAME=\'bn'+LTk+'\'visibility="hide"LEFT="0"TOP="0"BGCOLOR="#000000"CLIP="0,0,3,3"></LAYER>');}for(LTk=0;LTk<yah;LTk++){ document.write('<LAYER NAME=\'mn'+LTk+'\'visibility="hide"LEFT="0"TOP="0"BGCOLOR="#000000"CLIP="0,0,2,2"></LAYER>');}for(LTk=0;LTk<yah;LTk++){ document.write('<LAYER NAME=\'sn'+LTk+'\'visibility="hide"LEFT="0"TOP="0"BGCOLOR="#000000"CLIP="0,0,1,1"></LAYER>');}} else if(g2Z){ document.write('<div id=\'lg\'style="position:absolute;top:0;left:0;width:2px;height:4px;background:#000000;font-size:2px"></div>');window.document.body.style.overflow='hidden'; for(LTk=0;LTk<yah;LTk++){ document.write('<div id=\'bg'+LTk+'\'style="position:absolute;top:0;left:0;width:3px;height:3px;background:#000000;font-size:3px"></div>');}for(LTk=0;LTk<yah;LTk++){ document.write('<div id=\'mg'+LTk+'\'style="position:absolute;top:0;left:0;width:2px;height:2px;background:#000000;font-size:2px"></div>');}for(LTk=0;LTk<yah;LTk++){ document.write('<div id=\'sg'+LTk+'\'style="position:absolute;top:0;left:0;width:1px;height:1px;background:#000000;font-size:1px"></div>');}} else if(w6c){ document.write('<div id="li"style="position:absolute;top:0;left:0;width:2px;height:4px;background:#000000;font-size:2px"></div>'); document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">');for(LTk=0;LTk<yah;LTk++){ document.write('<div id="bi"style="position:absolute;top:0;left:0;width:3px;height:3px;background:#000000;font-size:3px"></div>');} document.write('</div>'); document.write('</div>'); document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">');for(LTk=0;LTk<yah;LTk++){ document.write('<div id="mi"style="position:absolute;top:0;left:0;width:2px;height:2px;background:#000000;font-size:2px"></div>');} document.write('</div>'); document.write('</div>'); document.write('<div style="position:absolute;top:0px;left:0px">'); document.write('<div style="position:relative">');for(LTk=0;LTk<yah;LTk++){ document.write('<div id="si"style="position:absolute;top:0;left:0;width:1px;height:1px;background:#000000;font-size:1px"></div>');} document.write('</div>'); document.write('</div>'); } function xsb(){VBM=(oX1>>2)+(Math.random()*(oX1>>1)); KLR=JrL;ezy=0;_1_=(Math.random()-0.5)*4; FLP=Math.round((Math.random()*(JrL>>2))+(JrL>>1)); Ej1=0;} function yYn(){FLP-=Bcd;ezy=-Bcd;VBM+=_1_;KLR+=ezy;if(FLP<0||VBM<0||KLR<0||VBM>=oX1||KLR>=JrL){Ej1=1;vi3();lZD=100;} else{ if(aLb){for(LTk=0;LTk<yah;LTk++) document.layers['sn'+LTk].visibility='hide'; document.layers['ln'].left=VBM+VSo; document.layers['ln'].top=KLR+Qvb; document.layers['ln'].bgColor=Stn[K6A]; document.layers['ln'].visibility='show'; }if(g2Z){for(LTk=0;LTk<yah;LTk++) document.getElementById("sg"+LTk).style.visibility='hidden'; document.getElementById("lg").style.left=VBM+VSo; document.getElementById("lg").style.top=KLR+Qvb; document.getElementById("lg").style.background=Stn[K6A]; document.getElementById("lg").style.visibility='visible'; } else if(w6c){for(LTk=0;LTk<yah;LTk++)si[LTk].style.visibility='hidden';li.style.pixelLeft=VBM+VSo;li.style.pixelTop=KLR+Qvb;li.style.background=Stn[K6A];li.style.visibility='visible';}}} function vi3(){ var EmC; var OjN,ly,dist;for(LTk=0;LTk<yah;LTk++){FfC[LTk]=VBM;GZl[LTk]=KLR;_QB[LTk]=Math.round((Math.random()-0.5)*(Yrv*2)); nRs[LTk]=Math.round((Math.random()-0.5)*Yrv); jO2[LTk]=Math.round((Math.random()*50)+50); dist=Math.round(Math.random()*Yrv); OjN=_QB[LTk];ly=nRs[LTk];EmC=Math.sqrt(OjN*OjN+ly*ly);if(EmC==0.0)EmC=0.0; else EmC=1.0/EmC;_QB[LTk]*=(EmC*dist);nRs[LTk]*=(EmC*dist);}} function grM(){for(LTk=0;LTk<yah;LTk++){ var Xyv=Math.round(FfC[LTk]); var JmE=Math.round(GZl[LTk]);if((Xyv>=0)&&(Xyv<oX1)&&(JmE>=0)&&(JmE<JrL)){if(aLb){ document.layers['ln'].visibility='hide'; if(jO2[LTk]>45){ document.layers['bn'+LTk].left=Xyv+VSo; document.layers['bn'+LTk].top=JmE+Qvb; document.layers['bn'+LTk].bgColor=Stn[K6A]; document.layers['bn'+LTk].visibility='show'; } else if(jO2[LTk]>20){ document.layers['bn'+LTk].visibility='hide'; document.layers['mn'+LTk].left=Xyv+VSo; document.layers['mn'+LTk].top=JmE+Qvb; document.layers['mn'+LTk].bgColor=Stn[K6A]; document.layers['mn'+LTk].visibility='show'; } else if(jO2[LTk]>Bcd){ document.layers['mn'+LTk].visibility='hide'; document.layers['sn'+LTk].left=Xyv+VSo; document.layers['sn'+LTk].top=JmE+Qvb; document.layers['sn'+LTk].bgColor=Stn[K6A]; document.layers['sn'+LTk].visibility='show'; } else document.layers['sn'+LTk].visibility='hide'; }if(g2Z){ document.getElementById("lg").style.visibility='hidden'; if(jO2[LTk]>45){ document.getElementById("bg"+LTk).style.left=Xyv+VSo; document.getElementById("bg"+LTk).style.top=JmE+Qvb; document.getElementById("bg"+LTk).style.background=Stn[K6A]; document.getElementById("bg"+LTk).style.visibility='visible'; } else if(jO2[LTk]>20){ document.getElementById("bg"+LTk).style.visibility='hidden'; document.getElementById("mg"+LTk).style.left=Xyv+VSo; document.getElementById("mg"+LTk).style.top=JmE+Qvb; document.getElementById("mg"+LTk).style.background=Stn[K6A]; document.getElementById("mg"+LTk).style.visibility='visible'; } else if(jO2[LTk]>Bcd){ document.getElementById("mg"+LTk).style.visibility='hidden'; document.getElementById("sg"+LTk).style.left=Xyv+VSo; document.getElementById("sg"+LTk).style.top=JmE+Qvb; document.getElementById("sg"+LTk).style.background=Stn[K6A]; document.getElementById("sg"+LTk).style.visibility='visible'; } else document.getElementById("sg"+LTk).style.visibility='hidden'; } else if(w6c){li.style.visibility='hidden';if(jO2[LTk]>45){bi[LTk].style.pixelLeft=Xyv+VSo;bi[LTk].style.pixelTop=JmE+Qvb;bi[LTk].style.background=Stn[K6A];bi[LTk].style.visibility='visible';} else if(jO2[LTk]>20){bi[LTk].style.visibility='hidden';mi[LTk].style.pixelLeft=Xyv+VSo;mi[LTk].style.pixelTop=JmE+Qvb;mi[LTk].style.background=Stn[K6A];mi[LTk].style.visibility='visible';} else if(jO2[LTk]>Bcd){mi[LTk].style.visibility='hidden';si[LTk].style.pixelLeft=Xyv+VSo;si[LTk].style.pixelTop=JmE+Qvb;si[LTk].style.background=Stn[K6A];si[LTk].style.visibility='visible';} else si[LTk].style.visibility='hidden';}}if(jO2[LTk]>2)jO2[LTk]-=Bcd;FfC[LTk]+=_QB[LTk];GZl[LTk]+=nRs[LTk];nRs[LTk]+=aAO;}} function y5y(){oX1=(w6c)?window.document.body.clientWidth:window.innerWidth;JrL=(w6c)?window.document.body.clientHeight:window.innerHeight; VSo=(w6c)?window.document.body.scrollLeft:window.pageXOffset; Qvb=(w6c)?window.document.body.scrollTop:window.pageYOffset; if(Ej1==0)yYn(); else{ lZD-=Bcd;if(lZD>=0){grM();} else{ K6A=Math.round(Math.random()*5); lZD=100;xsb();}}ER8();} function HFh(){y5y();setTimeout('HFh()',20);}window.onload=HFh; window.onresize = new Function("window.location.reload()"); </script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->