The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Add Fireworks to the forum?

View previous topic View next topic Go down

In progress Add Fireworks to the forum?

Post by Neymar1 on December 24th 2011, 12:10 pm

I've currently got the falling snow javascript code on my forum.

I want to know if there is a way of getting fireworks on the forum, for New Year.

Thanks.

Neymar1
Forumember

Male Posts : 406
Reputation : 27
Language : HTML, CSS, and a bit of JavaScript
Location : Scotland

http://www.simplyfifa.com

Back to top Go down

In progress Re: Add Fireworks to the forum?

Post by Nera. on December 24th 2011, 12:59 pm

Hi,

Take the code from the topic and add it to AP > Display > Homepage > Generalities > Message content
http://www.admincentar.net/mybb/showthread.php?tid=11922

Nera.
Energetic

Female Posts : 7077
Reputation : 2013
Language : English
Location : -

http://webartzforum.com

Back to top Go down

In progress Re: Add Fireworks to the forum?

Post by WHITESABBATH on December 24th 2011, 7:06 pm

I cannot recall where i obtained the attached script, to respectively show recognition to its creator(I apologies).
Most of the scripts i have found in this site, (for fireworks),no longer seem to work. The one offered via Nera's link wouldn't work either. The attached does work..
Place this in your home page message just as nera instructed. santa
Code:
<SCRIPT LANGUAGE="JavaScript">
if (document.getElementById){
 
showerCol=new Array('#000000','#ff0000','#ffffff','#000000','#00ff00','#ff00ff','#ffffff','#ffa500','#000000','#fff000');
launchCol=new Array('#ffff00','#ff00ff','#00ffff','#ffffff','#ff8000');
runSpeed=50; //setTimeout speed.
 
// *** DO NOT EDIT BELOW ***
 
var yPos=200;
var xPos=200;
var explosionSize=200;
var launchColour='#ffff80';
var timer=null;
var dims=1;
var evn=360/14;
firework=new Array();
var ieType=(typeof window.innerWidth != 'number');
var ieRef=((ieType) && (document.compatMode) &&
(document.compatMode.indexOf("CSS") != -1))
?document.documentElement:document.body;
thisStep=0;
step=5;
 
for (i=0; i < 14; i++){
document.write('<div id="sparks'+i+'" style="position:absolute;top:0px;left:0px;height:1px;width:1px;font-size:1px;background-color:'+launchColour+'"><\/div>');
firework[i]=document.getElementById("sparks"+i).style;
}
 
function winDims(){
winH=(ieType)?ieRef.clientHeight:window.innerHeight;
winW=(ieType)?ieRef.clientWidth:window.innerWidth;
bestFit=(winW >= winH)?winH:winW;
}
winDims();
window.onresize=new Function("winDims()");
 
function Reset(){
var dsy=(ieType)?ieRef.scrollTop:window.pageYOffset;
thisStep=-1;
launchColour = launchCol[Math.floor(Math.random()*launchCol.length)];
explosionSize=Math.round(100+Math.random()*(bestFit/4));
yPos = explosionSize+Math.round(Math.random()*(winH-(explosionSize*3.2)))+dsy;
xPos = explosionSize+Math.round(Math.random()*(winW-(explosionSize*3.2)));
dims=1;
for (i=0; i < 14; i++){
 firework[i].backgroundColor=launchColour;
 firework[i].width=dims+"px";
 firework[i].height=dims+"px";
 firework[i].fontSize=dims+"px";
}
Fireworks();
}
 
function Fireworks(){
thisStep+=step;
timer=setTimeout("Fireworks()",runSpeed);
 
for (i=0; i < 14; i++){
firework[i].top = yPos + explosionSize * Math.sin(i*evn*Math.PI/180)*Math.sin(thisStep/100)+"px";
firework[i].left= xPos + explosionSize * Math.cos(i*evn*Math.PI/180)*Math.sin(thisStep/100)+"px";
 if (thisStep > 100){
 dims=(explosionSize < 150)?1:Math.round(1+Math.random()*2);
 firework[i].backgroundColor=showerCol[Math.floor(Math.random()*showerCol.length)];
 firework[i].width=dims+"px";
 firework[i].height=dims+"px";
 firework[i].fontSize=dims+"px";
 }
}
if (thisStep > 160){
 clearTimeout(timer);
 Reset();
}
}
window.onload=Fireworks;
}
//-->
</SCRIPT>

Edit:12/25 I was delighted to receive a PM this morning from RoNo (thanks again), informing me that he in fact had posted the above script . Now we know santa

WHITESABBATH
Active Poster

Male Posts : 1198
Reputation : 119
Language : English, F-Bombs
Location : Chicago

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum