Advertisement
dnwmfilms

↳ ❝ [rainbow text] ¡! ❞

Nov 6th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. <style>
  2. #rainbow {
  3.  
  4. font-size:200%;
  5. font-weight:bold;
  6.  
  7. }
  8. </style><head>
  9. <script type="text/javascript">
  10. // <![CDATA[
  11. var speed=100; // speed colours change, 1 second = 1000
  12. var glow=3; // can be set from '0' for no glow, to 10
  13. var raincol=new Array("#ff0000", "#ff5500", "#ffaa00", "#ffff00", "#aaff00", "#55ff00", "#00ff00", "#00ff55", "#00ffaa", "#00ffff", "#00aaff", "#0055ff", "#0000ff", "#5500ff", "#aa00ff", "#ff00ff", "#ff00aa", "#ff0055"); // change the colours if you want to
  14. var alink="http://www.mf2fm.com/rv/"; // page to link text to (set to ="" for no link)
  15.  
  16. /****************************
  17. * Rainbow Text Effect *
  18. *(c)2003-13 mf2fm web-design*
  19. * http://www.mf2fm.com/rv *
  20. * DON'T EDIT BELOW THIS BOX *
  21. ****************************/
  22. var rainbow, raintxt, raincnt=0;
  23.  
  24. function addLoadEvent(funky) {
  25. var oldonload=window.onload;
  26. if (typeof(oldonload)!='function') window.onload=funky;
  27. else window.onload=function() {
  28. if (oldonload) oldonload();
  29. funky();
  30. }
  31. }
  32.  
  33. addLoadEvent(regenbogen);
  34.  
  35. function regenbogen() { if (document.getElementById) {
  36. var i, rainbeau;
  37. rainbow=document.getElementById("rainbow");
  38. raintxt=rainbow.firstChild.nodeValue;
  39. while (rainbow.childNodes.length) rainbow.removeChild(rainbow.childNodes[0]);
  40. for (i=0; i<raintxt.length; i++) {
  41. rainbeau=document.createElement("span");
  42. rainbeau.setAttribute("id", "rain"+i);
  43. rainbeau.appendChild(document.createTextNode(raintxt.charAt(i)));
  44. if (alink) {
  45. rainbeau.style.cursor="pointer";
  46. rainbeau.onclick=function() { top.location.href=alink; }
  47. }
  48. rainbow.appendChild(rainbeau);
  49. }
  50. rainbow=setInterval ("raining()", speed);
  51. }}
  52.  
  53. function raining() {
  54. var i, c;
  55. for (i=0; i<raintxt.length; i++) {
  56. c=raincol[(i+raincnt)%raincol.length];
  57. document.getElementById("rain"+i).style.color=c;
  58. if (glow) document.getElementById("rain"+i).style.textShadow=c+" 0px 0px "+glow+"px";
  59. }
  60. raincnt++;
  61. }
  62. // ]]>
  63. </script>
  64. </head>
  65. <span id="rainbow">RAINBOW TEXT</span>
  66.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement