Advertisement
y2kcarrds

cr hyunjaeloml news ticker text

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