Back to vBulletin 4.x Template Modifications

VB4 Rainbow Name Animation
Mod Version: 1.00, by MrRedDoT

vB Version: 4.2.0 Rating: (1 vote - 5.00 average) Installs: 7
Released: 16 Jun 2012 Last Update: Never Downloads: 0
Not Supported Template Edits Code Changes Additional Files Re-usable Code Translations Is in Beta Stage  

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,


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

Download

No files for download.

Similar Mods

Forum Display Enhancements Super Display Suite [Animated Rainbow] vB4 vBulletin 4.x Add-ons
Rainbow Ranks vBulletin Rank Sets
Forum Home Enhancements Rainbow Colors vBulletin 3.7 Template Modifications

vblts.ru supports vBulletin®, 2022-2025