vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Forum Display Enhancements - VB4 Rainbow Name Animation (https://vborg.vbsupport.ru/showthread.php?t=284480)

MrRedDoT 06-14-2012 10:00 PM

VB4 Rainbow Name Animation
 
1 Attachment(s)
Rainbow Animated Usergroup Effect


This is a thought i had a long time ago from a Call of Duty Wold at War Challenge lobby infection that allows your GAMER name to have a Rainbow animated effect. I have searched everywhere for this but never found it. Thanks to Relevant For Coding this to work with site.

This will Take less than 2 minutes to install

Enjoy,
:cool:

Installation


Step 1. FTP to forums/clientscript/vbulletin-forumhome.js and copy code to bottom.


PHP Code:

/*    Relevant / MrRedDoT  - Modified for ReddotCity
  Fixed for multiple instances by Rele <3 */
var toSpans=0,rainbowSpan=0,rainbows=[];  
function 
startRainbow(){
  
toSpans = function(span) {
   try{
      var 
str=span.firstChild.data;
      var 
a=str.length;
      
span.removeChild(span.firstChild);
      for(var 
i=0i<ai++) {
      var 
theSpan=document.createElement("SPAN");
      
theSpan.appendChild(document.createTextNode(str.charAt(i)));
      
span.appendChild(theSpan);
      }
    }catch ( 
) { };
  }

  
RainbowSpan = function(spanhuedegbrtspdhspd) {
    try{
      
this.deg=(deg==null?360:Math.abs(deg));
      
this.hue=(hue==null?0:Math.abs(hue)%360);
      
this.hspd=(hspd==null?3:Math.abs(hspd)%360);
      
this.length=span.firstChild.data.length;
      
this.span=span;
      
this.speed=(spd==null?50:Math.abs(spd));
      
this.hInc=this.deg/this.length;
      
this.brt=(brt==null?255:Math.abs(brt)%256);
      
this.timer=null;
      
toSpans(span);
      
this.moveRainbow();
    }catch ( 
) { };
  }
  
  
RainbowSpan.prototype.moveRainbow = function() {
    if(
this.hue>359this.hue-=360;
    var 
color;
    var 
b=this.brt;
    var 
a=this.length;
    var 
h=this.hue;

    for(var 
i=0i<ai++) {

    if(
h>359h-=360;

    if(
h<60) { color=Math.floor(((h)/60)*b); red=b;grn=color;blu=0; }
    else if(
h<120) { color=Math.floor(((h-60)/60)*b); red=b-color;grn=b;blu=0; }
    else if(
h<180) { color=Math.floor(((h-120)/60)*b); red=0;grn=b;blu=color; }
    else if(
h<240) { color=Math.floor(((h-180)/60)*b); red=0;grn=b-color;blu=b; }
    else if(
h<300) { color=Math.floor(((h-240)/60)*b); red=color;grn=0;blu=b; }
    else { 
color=Math.floor(((h-300)/60)*b); red=b;grn=0;blu=b-color; }

    
h+=this.hInc;

    
this.span.childNodes[i].style.color="rgb("+red+", "+grn+", "+blu+")";
    }
    
this.hue+=this.hspd;
  }
  
setInterval(procRainbow,500);
}
function 
procRainbow(){
  if(
document.querySelectorAll("[id=rainbow]").length 0)
  {
    var 
uglySpans document.querySelectorAll("[id=rainbow]");
    for(var 
i in uglySpans){try{var temp uglySpans[i].innerText.lengthuglySpans[i].id="rainbowed"rainbows.push(new RainbowSpan(uglySpans[i],03602555018)); } catch( ) { } }
    for(var 
i in rainbows){rainbows[i].timer setInterval("rainbows["+i+"].moveRainbow()"rainbows[i].speed);}
  }
}
setTimeout(startRainbow,500); 

Step 2.

Navigate to Admincp>Usergroup>Usergroup Manager> Choose a User group to edit and enter this code to Username HTML Markup:

PHP Code:

<span id='rainbow' style='font-weight:bold'RedDotCity </span


GamerPerfection 06-16-2012 10:37 AM

That's going to look bad on a white or light background.

LgsOfChampions 06-16-2012 01:57 PM

I actually like the one's with the glow in the background. Anyway to share this also?

iDHKHCM 06-17-2012 04:12 AM

Quote:

Originally Posted by LgsOfChampions (Post 2340060)
I actually like the one's with the glow in the background. Anyway to share this also?

thats already on here somewhere

RobbieZ 06-18-2012 11:34 AM

Glow usernames are simple CSS.

https://vborg.vbsupport.ru/showthread.php?t=266408

AK47- 06-18-2012 10:23 PM

Update: credits are given nice share :)

Menno11 06-20-2012 09:40 PM

i have no vbulletin-forumhome.js in clientscript...

CubicWebs 06-21-2012 01:08 AM

Quote:

Originally Posted by Menno11 (Post 2341584)
i have no vbulletin-forumhome.js in clientscript...

Hey mate,

You need to create the file mate manually, then go to headerinclude template then put in

<script language="javascript" src="http://ForumURL/clientscript/vbulletin-forumhome.js"></script>

tele955848 08-21-2012 03:11 PM

Alles gemacht.
Name aber not Rainbow :(

zyiad 09-02-2012 07:23 PM

unfortunately is not working

iSins 09-04-2012 07:34 AM

Works in google Chrome but not in Firefox =/

marysnow786 11-12-2013 07:09 PM

thanks great work was finding since 2 years :)

boss22 03-02-2015 06:18 AM

have someone some fix to get this mod works on firefox?

works fine on IE and Chrome and on vb 4.2.3 beta 3.

regards

bosss


All times are GMT. The time now is 12:20 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01236 seconds
  • Memory Usage 1,788KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (13)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete