Advertisement
googin

Newsticker with Pixel

Mar 20th, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. <style>
  2. @font-face {
  3. font-family: berkshire;
  4. src:url(https://dl.dropbox.com/s/49tg0oklrpc2u71/BerkshireSwash-Regular.ttf?);
  5.  
  6. }
  7.  
  8. #news {
  9. position: relative;
  10. text-shadow: -1px -1px 0 #AF83E1, 1px 1px 0 #000, -1px -1px 0 #E8B9FF, -1px 2px 0 #E8B9FF;
  11. z-index: 1;
  12. top: 80.5px;
  13. left: -110.5px;
  14. font-family: berkshire;
  15. font-size:350%;
  16. font-weight:bold;
  17. color: #fff;
  18. }
  19.  
  20. .pixel {
  21. position: relative;
  22. z-index: 1;
  23. top: 78.5px;
  24. left: -119.5px;
  25. }
  26.  
  27. </style>
  28. <span id="news"></span><img class=pixel src="https://noviecita.crd.co/assets/images/gallery02/08d13f30_original.png?v=d6922403">
  29.  
  30. <script type="text/javascript">
  31. // <![CDATA[
  32. var news=Array("Vivsy","Viv");
  33. var cursor=""; // set cursor
  34. var delay=3; // seconds between each news item
  35.  
  36. /***************************\
  37. * News Ticker Text Effect *
  38. *(c)2004-14 mf2fm web-design*
  39. * http://www.mf2fm.com/rv *
  40. * DON'T EDIT BELOW THIS BOX *
  41. \***************************/
  42. var newsp, cursp, flash, item=0;
  43. if (typeof('addRVLoadEvent')!='function') function addRVLoadEvent(funky) {
  44. var oldonload=window.onload;
  45. if (typeof(oldonload)!='function') window.onload=funky;
  46. else window.onload=function() {
  47. if (oldonload) oldonload();
  48. funky();
  49. }
  50. }
  51.  
  52. addRVLoadEvent(teleprint);
  53.  
  54. function teleprint () { if (document.getElementById) {
  55. var span=document.getElementById("news");
  56. while (span.childNodes.length) span.removeChild(span.childNodes[0]);
  57. delay*=1000;
  58. newsp=document.createElement("span");
  59. cursp=document.createElement("span");
  60. cursp.appendChild(document.createTextNode(String.fromCharCode(160)+cursor));
  61. span.appendChild(newsp);
  62. span.appendChild(cursp);
  63. ticker();
  64. }}
  65.  
  66. function ticker() {
  67. var i;
  68. while (newsp.childNodes.length) newsp.removeChild(newsp.childNodes[0]);
  69. newsp.appendChild(document.createTextNode(news[item].substring(0,1)));
  70. for (i=1; i<news[item].length; i++) setTimeout('newsp.firstChild.nodeValue="'+news[item].substring(0, i+1)+'"', 100*i);
  71. if (news[item].indexOf("www")!=-1) setTimeout('linkit('+item+')', 100*i);
  72. setTimeout('flash=setInterval("cursp.style.visibility=(cursp.style.visibility==\'visible\')?\'hidden\':\'visible\'", 234)', 100*i)
  73. setTimeout('clearInterval(flash)', delay);
  74. setTimeout('cursp.style.visibility="visible"', delay);
  75. setTimeout('ticker()', delay);
  76. item=++item%news.length;
  77. }
  78. function linkit(q) {
  79. var a,p,e,l;
  80. p=news[q].indexOf("www");
  81. e=news[q].indexOf(" ", p);
  82. if (e==-1) e=news[q].length;
  83. l=news[q].substring(p, e);
  84. while (newsp.childNodes.length) newsp.removeChild(newsp.childNodes[0]);
  85. newsp.appendChild(document.createTextNode(news[q].substring(0, p)));
  86. a=document.createElement("a");
  87. a.href="http://"+l;
  88. a.appendChild(document.createTextNode(l));
  89. newsp.appendChild(a);
  90. newsp.appendChild(document.createTextNode(news[q].substring(e)));
  91. }
  92. // ]]>
  93. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement