Replace this code for rainbow.js. ^^ It'll be cool...
Code:
/**
Rainbow Text
**/
function RGB2Color(r,g,b)
{
return '#' + byte2Hex(r) + byte2Hex(g) + byte2Hex(b);
}
function byte2Hex(n)
{
var nybHexString = "0123456789ABCDEF";
return String(nybHexString.substr((n >> 4) & 0x0F,1)) + nybHexString.substr(n & 0x0F,1);
}
function colorText(str,phase)
{
var result="";
if (phase == undefined)
phase = 0;
center = 128;
width = 127;
frequency = Math.PI*2/str.length;
for (var i = 0; i < str.length; ++i)
{
red = Math.sin(frequency*i+2+phase) * width + center;
green = Math.sin(frequency*i+0+phase) * width + center;
blue = Math.sin(frequency*i+4+phase) * width + center;
result += ( '<font color="' + RGB2Color(red,green,blue) + '">' + str.substr(i,1) + '</font>');
}
return result;
}
function nickmausac(classname){
var txtValue = "";
var b = getElementsByClassName(classname);
for ( var i = 0; i < b.length; i++ ) {
txtValue = colorText(b[i].innerHTML,1);
b[i].innerHTML = txtValue;
}
}
Use same as this mod...
Code:
<span class="rainbow">
add to footer//
Code:
<!-- rainbow text initialize -->
<script type="text/javascript">
<!--
nickmausac('rainbow');
// End -->
</script>
<!-- rainbow text end -->
>>
http://mytam.info/forum/member.php?u=50973
I have same as ideas by my sister, she asked me take her nickname has rainbow color... ^^