Guest User

Untitled

a guest
Mar 15th, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1.  
  2. <center>
  3. <b><center><font size="7">
  4. <script>
  5. // ********** MAKE YOUR CHANGES HERE
  6. var text="Zmiana sieci na Viva-Serv.PL" // YOUR TEXT
  7. var speed=500 // SPEED OF FADE
  8. // ********** LEAVE THE NEXT BIT ALONE!
  9. if (document.all||document.getElementById){
  10. document.write('<span id="highlight">' + text + '</span>')
  11. var storetext=document.getElementById? document.getElementById("highlight") : document.all.highlight
  12. }
  13. else
  14. document.write(text)
  15. var hex=new Array("00","14","28","3C","50","64","78","8C","A0","B4","C8","DC","F0")
  16. var r=1
  17. var g=1
  18. var b=1
  19. var seq=1
  20. function changetext(){
  21. rainbow="#"+hex[r]+hex[g]+hex[b]
  22. storetext.style.color=rainbow
  23. }
  24. function change(){
  25. if (seq==6){
  26. b--
  27. if (b==0)
  28. seq=1
  29. }
  30. if (seq==5){
  31. r++
  32. if (r==12)
  33. seq=6
  34. }
  35. if (seq==4){
  36. g--
  37. if (g==0)
  38. seq=5
  39. }
  40. if (seq==3){
  41. b++
  42. if (b==12)
  43. seq=4
  44. }
  45. if (seq==2){
  46. r--
  47. if (r==0)
  48. seq=3
  49. }
  50. if (seq==1){
  51. g++
  52. if (g==12)
  53. seq=2
  54. }
  55. changetext()
  56. }
  57. function starteffect(){
  58. if (document.all||document.getElementById)
  59. flash=setInterval("change()",speed)
  60. }
  61. starteffect()
  62. </script>
  63. </b></font>
  64.  
  65. <script>
  66. TypingText = function(element, interval, cursor, finishedCallback) {
  67.  
  68. if((typeof document.getElementById == "undefined") || (typeof element.innerHTML == "undefined")) {
  69.  
  70. this.running = true; // Never run.
  71.  
  72. return;
  73.  
  74. }
  75.  
  76. this.element = element;
  77.  
  78. this.finishedCallback = (finishedCallback ? finishedCallback : function() { return; });
  79.  
  80. this.interval = 70;
  81.  
  82. this.origText = this.element.innerHTML;
  83.  
  84. this.unparsedOrigText = this.origText;
  85.  
  86. this.cursor = (cursor ? cursor : "");
  87.  
  88. this.currentText = "";
  89.  
  90. this.currentChar = 0;
  91.  
  92. this.element.typingText = this;
  93.  
  94. if(this.element.id == "") this.element.id = "typingtext" + TypingText.currentIndex++;
  95.  
  96. TypingText.all.push(this);
  97.  
  98. this.running = false;
  99.  
  100. this.inTag = false;
  101.  
  102. this.tagBuffer = "";
  103.  
  104. this.inHTMLEntity = false;
  105.  
  106. this.HTMLEntityBuffer = "";
  107.  
  108. }
  109.  
  110. TypingText.all = new Array();
  111.  
  112. TypingText.currentIndex = 0;
  113.  
  114. TypingText.runAll = function() {
  115.  
  116. for(var i = 0; i < TypingText.all.length; i++) TypingText.all[i].run();
  117.  
  118. }
  119.  
  120. TypingText.prototype.run = function() {
  121.  
  122. if(this.running) return;
  123.  
  124. if(typeof this.origText == "undefined") {
  125.  
  126. setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval); // We haven't finished loading yet. Have patience.
  127.  
  128. return;
  129.  
  130. }
  131.  
  132. if(this.currentText == "") this.element.innerHTML = "";
  133.  
  134. // this.origText = this.origText.replace(/<([^<])*>/, ""); // Strip HTML from text.
  135.  
  136. if(this.currentChar < this.origText.length) {
  137.  
  138. if(this.origText.charAt(this.currentChar) == "<" && !this.inTag) {
  139.  
  140. this.tagBuffer = "<";
  141.  
  142. this.inTag = true;
  143.  
  144. this.currentChar++;
  145.  
  146. this.run();
  147.  
  148. return;
  149.  
  150. } else if(this.origText.charAt(this.currentChar) == ">" && this.inTag) {
  151.  
  152. this.tagBuffer += ">";
  153.  
  154. this.inTag = false;
  155.  
  156. this.currentText += this.tagBuffer;
  157.  
  158. this.currentChar++;
  159.  
  160. this.run();
  161.  
  162. return;
  163.  
  164. } else if(this.inTag) {
  165.  
  166. this.tagBuffer += this.origText.charAt(this.currentChar);
  167.  
  168. this.currentChar++;
  169.  
  170. this.run();
  171.  
  172. return;
  173.  
  174. } else if(this.origText.charAt(this.currentChar) == "&" && !this.inHTMLEntity) {
  175.  
  176. this.HTMLEntityBuffer = "&";
  177.  
  178. this.inHTMLEntity = true;
  179.  
  180. this.currentChar++;
  181.  
  182. this.run();
  183.  
  184. return;
  185.  
  186. } else if(this.origText.charAt(this.currentChar) == ";" && this.inHTMLEntity) {
  187.  
  188. this.HTMLEntityBuffer += ";";
  189.  
  190. this.inHTMLEntity = false;
  191.  
  192. this.currentText += this.HTMLEntityBuffer;
  193.  
  194. this.currentChar++;
  195.  
  196. this.run();
  197.  
  198. return;
  199.  
  200. } else if(this.inHTMLEntity) {
  201.  
  202. this.HTMLEntityBuffer += this.origText.charAt(this.currentChar);
  203.  
  204. this.currentChar++;
  205.  
  206. this.run();
  207.  
  208. return;
  209.  
  210. } else {
  211.  
  212. this.currentText += this.origText.charAt(this.currentChar);
  213.  
  214. }
  215.  
  216. this.element.innerHTML = this.currentText;
  217.  
  218. this.element.innerHTML += (this.currentChar < this.origText.length - 1 ? (typeof this.cursor == "function" ? this.cursor(this.currentText) : this.cursor) : "");
  219.  
  220. this.currentChar++;
  221.  
  222. setTimeout("document.getElementById('" + this.element.id + "').typingText.run()", this.interval);
  223.  
  224. } else {
  225.  
  226. this.currentText = "/";
  227.  
  228. this.currentChar = 0;
  229.  
  230. this.running = true;
  231.  
  232. this.finishedCallback();
  233.  
  234. }
  235.  
  236. }
  237.  
  238. </script>
  239.  
  240. <p id="info">
  241. <font size="6" face="Comic Sans MS, cursive" style="color:white;">
  242. <br>
  243. <br>
  244.  
  245. <script type="text/javascript">
  246.  
  247. new TypingText(document.getElementById("info"), 70, function(i){
  248.  
  249. var ar = new Array("_"," ","_","_"); return " " + ar[i.length %
  250.  
  251. ar.length]; });
  252.  
  253. //Type out examples:
  254.  
  255. TypingText.runAll();
  256.  
  257. </script>
Advertisement
Add Comment
Please, Sign In to add comment