Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Rainbow Links 
 
it is about "RAINBOW" LINKS its when you go mauseover linked words they change colours-see on my test blog http://blog.file2upload.com/?w=audiovideo4u go witn mause on some word(Comments (0) :: Post A Comment! :: Permanent Link ) (dont click word just go over)

here is the script - i puted this betwen <head> tags in overall_header.tpl and it work

Code: [Download] [Hide] [Select]
<script>

////////////////////////////////////////////////////////////////////
// Setting

var rate = 20;  // Increase amount(The degree of the transmutation)


////////////////////////////////////////////////////////////////////
// Main routine

if (document.getElementById)
window.onerror=new Function("return true")

var objActive;  // The object which event occured in
var act = 0;    // Flag during the action
var elmH = 0;   // Hue
var elmS = 128; // Saturation
var elmV = 255; // Value
var clrOrg;     // A color before the change
var TimerID;    // Timer ID


if (document.all) {
    document.onmouseover = doRainbowAnchor;
    document.onmouseout = stopRainbowAnchor;
}
else if (document.getElementById) {
    document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT);
    document.onmouseover = Mozilla_doRainbowAnchor;
    document.onmouseout = Mozilla_stopRainbowAnchor;
}


//=============================================================================
// doRainbow
//  scriptu preuredio html tutor
//=============================================================================
function doRainbow(obj)
{
    if (act == 0) {
        act = 1;
        if (obj)
            objActive = obj;
        else
            objActive = event.srcElement;
        clrOrg = objActive.style.color;
        TimerID = setInterval("ChangeColor()",100);
    }
}


//=============================================================================
// stopRainbow
//=============================================================================
function stopRainbow()
{
    if (act) {
        objActive.style.color = clrOrg;
        clearInterval(TimerID);
        act = 0;
    }
}


//=============================================================================
// doRainbowAnchor

//=============================================================================
function doRainbowAnchor()
{
    if (act == 0) {
        var obj = event.srcElement;
        while (obj.tagName != 'A' && obj.tagName != 'BODY') {
            obj = obj.parentElement;
            if (obj.tagName == 'A' || obj.tagName == 'BODY')
                break;
        }

        if (obj.tagName == 'A' && obj.href != '') {
            objActive = obj;
            act = 1;
            clrOrg = objActive.style.color;
            TimerID = setInterval("ChangeColor()",100);
        }
    }
}


//=============================================================================
// stopRainbowAnchor

//=============================================================================
function stopRainbowAnchor()
{
    if (act) {
        if (objActive.tagName == 'A') {
            objActive.style.color = clrOrg;
            clearInterval(TimerID);
            act = 0;
        }
    }
}


//=============================================================================
// Mozilla_doRainbowAnchor(for Netscape6 and Mozilla browser)
//  This function begins to change a color. (of a anchor, automatically)
//=============================================================================
function Mozilla_doRainbowAnchor(e)
{
    if (act == 0) {
        obj = e.target;
        while (obj.nodeName != 'A' && obj.nodeName != 'BODY') {
            obj = obj.parentNode;
            if (obj.nodeName == 'A' || obj.nodeName == 'BODY')
                break;
        }

        if (obj.nodeName == 'A' && obj.href != '') {
            objActive = obj;
            act = 1;
            clrOrg = obj.style.color;
            TimerID = setInterval("ChangeColor()",100);
        }
    }
}


//=============================================================================
// Mozilla_stopRainbowAnchor(for Netscape6 and Mozilla browser)
//  This function stops to change a color. (of a anchor, automatically)
//=============================================================================
function Mozilla_stopRainbowAnchor(e)
{
    if (act) {
        if (objActive.nodeName == 'A') {
            objActive.style.color = clrOrg;
            clearInterval(TimerID);
            act = 0;
        }
    }
}


//=============================================================================
// Change Color
//  This function changes a color actually.
//=============================================================================
function ChangeColor()
{
    objActive.style.color = makeColor();
}


//=============================================================================
// makeColor
//  This function makes rainbow colors.
//=============================================================================
function makeColor()
{
    // Don't you think Color Gamut to look like Rainbow?

    // 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;
}


</script>

 




____________
We are the phpBBorg. Lower your Crackers. Your phpological and forumological distinctivness will be added to our own. Resistance if futile!
 
LimunSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Rainbow Links 
 
Moved to IP Customizations...

Thanks.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Rainbow Links 
 
This Mod is compatible with Icy Phoenix 1.2.0.27

Restored to Customizations forum.
 




____________
Gabriel Anca
 
KasLimonSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Rainbow Links 
 
i have a problem!
when i use my icy phoniex theme it works fine! but when i am using my other themes then it doesnt work (i.e. morpheas IP) how can i make it work in other themes too? plz help!
 



 
uttejonaSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Rainbow Links 
 
uttejona wrote: [View Post]
i have a problem!
when i use my icy phoniex theme it works fine! but when i am using my other themes then it doesnt work (i.e. morpheas IP) how can i make it work in other themes too? plz help!


because probaliby u need to add it also in overall_header.tpl of morpheas and others overall_header.tpl-s
 




____________
We are the phpBBorg. Lower your Crackers. Your phpological and forumological distinctivness will be added to our own. Resistance if futile!
 
LimunSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Rainbow Links 
 
Limun wrote: [View Post]
uttejona wrote: [View Post]
i have a problem!
when i use my icy phoniex theme it works fine! but when i am using my other themes then it doesnt work (i.e. morpheas IP) how can i make it work in other themes too? plz help!


because probaliby u need to add it also in overall_header.tpl of morpheas and others overall_header.tpl-s


yes. its fixed now. thanks    
 



 
uttejonaSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Rainbow Links 
 
@ Limun  

Mate, why don't you remove these wrappers <script></script> and save the rest of the script as "rainbow.js" to /templates/common/js/rainbow.js

And put this in the overall_include.tpl in each template group. Then you wouldn't have to edit any headers.

Code: [Download] [Hide] [Select]
<script type="text/javascript" src="{FULL_SITE_PATH}{T_COMMON_TPL_PATH}js/rainbow.js"></script>


 
 
 
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: Rainbow Links 
 
Lopalong wrote: [View Post]
@ Limun  

Mate, why don't you remove these wrappers <script></script> and save the rest of the script as "rainbow.js" to /templates/common/js/rainbow.js

And put this in the overall_include.tpl in each template group. Then you wouldn't have to edit any headers.

Code: [Download] [Hide] [Select]
<script type="text/javascript" src="{FULL_SITE_PATH}{T_COMMON_TPL_PATH}js/rainbow.js"></script>


 


hmmm interesant .....     i will try it
thx
 




____________
We are the phpBBorg. Lower your Crackers. Your phpological and forumological distinctivness will be added to our own. Resistance if futile!
 
LimunSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Rainbow Links 
 


The benefit is that you will only need the javascript once for all of the templates to work.
 
 
 
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events