• Important! If you attempt to register and do not get an email within 5 minutes please check your spam box. This is especially true for Microsoft owned domains like Hotmail, Outlook, and Live. If these do not work please consider Gmail. Yahoo, or even AOL email which works fine.

fade (rainbow) BB Code

BirdOPrey5

Staff member
Administrator
VIP
[NOBB][fade][/NOBB]

[NOBB][fade] and [/fade][/NOBB] is used to fade text in a rainbow of colors, the more text there is the smoother the transition. It isn't useful for short amounts of text.

[NOBB][fade]Bad[/fade] example.[/NOBB] =
[fade]Bad[/fade] example.

[NOBB][fade]This is a much better example because it's longer.[/fade][/NOBB] =
[fade]This is a much better example because it's longer.[/fade]

You can not use other BB Code within the 'fade' tags but you can use them outside. You can not use smilies within the 'fade' tag either.
Do not use double quotes (") in this tag, they will be converted to text and not work.
 

BirdOPrey5

Staff member
Administrator
VIP
Add this BB Code to your forum!

1. In Style Manager -> All Style Options edit the headinclude Template for each style
At the bottom add:
Code:
<script type="text/javascript">
function makeHex()
{
  this.length = 16;
     this[1]  = "0";
     this[2]  = "1";
     this[3]  = "2";
     this[4]  = "3";
     this[5]  = "4";
     this[6]  = "5";
     this[7]  = "6";
     this[8]  = "7";
     this[9]  = "8";
     this[10] = "9";
     this[11] = "A";
     this[12] = "B";
     this[13] = "C";
     this[14] = "D";
     this[15] = "E";
     this[16] = "F";
     return this;
}
newHex = new makeHex();

function con2hex (x)
{
     if( x < 17)
          x = 16;
     var top = (x / 16);
     var sub = top + '';
     sub = sub.substring (0, 2);
     top = parseInt (sub, 10);
     var before = newHex[top + 1];
     var bot = x - top * 16;
     if (bot < 1)
        bot = 1;
     sub = bot + '';
     sub = sub.substring (0, 2);
     bot = parseInt (sub, 10);
     var after = newHex[bot + 1];
     var thestring = before + '' + after;
     return thestring;
}

  function fadeText (intext)
{
     intext = intext.substring (0, intext.length);
     colorx = 255;
     z = colorx / intext.length;
     for (var i = 0; i < intext.length; i++)
     {
        colorx = 255 * Math.sin (i / (intext.length / 3));
        colory = con2hex (colorx);
        colorz = z * i;
        colorw = con2hex(colorz);
        k = intext.length;
        j = k - i;
        if(j < 0)
           j = 0;
        coloru = z * j;
        colorv = con2hex(coloru);
        document.write("<font color=\"#" + colorv + colory + colorw + "\">" + intext.substring(i, i + 1) + "</font>")
     }
}
</script>
2.Add a new BBCode

Title: Text Fade
BB Code Tag Name: fade
Replacement:
Code:
<script>fadeText("{param}");</script>
Example: [NOBB][fade]This code fades text in a rainbow.[/fade][/NOBB]
Note- the example won't work in Admin CP because the standard header is not loaded, but it will work in your forum.

Description: This uses javascript to make a smooth rainbow effect in text.
Use Option: No
Button Image: (optional) attached.
Remove Tag If Empty: Yes
All Disable Options: Yes except disable word wrapping: No
 

Attachments

Top