Advertisement
kyujouz

lightup text v2

Jun 21st, 2022
3,557
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.94 KB | None | 1 0
  1. /*this part is for styling it*/
  2. <style>
  3. #embed01 {
  4. font-size: 1.5em;
  5. font-family: arial;
  6. filter: drop-shadow(1px 1px 0 black) drop-shadow(-1px 1px 0 black) drop-shadow(0 -1px 0 black) drop-shadow(1px 0 black);
  7. }
  8. </style>
  9. <h2><script language="JavaScript1.2">
  10.  
  11. //Neon Lights Text II by G.P.F. (gpf@beta-cc.de)
  12. //visit http://www.beta-cc.de
  13. //Visit http://www.dynamicdrive.com for this script
  14.  
  15. var message="light-up"
  16. var neonbasecolor="white"
  17. var neontextcolor="#FFA4A4"
  18. var neontextcolor2="#FF7E78"
  19. var flashspeed=150 // speed of flashing in milliseconds
  20. var flashingletters=3 // number of letters flashing in neontextcolor
  21. var flashingletters2=1 // number of letters flashing in neontextcolor2 (0 to disable)
  22. var flashpause=0 // the pause between flash-cycles in milliseconds
  23.  
  24. ///No need to edit below this line/////
  25.  
  26. var n=0
  27. if (document.all||document.getElementById){
  28. document.write('<font color="'+neonbasecolor+'">')
  29. for (m=0;m<message.length;m++)
  30. document.write('<span id="neonlight'+m+'">'+message.charAt(m)+'</span>')
  31. document.write('</font>')
  32. }
  33. else
  34. document.write(message)
  35.  
  36. function crossref(number){
  37. var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
  38. return crossobj
  39. }
  40.  
  41. function neon(){
  42.  
  43. //Change all letters to base color
  44. if (n==0){
  45. for (m=0;m<message.length;m++)
  46. crossref(m).style.color=neonbasecolor
  47. }
  48.  
  49. //cycle through and change individual letters to neon color
  50. crossref(n).style.color=neontextcolor
  51.  
  52. if (n>flashingletters-1) crossref(n-flashingletters).style.color=neontextcolor2
  53. if (n>(flashingletters+flashingletters2)-1) crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor
  54.  
  55. if (n<message.length-1)
  56. n++
  57. else{
  58. n=0
  59. clearInterval(flashing)
  60. setTimeout("beginneon()",flashpause)
  61. return
  62. }
  63. }
  64.  
  65. function beginneon(){
  66. if (document.all||document.getElementById)
  67. flashing=setInterval("neon()",flashspeed)
  68. }
  69. beginneon()
  70.  
  71. </script></h2>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement