falling snow?

Support for IntegraMOD 141

Moderator: Integra Moderator

falling snow?

PostAuthor: Karl-D » Wed Nov 26, 2008 3:51 pm

Hya fellas can somebody please tell me were I need to insert the java script so I can have falling snow on my forum, I cant remember for the life of me were to put the part were it should go in head and body of a html page <img>
User avatar
Karl-D
Integra Supporter
Integra Supporter
 
Posts: 104
Likes: 0 post
Liked in: 0 post
Joined: Tue May 30, 2006 6:23 am
Cash on hand: 0.00
Location: Cornwall UK

Re: falling snow?

PostAuthor: Helter » Wed Nov 26, 2008 10:08 pm

open your template/overall_header.tpl

FIND
Code: Select all
 </head><body>


AFTER, ADD

Code: Select all
<script>// <![CDATA[  /******************************************* Snow Effect Script- By Altan d.o.o. ([url=http]http://www.altan.hr/snow/index.html[/url])* Visit Dynamic Drive DHTML code library ([url=http://www.dynamicdrive.com/]http://www.dynamicdrive.com/[/url]) for full source code* Last updated Nov 9th, 05' by DD. This notice must stay intact for use******************************************/     //Configure below to change URL path to the snow image   var snowsrc="images/snow.gif"   // Configure below to change number of snow to render   var no = 10;   // Configure whether snow should disappear after x seconds (0=never):   var hidesnowtime = 0;   // Configure how much snow should drop down before fading ("windowheight" or "pageheight")   var snowdistance = "pageheight";  ///////////Stop Config//////////////////////////////////     var ie4up = (document.all) ? 1 : 0;   var ns6up = (document.getElementById&&!document.all) ? 1 : 0;       function iecompattest(){     return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body     }     var dx, xp, yp;    // coordinate and position variables   var am, stx, sty;  // amplitude and step variables   var i, doc_width = 800, doc_height = 600;     if (ns6up) {     doc_width = self.innerWidth;     doc_height = self.innerHeight;   } else if (ie4up) {     doc_width = iecompattest().clientWidth;     doc_height = iecompattest().clientHeight;   }     dx = new Array();   xp = new Array();   yp = new Array();   am = new Array();   stx = new Array();   sty = new Array();   snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc   for (i = 0; i < no; ++ i) {       dx[i] = 0;                        // set coordinate variables     xp[i] = Math.random()*(doc_width-50);  // set position variables     yp[i] = Math.random()*doc_height;     am[i] = Math.random()*20;         // set amplitude variables     stx[i] = 0.02 + Math.random()/10; // set step variables     sty[i] = 0.7 + Math.random();     // set step variables         if (ie4up||ns6up) {       if (i == 0) {         document.write("<div><a><img></a></div>");       } else {         document.write("<div><img></div>");       }     }   }     function snowIE_NS6() {  // IE and NS6 main animation function     doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;         doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;     for (i = 0; i <no> doc_height-50) {         xp[i] = Math.random()*(doc_width-am[i]-30);         yp[i] = 0;         stx[i] = 0.02 + Math.random()/10;         sty[i] = 0.7 + Math.random();       }       dx[i] += stx[i];       document.getElementById("dot"+i).style.top=yp[i]+"px";       document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";       }     snowtimer=setTimeout("snowIE_NS6()", 10);   }       function hidesnow(){         if (window.snowtimer) clearTimeout(snowtimer)         for (i=0; i<no>0)         setTimeout("hidesnow()", hidesnowtime*1000)         }  // ]]></script>


edit this line to point to your snow flake image
Code: Select all
   //Configure below to change URL path to the snow image  var snowsrc="images/snow.gif"


the current code will work with the attached image in the forum root/images folder[attachment=0]snow.gif[/attachment:142plba0]
"Success is getting what you want. Happiness is wanting what you get." - Dale Carnegie
User avatar
Helter
Administrator
Administrator
 
Posts: 4554
Likes: 40 posts
Liked in: 116 posts
Images: 0
Joined: Sat Mar 11, 2006 4:46 pm
Cash on hand: 1,959.15
Location: Seattle Wa
IntegraMOD version: phpBB2x

Re: falling snow?

PostAuthor: Karl-D » Thu Nov 27, 2008 10:41 am

Thanks HelterSkelter, very much appreciated kind sir <img>
User avatar
Karl-D
Integra Supporter
Integra Supporter
 
Posts: 104
Likes: 0 post
Liked in: 0 post
Joined: Tue May 30, 2006 6:23 am
Cash on hand: 0.00
Location: Cornwall UK

Re: falling snow?

PostAuthor: Karl-D » Thu Nov 27, 2008 5:16 pm

Found a better script, this uses text as apposed to images and different sizes of * and different fonts so doesn't slow the site down the same <img>


Code: Select all
<script>// Set the number of snowflakes (more than 30 - 40 not recommended)var snowmax=35  // Set the colors for the snow. Add as many colors as you likevar snowcolor=new Array("#ffffff","#ddddFF","#ccccDD")  // Set the fonts, that create the snowflakes. Add as many fonts as you likevar snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")  // Set the letter that creates your snowflake (recommended] = 0;                               lftrght[i] = Math.random()*15;                 x_mv[i] = 0.03 + Math.random()/10;         snow[i]=document.getElementById("s"+i)         snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]         snow[i].size=randommaker(snowsizerange)+snowminsize         snow[i].style.fontSize=snow[i].size         snow[i].style.color=snowcolor[randommaker(snowcolor.length)]         snow[i].sink=sinkspeed*snow[i].size/5         if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}         if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}         if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}         if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}         snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)         snow[i].style.left=snow[i].posx         snow[i].style.top=snow[i].posy     }     movesnow()}  function movesnow() {     for (i=0;i<snowmax>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){             if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}             if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}             if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/4}             if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].size)+marginright/2}             snow[i].posy=0         }     }     var timer=setTimeout("movesnow()",50)}  for (i=0;i<=snowmax;i++) {     document.write("<span>"+snowletter+"</span>")}if (browserok) {     window.onload=initsnow}</script>
User avatar
Karl-D
Integra Supporter
Integra Supporter
 
Posts: 104
Likes: 0 post
Liked in: 0 post
Joined: Tue May 30, 2006 6:23 am
Cash on hand: 0.00
Location: Cornwall UK

Re: falling snow?

PostAuthor: XHIBIT » Mon Dec 08, 2008 9:39 pm

Heres another simple code I found you can add directly to your portal center block. (I added a imeem embed to auto play x-mas music as well.

I shrunk down the size of the imeem player so its invisible, so if it slows you down just remove the imeem player and things should speed back up.
It pretty much depends on your processor speed and internet connection.

I was too lazy to hard source code it in the overall header tpl.

<CENTER><object><param></param><param></param><param></param><embed></embed></object></CENTER>
<CENTER><div>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
<marquee><b> °</b></marquee>
</div></CENTER>
[url=http][img=center]http://i206.photobucket.com/albums/bb186/XTVMOVIES/LP-ani.gif[/img][/url]
[url=http][img=center]http://i206.photobucket.com/albums/bb186/XTVMOVIES/ALBUM%203/rabbitbanner.jpg[/img][/url]
[url=http][img=center]http://5thshiftradio.top-site-list.com/images/banners/5thshiftradio.jpg[/img][/url]
User avatar
XHIBIT
Integra Member
Integra Member
 
Posts: 113
Likes: 0 post
Liked in: 0 post
Joined: Wed Jul 25, 2007 11:44 am
Cash on hand: 0.00


Return to IntegraMOD 141

Who is online

Registered users: App360MonitorBot, Bing [Bot], Google [Bot]