Advertisement
naocrrds

sleepyhead text

Jan 30th, 2023
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. <link rel="preconnect" href="https://fonts.googleapis.com">
  2. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  3. <link href="https://fonts.googleapis.com/css2?family=Pacifico&family=Poppins&display=swap" rel="stylesheet"><style>
  4. #news{
  5. font-weight:600;
  6. font-family: 'Pacifico', cursive;
  7. font-family: 'Poppins', sans-serif;
  8. text-shadow: -1px 0 #523b2b, 0 1px #523b2b, 1px 0 #523b2b, 0 -1px #523b2b, 0 0, 1px 0 #523b2b;
  9. color:#f7df8f;
  10. font-size:2.5em;
  11. }
  12. </style>
  13. <span id="news"></span>
  14. <script type="text/javascript">
  15. // <![CDATA[
  16. var news=Array("sleepyhead");
  17. var cursor="|"; // set cursor
  18. var delay=8; // seconds between each news item
  19.  
  20. /***************************\
  21. * News Ticker Text Effect *
  22. *(c)2004-14 mf2fm web-design*
  23. * http://www.mf2fm.com/rv *
  24. * DON'T EDIT BELOW THIS BOX *
  25. \***************************/
  26. var newsp, cursp, flash, item=0;
  27.  
  28. if (typeof('addRVLoadEvent')!='function') function addRVLoadEvent(funky) {
  29. var oldonload=window.onload;
  30. if (typeof(oldonload)!='function') window.onload=funky;
  31. else window.onload=function() {
  32. if (oldonload) oldonload();
  33. funky();
  34. }
  35. }
  36.  
  37. addRVLoadEvent(teleprint);
  38.  
  39. function teleprint () { if (document.getElementById) {
  40. var span=document.getElementById("news");
  41. while (span.childNodes.length) span.removeChild(span.childNodes[0]);
  42. delay*=1000;
  43. newsp=document.createElement("span");
  44. cursp=document.createElement("span");
  45. cursp.appendChild(document.createTextNode(String.fromCharCode(160)+cursor));
  46. span.appendChild(newsp);
  47. span.appendChild(cursp);
  48. ticker();
  49. }}
  50.  
  51. function ticker() {
  52. var i;
  53. while (newsp.childNodes.length) newsp.removeChild(newsp.childNodes[0]);
  54. newsp.appendChild(document.createTextNode(news[item].substring(0,1)));
  55. for (i=1; i<news[item].length; i++) setTimeout('newsp.firstChild.nodeValue="'+news[item].substring(0, i+1)+'"', 100*i);
  56. if (news[item].indexOf("www")!=-1) setTimeout('linkit('+item+')', 100*i);
  57. setTimeout('flash=setInterval("cursp.style.visibility=(cursp.style.visibility==\'visible\')?\'hidden\':\'visible\'", 234)', 100*i)
  58. setTimeout('clearInterval(flash)', delay);
  59. setTimeout('cursp.style.visibility="visible"', delay);
  60. setTimeout('ticker()', delay);
  61. item=++item%news.length;
  62. }
  63.  
  64. function linkit(q) {
  65. var a,p,e,l;
  66. p=news[q].indexOf("www");
  67. e=news[q].indexOf(" ", p);
  68. if (e==-1) e=news[q].length;
  69. l=news[q].substring(p, e);
  70. while (newsp.childNodes.length) newsp.removeChild(newsp.childNodes[0]);
  71. newsp.appendChild(document.createTextNode(news[q].substring(0, p)));
  72. a=document.createElement("a");
  73. a.href="http://"+l;
  74. a.appendChild(document.createTextNode(l));
  75. newsp.appendChild(a);
  76. newsp.appendChild(document.createTextNode(news[q].substring(e)));
  77. }
  78. // ]]>
  79. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement