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 |
#12
|
||||
|
||||
If you're able to upload files (usually via FTP) then you don't need any special permissions to upload javascript (.js) files.
|
#13
|
|||
|
|||
Brilliant mate ...works A1 on 4.0.3 ...look bling too ...rates 5 and hits install
|
#14
|
|||
|
|||
Friend, I do not want to accept the changes.
After boardcode and save, I get the gray screen, ie, no more anything goes. Not seem to accepted JAVA SCRIPT. I installed several BBCodes yours, but sorry, it does not want to install. Can you help? Thanks |
#15
|
||||
|
||||
Quote:
Did you rename and upload the javascript file to your clientscript directory? Maybe you can tell me exactly when you are having the problem= installing the code, or trying to use it? |
#16
|
|||
|
|||
Quote:
got it uploaded not sure whether the ftp client has a bug |
#17
|
|||
|
|||
Ok, I explain better. Excuse me, is that I use google translator.
I make all the correct procedures and I "Save BBcode" I do not generate changes. The screen is gray, then change. That is, it generates no change. But it seems that is why the code works with "JAVA SCRIPT." I do not understand. Here a picture of the error: Thanks |
#18
|
||||
|
||||
Quote:
"Java Script" is a programming language used on websites to make pages more interactive and do things beyond the basic display of text and graphics. http://en.wikipedia.org/wiki/JavaScript In order to make the text fade colors it utilizes "Java Script" - this is a short program that has been written in order to manipulate the text. You need to upload the attached textfade.js.txt file via FTP to your "clientscript" directory and rename it to "textfade.js" (Unfortunately we can't attach .js files in the forum so I had to make it a .txt file). |
#19
|
|||
|
|||
Added some bodaudinh's code in to make it support Username colouring and (should) fix the double quotes bug. Thanks to him for the code!
1. Replace fadeText with: Code:
function fadeText (intext) { var result=""; 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); result += ("<font color=\"#" + colorv + colory + colorw + "\">" + intext.substring(i, i + 1) + "</font>") } return result; } Code:
function showRainbow(classname){ var txtValue = ""; var b = getElementsByClassName(classname); for (var i = 0; i < b.length; i++ ) { txtValue = fadeText(b[i].innerHTML,1); b[i].innerHTML = txtValue; } } function getElementsByClassName(classname, node) { if(!node) node = document.getElementsByTagName("body")[0]; var a = []; var re = new RegExp('\\b' + classname + '\\b'); var els = node.getElementsByTagName("*"); for(var i=0,j=els.length; i<j; i++) if(re.test(els[i].className)) a.push(els[i]); return a; } Code:
<span class="rainbow">{param}</span> 3. Add this in anywhere in footer: Code:
<!-- DOUBLE RAINBOW ALL THE WAY CROSS THE SKY --> <script type="text/javascript"> <!-- showRainbow('rainbow'); // End --> </script> <!-- WOW WOW OH MY GOD LOOK AT THAT RAINBOW --> |
#20
|
||||
|
||||
Very cool.Thanks for the code- will update the top post.
|
#21
|
||||
|
||||
This BB code doesn't work anymore.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|