The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Text Fade (Rainbow Faded Text) BBCode Details »» | |||||||||||||||||||||||||||
Text Fade (Rainbow Faded Text) BBCode
Developer Last Online: Aug 2023
This BB Code produces a rainbow like text fade effect. It uses Javascript to put multiple html font color tags between characters. There are two ways of doing this, the first method uses an external javascript file. In the second post you add the javascript to every page via the header template instead, this may be better if you expect the rainbow text to be called many times on a single page.
Demo: here. Screen Shot: Before You Start - See tyteen4a03's post (#18) for additional code changes that will allow you to rainbow color usernames and remove a limitation where you couldn't use double-quotes ("). 1. Download the attached textfade.js.txt file, rename it to textfade.js, and upload it to your forums/clientscript folder. 2. Add a new BBCode Title: Text Fade BB Code Tag Name: fade Replacement: Code:
<script type="text/javascript" src="/forums/clientscript/textfade.js"></script> <script>fadeText("{param}");</script> Example: [fade]This code fades text in a rainbow.[/fade] Description: This uses javascript to make a smooth rainbow effect in text. Use Option: No Button Image: (optional) Remove Tag If Empty: Yes All Disable Options: Yes except disable word wrapping: No Limitations:
This BB Code was tested on vb4 but should work on all current versions. Please mark as installed if you use this. Show Your Support
|
Comments |
#2
|
||||
|
||||
Alternate Method- no external file.
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> Title: Text Fade BB Code Tag Name: fade Replacement: Code:
<script>fadeText("{param}");</script> 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) Remove Tag If Empty: Yes All Disable Options: Yes except disable word wrapping: No All the same limitations as the original method in the top post apply. |
#3
|
||||
|
||||
the problem of the Arabic language ?
|
#4
|
||||
|
||||
I'm sorry I can't try this on other languages, maybe if you can describe the problem you're having? I have marked this to allow 'translations' so if someone who knows what issues might come up with other languages are free to post versions for those other languages.
From the screen shot it appears to be working? |
#5
|
||||
|
||||
If you want the rainbow to fade the other direction (VIBGTOR instead of ROYGBIV) then change the line near the bottom from:
Code:
document.write("<font color=\"#" + colorv + colory + colorw + "\">" + intext.substring(i, i + 1) + "</font>") Code:
document.write("<font color=\"#" + colorw + colory + colorv + "\">" + intext.substring(i, i + 1) + "</font>") |
#6
|
||||
|
||||
...is it posible to make fade text in name of usergroups?...
|
#7
|
||||
|
||||
A 'search' on this topic revealed this mod:
https://vborg.vbsupport.ru/showthread.php?t=208274 But I've never used it. My guess is if you end up using that mod you could use it to make rainbow bbcode as well... [s]use the same settings as above but don't bother uploading the javascript file here nor putting the javascript in post #2 in the header. Then instead of the replacement text I provided use:[/s] Code:
<span class="rainbow">{param}</span> And yes that mod should work on 4.0 too, no reason it wouldn't. The only 'issue' with that mod is that it isn't a rainbow per say because it doesn't fade from red-to-orange-to-yellow... etc... (ROYGBIV) but I'm sure that won't bother most people. |
#8
|
|||
|
|||
Code:
<span class="rainbow">{param}</span> anyways nice bbcode thanks installed also tryed Code:
<span style='font-weight: bold; color: rainbow;'> </span> |
#9
|
||||
|
||||
ehh.. sorry. Thanks.
|
#10
|
|||
|
|||
do I need special rights to upload the js file to the server ?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|