snow script how to add nuke platinum?

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   snow script how to add nuke platinum?
psinh22a
CZ Super Newbie
psinh22a has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Oct 11, 2004
0.01 posts per day
Posts: 38
Points: 2,381
   
I am running pnp and i got a script to run some cheesy snow on it and i am not sure where to put it in my files? I saw a old post on here about adding it to my header in mt includes folder but i my version doesn't have that .I even tried the nuke tools on the site and added to header.php.

Any idears?



Back to top Reply with quote
#2   re: snow script how to add nuke platinum?
yuzuki
CZ Newbie
yuzuki has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Jun 29, 2005
0.00 posts per day
Posts: 10
Points: 576
   
for one your header.php going be in your themes folder on pnp and try puting code at top of in header.php

ps post the code i well try it on my site it's pnp as well



Back to top Reply with quote
#3   re: snow script how to add nuke platinum?
psinh22a
CZ Super Newbie
psinh22a has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Oct 11, 2004
0.01 posts per day
Posts: 38
Points: 2,381
   

<!-- Begin
var no = 10; // snow number
var speed = 30; // smaller number moves the snow faster
var snowflake = "http://www.r2clan.com/snow.gif";

var ns4up = (document.layers) ? 1 : 0;  // browser sniffer
var ie4up = (document.all) ? 1 : 0;
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 (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
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 (ns4up) {                      // set layers
if (i == 0) {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" ");
document.write("top=\"15\" visibility=\"show\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></layer>");
   }
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: ");
document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
document.write(snowflake + "\" border=\"0\"></div>");
      }
   }
}
function snowNS() {  // Netscape main animation function
for (i = 0; i < no; ++ i) {  // iterate for every dot
yp[i] += sty[i];
if (yp[i] > 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();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}
function snowIE() {  // IE main animation function
for (i = 0; i < no; ++ i) {  // iterate for every dot
yp[i] += sty[i];
if (yp[i] > 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();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End -->


See what you get


Back to top Reply with quote
#4   re: snow script how to add nuke platinum?
echo
CZ Wiz
 Codezwiz Site Donator
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
I think that snow script is a bit CPU intensive...here's a better one I believe:
echo '<script language="JavaScript1.2">

//Autumn leaves- by Kurt Grigg (kurt.grigg@virgin.net)
//Modified by Dynamic Drive for NS6 functionality
//visit http://www.dynamicdrive.com for this script

//Pre-load your image below!
grphcs=new Array(6)
Image0=new Image();
Image0.src=grphcs[0]="snow.gif";
Image1=new Image();
Image1.src=grphcs[1]="snowflake.gif"
Image2=new Image();
Image2.src=grphcs[2]="snow.gif"
Image3=new Image();
Image3.src=grphcs[3]="snowflake.gif"
Image4=new Image();
Image4.src=grphcs[4]="snow.gif"
Image5=new Image();
Image5.src=grphcs[5]="snowflake.gif"

Amount=32; //Smoothness depends on image file size, the smaller the size the more you can use!
Ypos=new Array();
Xpos=new Array();
Speed=new Array();
Step=new Array();
Cstep=new Array();
ns=(document.layers)?1:0;
ns6=(document.getElementById&&!document.all)?1:0;

if (ns){
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write("<LAYER NAME=\'sn"+i+"\' LEFT=0 TOP=0><img src="+rndPic+"></LAYER>");
}
}
else{
document.write(\'<div style="position:absolute;top:0px;left:0px"><div style="position:relative">\');
for (i = 0; i < Amount; i++){
var P=Math.floor(Math.random()*grphcs.length);
rndPic=grphcs[P];
document.write(\'<img id="si\'+i+\'" src="\'+rndPic+\'" style="position:absolute;top:0px;left:0px">\');
}
document.write(\'</div></div>\');
}
WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
for (i=0; i < Amount; i++){
Ypos[i] = Math.round(Math.random()*WinHeight);
Xpos[i] = Math.round(Math.random()*WinWidth);
Speed[i]= Math.random()*5+3;
Cstep[i]=0;
Step[i]=Math.random()*0.1+0.05;
}
function fall(){
var WinHeight=(ns||ns6)?window.innerHeight:window.document.body.clientHeight;
var WinWidth=(ns||ns6)?window.innerWidth-70:window.document.body.clientWidth;
var hscrll=(ns||ns6)?window.pageYOffset:document.body.scrollTop;
var wscrll=(ns||ns6)?window.pageXOffset:document.body.scrollLeft;
for (i=0; i < Amount; i++){
sy = Speed[i]*Math.sin(90*Math.PI/180);
sx = Speed[i]*Math.cos(Cstep[i]);
Ypos[i]+=sy;
Xpos[i]+=sx;
if (Ypos[i] > WinHeight){
Ypos[i]=-60;
Xpos[i]=Math.round(Math.random()*WinWidth);
Speed[i]=Math.random()*5+3;
}
if (ns){
document.layers[\'sn\'+i].left=Xpos[i];
document.layers[\'sn\'+i].top=Ypos[i]+hscrll;
}
else if (ns6){
document.getElementById("si"+i).style.left=Math.min(WinWidth,Xpos[i]);
document.getElementById("si"+i).style.top=Ypos[i]+hscrll;
}
else{
eval("document.all.si"+i).style.left=Xpos[i];
eval("document.all.si"+i).style.top=Ypos[i]+hscrll;
}
Cstep[i]+=Step[i];
}
setTimeout(\'fall()\',20);
}

window.onload=fall
//-->
</script>';


Save these images as they are named and place them in your Nuke root directory. You can play around with the script and snowflake images to get it just how you like. I placed this script in the header.php file right after the opening <?php.

Images:



snowflake.gif
 Description:
snowflake.gif
 Filesize:  110 Bytes
 Viewed:  5237 Time(s)

snowflake.gif



snow.gif
 Description:
snow.gif
 Filesize:  256 Bytes
 Viewed:  5234 Time(s)

snow.gif




Back to top Reply with quote
#5   re: snow script how to add nuke platinum?
psinh22a
CZ Super Newbie
psinh22a has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Oct 11, 2004
0.01 posts per day
Posts: 38
Points: 2,381
   
Well i added the code but nothing is happening, but in the upper right hand corner there is one snowflake just setting there? [ Register or login to view links on this board. ]



Back to top Reply with quote
#6   re: snow script how to add nuke platinum?
echo
CZ Wiz
 Codezwiz Site Donator
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
Try placing the code before the closing ?> I tested this in vanilla nuke, not platinum, and it works...are you adding this to the header.php file located in your root?



Back to top Reply with quote
#7   re: snow script how to add nuke platinum?
psinh22a
CZ Super Newbie
psinh22a has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Oct 11, 2004
0.01 posts per day
Posts: 38
Points: 2,381
   
yeah i am adding it to my root, i tryied to add it to th closing one and it works, cool, anyway to slow it down some?

Also in the code does it stop in 20 secs?
setTimeout(\'fall()\',20);

?

Thanks

edit,

actualy i figured out why it would load, its got something to do with the shoutbox being javascript also, cause now it doesnt work, i take the code out and it works, wierd



Back to top Reply with quote
#8   re: snow script how to add nuke platinum?
echo
CZ Wiz
 Codezwiz Site Donator
Gender: Male
Status: Offline
Joined: Oct 04, 2003
0.15 posts per day
Posts: 1147
Points: 93
   
Yeah your java scripts are conflicting...to slow the flakes look for this:
Speed[i]=Math.random()*5+3;


set it to like 2+1 or 1+1


Back to top Reply with quote
#9   re: snow script how to add nuke platinum?
GoddsEgo
PayPal Donation
CZ Moderator
Status: Offline
Joined: Jun 26, 2003
0.15 posts per day
Posts: 1211
Points: 69,166
 Yahoo Messenger  
Hi Psi,
If you are still working on this do the following steps...

1. Open the external shoutbox script located at [ Register or login to view links on this board. ]

The script starts out like...
function allonloads(){
SBpopulate();
WorldClock();
}
// Insert Smiles to me



Edit the first function by starting with commenting out the WorldClock(); which is causing an script error, then right under that add a new handler named fall();.

The beginning of script should now look as follows...
function allonloads(){
SBpopulate();
//WorldClock();
fade();
}
// Insert Smiles to me



Save the newly edited shoutbox.js file. Upload it over the exsisting shoutbox.js file.

In your header place the following external script link...
<script type="text/javascript" src="snow.js"></script>



Download the file at bottom, unzip then upload the snow.js, snow.gif and snowflake.gif to the location that you have the shoutbox.js file, which would be the root directory.


Attached Files
snow.zip (1.79 KB, Downloaded: 5243 Time(s))


Back to top Reply with quote
#10   re: snow script how to add nuke platinum?
psinh22a
CZ Super Newbie
psinh22a has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Oct 11, 2004
0.01 posts per day
Posts: 38
Points: 2,381
   
thanks done like you said , still sitting in the up right hand corner icon_neutral.gif



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum