Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Rainbow Scrollbar
Topic Started: Sep 23 2004, 07:39 AM (2,430 Views)
Zero Tolerance
Member Avatar
Being me is not a good thing.
 *   *   *  
First of all id like to say i do not pose creator of the whole script, the main segment was created by TAKANASHI Mizuki (Rainbow Links Script). I have merly implemented a function of his into this to create rainbow scroll bar colours.

The code will dynamically change your forums scroll bar colours every .5 seconds, creating a "rainbow" effect.

The script goes in your javascript section.

NOTE: The script may slow down your forum

Code:
 
<script>
/*
makeColor() Copyright (C) 1999-2001 TAKANASHI Mizuki
takanasi@hamal.freemail.ne.jp

Implemented To Scroll Bar By Zero Tolerance
Create For InvisionFree
Copyright Must Be Left Intact Where Ever Used
*/

var elmH = 20;
var elmS = 64;
var elmV = 255;

function getRate(){
setRate = Math.floor(Math.random()*100)
if(setRate < 15) { setRate = 15 }
return setRate
}

function makeColor(rate){

   // HSVtoRGB
   if (elmS == 0) {
       elmR = elmV;    elmG = elmV;    elmB = elmV;
   }
   else {
       t1 = elmV;
       t2 = (255 - elmS) * elmV / 255;
       t3 = elmH % 60;
       t3 = (t1 - t2) * t3 / 60;

       if (elmH < 60) {
           elmR = t1;  elmB = t2;  elmG = t2 + t3;
       }
       else if (elmH < 120) {
           elmG = t1;  elmB = t2;  elmR = t1 - t3;
       }
       else if (elmH < 180) {
           elmG = t1;  elmR = t2;  elmB = t2 + t3;
       }
       else if (elmH < 240) {
           elmB = t1;  elmR = t2;  elmG = t1 - t3;
       }
       else if (elmH < 300) {
           elmB = t1;  elmG = t2;  elmR = t2 + t3;
       }
       else if (elmH < 360) {
           elmR = t1;  elmG = t2;  elmB = t1 - t3;
       }
       else {
           elmR = 0;   elmG = 0;   elmB = 0;
       }
   }

   elmR = Math.floor(elmR).toString(16);
   elmG = Math.floor(elmG).toString(16);
   elmB = Math.floor(elmB).toString(16);
   if (elmR.length == 1)    elmR = "0" + elmR;
   if (elmG.length == 1)    elmG = "0" + elmG;
   if (elmB.length == 1)    elmB = "0" + elmB;

   elmH = elmH + rate;
   if (elmH >= 360)
       elmH = 0;

   return '#' + elmR + elmG + elmB;
}

function setScrollBar(){
with(document.body.style){
scrollbarDarkShadowColor=makeColor(getRate())
scrollbar3dLightColor=makeColor(getRate())
scrollbarArrowColor=makeColor(getRate())
scrollbarBaseColor=makeColor(getRate())
scrollbarFaceColor=makeColor(getRate())
scrollbarHighlightColor=makeColor(getRate())
scrollbarShadowColor=makeColor(getRate())
scrollbarTrackColor=makeColor(getRate())
}
}

setInterval("setScrollBar()", 500);
</script>


- Zero Tolerance
Offline Profile Quote Post Goto Top
 
XSLASH
Unregistered

weres the preview
Quote Post Goto Top
 
The_Gunner
Member Avatar
^^JIMMY!^^
 *   *   *   *   *  
some codes he makes doesnt require a preview. this one does. yup.
Offline Profile Quote Post Goto Top
 
Deleted User
Deleted User

Well, it's certainly colorful. :r
Not as laggy as some others I've seen, but it does mess with my cursor every time it updates, just like many of those clock codes do. :/
Quote Post Goto Top
 
¤Samantha¤
Member
 *   *  
Ohhhhhhhh Pretty..... I like that... but it doesn't suit my forum, which is black hahah.... It's pretty though.
Offline Profile Quote Post Goto Top
 
Pokid
Member Avatar
Purdyful bunnehkins!
 *   *  
The scripts too big. I can't install it. Can someone at least put a preveiw up so I can ssee what it looks like?
Offline Profile Quote Post Goto Top
 
Cheatman101
Member Avatar
Pure Awesomness
 *  
I beleive this is right

preview
Offline Profile Quote Post Goto Top
 
Inny
Member Avatar
Member
 *   *   *  
OMG!!!!
Offline Profile Quote Post Goto Top
 
NojTB
-
 *   *   *   *  
pretty cool. but will really slow down big sites and arcades.
Offline Profile Quote Post Goto Top
 
εďз Lara εď&#107
Member
 *  
OMG, Its perfect for my forum! Thanks!
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Code Snippets · Next Topic »
Add Reply