Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Text Fade (Rainbow Faded Text) BBCode Details »»
Text Fade (Rainbow Faded Text) BBCode
Version: 1.00, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.0.x Rating:
Released: 07-14-2010 Last Update: Never Installs: 33
Re-useable Code Additional Files Translations  
No support by the author.

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>
*Adjust the path to the textfade.js file as necessary. For example if your forum is installed in the web root (www.my-domain.com/) instead of (www.my-domain.com/forums/) then your path would simply be src="/clientscript/textfade.js"

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:
  • You can not use other bbcode within this bbcode, but you can use it OUTSIDE of this bbcode to change the font style/color/type etc...
  • You can't use smilies within this bbcode.
  • You can't use the double quote (") within this bbcode.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-08-2010, 12:13 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're able to upload files (usually via FTP) then you don't need any special permissions to upload javascript (.js) files.
Reply With Quote
  #13  
Old 08-08-2010, 03:28 PM
COL NIL SATIS COL NIL SATIS is offline
 
Join Date: Aug 2009
Location: Liverpool UK
Posts: 802
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant mate ...works A1 on 4.0.3 ...look bling too ...rates 5 and hits install
Reply With Quote
  #14  
Old 08-08-2010, 04:20 PM
LatinoCheats LatinoCheats is offline
 
Join Date: May 2010
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #15  
Old 08-08-2010, 06:17 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LatinoCheats View Post
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
I'm doing my best to understand you but I'm not exactly sure what the problem is.

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?
Reply With Quote
  #16  
Old 08-09-2010, 12:12 AM
sulasno sulasno is offline
 
Join Date: Feb 2010
Posts: 588
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
If you're able to upload files (usually via FTP) then you don't need any special permissions to upload javascript (.js) files.
thanks
got it uploaded
not sure whether the ftp client has a bug
Reply With Quote
  #17  
Old 08-09-2010, 01:15 PM
LatinoCheats LatinoCheats is offline
 
Join Date: May 2010
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #18  
Old 08-09-2010, 03:18 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by LatinoCheats View Post
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:

http://i35.tinypic.com/281ak38.jpg


Thanks
OK the first issue I see with the picture if that you are in "Styles & Templates." To add a BB Code you need to be in "Custom BB Codes" -> "Add a new BB Code" then follow the instructions in the first post.

"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).
Reply With Quote
  #19  
Old 08-10-2010, 01:50 PM
tyteen4a03 tyteen4a03 is offline
 
Join Date: Sep 2008
Location: Hong Kong
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;
}
2. Add these 2 functions below fadeText function:
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;
}
3. Replace the BBcode replacement bit to:
Code:
<span class="rainbow">{param}</span>
(which also means you can turn off all Disable options)
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 -->
Reply With Quote
  #20  
Old 08-10-2010, 05:10 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool.Thanks for the code- will update the top post.
Reply With Quote
  #21  
Old 10-02-2010, 01:47 AM
8thos's Avatar
8thos 8thos is offline
 
Join Date: Aug 2010
Location: Pensacola, FL
Posts: 772
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This BB code doesn't work anymore.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:37 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07945 seconds
  • Memory Usage 2,315KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete