Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.06 KB | None | 0 0
  1. <script type='text/javascript'>
  2. //<![CDATA[
  3. msg = "_AKN & NH_";
  4. msg = "" + msg;pos = 0;
  5. function scrollMSG()
  6. {document.title = msg.substring(pos, msg.length) + msg.substring(0, pos); pos++;
  7. if (pos > msg.length) pos = 0
  8. window.setTimeout("scrollMSG()",150);}
  9. scrollMSG();
  10. //]]>
  11. </script>
  12.  
  13. <meta name="Author" content="Gerard Ferrandez at http://www.dhteumeuleu.com">
  14. <meta http-equiv="imagetoolbar" content="no">
  15. <style type="text/css">
  16. html {
  17. overflow: hidden;
  18. }
  19. body {
  20. background:#000000 url(https://fbcdn-sphotos-e-a.akamaihd.net/hphotos-ak-prn1/934790_600604309952890_1450960991_n.jpg)no-repeat;background-size:95%;background-attachment:fixed;
  21. width: 100%;
  22. height: 100%;
  23. color: #000000;
  24. }
  25. #frm {
  26. position: absolute;
  27. height: 100%;
  28. width: 100%;
  29. left: 0%;
  30. top: 0%;
  31. font-size: 2em;
  32. font-weight: bold;
  33. font-family: Chiller;
  34. background: #transparent;
  35. overflow: hidden;
  36. padding: 0.5em;
  37. }
  38. #frm span {
  39. position: relative;
  40. text-align: center;
  41. z-index: 1;
  42. }
  43. #mtxform {
  44. position: relative;
  45. z-index: 10;
  46. }
  47. .hidden {
  48. visibility: hidden;
  49. }
  50. </style>
  51. <link rel="SHORTCUT ICON" href="http://www.hi5style.com/gr/heart.gif">
  52. <script type="text/javascript">
  53. /*
  54. =====
  55. script: morphing text
  56. author: Gerard Ferrandez - [Ge1doot]
  57. date: 20 September, 2008
  58. site: http://www.dhteumeuleu.com
  59. inspiration: http://www.pwang.com/blog/archives/2006/04/post_100.html
  60. quote: Scott Adams, 'The Dilbert Principle'
  61. ------------
  62. license: CC-BY-NC - please do not remove this notice !
  63. =====
  64. */
  65.  
  66. var mtx = function () {
  67. /* ==== private variables & methods ==== */
  68. var stop = false;
  69. var frm, lineDelay, charDelay;
  70. var colorText, colorMatch, colorGhost, elapsedTime;
  71. var lineIndex = 0;
  72. var lineChar = [];
  73. var animStack = [];
  74. var colorStack = [];
  75. /* ==== rgb color ==== */
  76. function colorRGB (c) {
  77. return 'rgb('
  78. +Math.round(Math.min(255, Math.max(0, c[0])))+','
  79. +Math.round(Math.min(255, Math.max(0, c[1])))+','
  80. +Math.round(Math.min(255, Math.max(0, c[2])))+')';
  81. }
  82. /* ==== Easing functions ==== */
  83. function Ease () {}
  84. Ease.prototype = {
  85. ease : function () {
  86. this.m += this.s;
  87. this.x0 += (this.d * this.m * .0025);
  88. if (this.m == 20) this.s = -1;
  89. return this.x0;
  90. },
  91. init : function (x0, x1) {
  92. this.m = 0;
  93. this.s = 1;
  94. this.d = x1 - x0;
  95. this.x0 = x0;
  96. }
  97. }
  98.  
  99. /* ==== Load Lines ==== */
  100. function loadLines () {
  101. // read text from HTML form
  102. text = document.forms.mtxform.text.value.split("\n");
  103. // loop through all lines
  104. for (var j = 0; j < text.length; j++) {
  105. var t = text[j];
  106. if (t) {
  107. var n = t.length;
  108. lineChar[j] = [];
  109. // first pass: create characters capture RELATIVE offset coordinates
  110. for (var i = 0; i < n; i++)
  111. lineChar[j][i] = new Character(t.charAt(i), j);
  112. // second pass: convert to absolute position
  113. for (var i = 0, o; o = lineChar[j][i]; i++) {
  114. if (o.c == "|") {
  115. // remove spaces
  116. lineChar[j].splice(i, 1);
  117. frm.removeChild(o.o);
  118. i--;
  119. } else {
  120. // convert to absolute position and render
  121. o.o.style.position = "absolute";
  122. o.o.style.color = colorRGB(colorText);
  123. o.moveHTML();
  124. // push first line in animation stack
  125. if (j == 0) pushAnim (o, charDelay * i);
  126. }
  127. }
  128. }
  129. }
  130. }
  131. /* ==== Character Constructor ==== */
  132. function Character (c, line) {
  133. if (c == " ") c = "|";
  134. this.c = c;
  135. // create HTML element and append the the container
  136. this.o = document.createElement("span");
  137. this.o.innerHTML = c;
  138. this.o.style.zIndex = 2;
  139. frm.appendChild(this.o);
  140. // capture relative offset positions !
  141. this.x0 = this.o.offsetLeft;
  142. this.y0 = -this.o.offsetHeight * 1.5;
  143. this.x1 = this.x0;
  144. this.x2 = this.x0;
  145. this.y1 = (line + 1) * this.o.offsetHeight;
  146. this.y2 = frm.offsetHeight;
  147. this.mx = new Ease();
  148. this.my = new Ease();
  149. this.c0 = [colorText[0], colorText[1], colorText[2]];
  150. }
  151. /* ==== Character functions ==== */
  152. Character.prototype = {
  153. // ---- character animation ----
  154. anim : function (i) {
  155. // temporization
  156. if (this.delay > 0) {
  157. if (elapsedTime)
  158. this.delay -= new Date().getTime() - elapsedTime;
  159. } else {
  160. // moving
  161. this.x0 = this.mx.ease();
  162. this.y0 = this.my.ease();
  163. this.moveHTML();
  164. if (!this.my.m && !this.mx.m) {
  165. // remove from stack
  166. animStack.splice(i, 1);
  167. // remove dead characters
  168. if (this.off) frm.removeChild(this.o);
  169. }
  170. }
  171. },
  172. // ----- color fading ------
  173. color : function (i) {
  174. this.c0[0] += this.cr[0];
  175. this.c0[1] += this.cr[1];
  176. this.c0[2] += this.cr[2];
  177. this.ci++;
  178. this.o.style.color = colorRGB(this.c0);
  179. if (this.ci >= this.cs)
  180. colorStack.splice(i, 1);
  181. },
  182. // ----- HTML positioning -----
  183. moveHTML : function () {
  184. this.o.style.left = Math.round(this.x0) + "px";
  185. this.o.style.top = Math.round(this.y0) + "px";
  186. },
  187. // ----- init color fading ------
  188. colorFade : function (c1, steps) {
  189. this.cs = steps;
  190. this.cr = [(c1[0] - this.c0[0]) / steps, (c1[1] - this.c0[1]) / steps, (c1[2] - this.c0[2]) / steps];
  191. if (this.cr[0] != 0 || this.cr[1] != 0 || this.cr[2] != 0){
  192. this.ci = 0;
  193. colorStack.push (this);
  194. }
  195. }
  196. }
  197. /* ==== push character in the animation stack ==== */
  198. function pushAnim (o, delay) {
  199. // init ease
  200. o.mx.init(o.x0, o.x1);
  201. o.my.init(o.y0, o.y1);
  202. o.delay = delay;
  203. // push stack
  204. animStack.push(o);
  205. }
  206. /* ==== next line ==== */
  207. function nextLine () {
  208. if (lineIndex < lineChar.length - 1) {
  209. // display shadow text
  210. for (var i = 0, o; o = lineChar[lineIndex][i]; i++) {
  211. var s = o.o.cloneNode(true);
  212. s.style.zIndex = 1;
  213. s.style.color = colorRGB(colorGhost);
  214. frm.appendChild(s);
  215. }
  216. // matching next line characters
  217. for (var i = 0, t; t = lineChar[lineIndex + 1][i]; i++) {
  218. for (var j = 0, o; o = lineChar[lineIndex][j]; j++) {
  219. if (o.c == t.c) {
  220. // colors
  221. t.colorFade(colorMatch, o.match ? 1 : 40);
  222. t.match = true;
  223. // swap characters
  224. t.x0 = o.x0;
  225. t.y0 = o.y0;
  226. t.moveHTML();
  227. // remove redundant character
  228. frm.removeChild(o.o);
  229. lineChar[lineIndex].splice(j, 1);
  230. break;
  231. }
  232. }
  233. }
  234. // take off redundant characters
  235. for (var i = 0, o; o = lineChar[lineIndex][i]; i++) {
  236. // set target position (off frame)
  237. o.y1 = frm.offsetHeight;
  238. o.off = true;
  239. o.match = false;
  240. o.colorFade (colorText, 40);
  241. // push in animation stack
  242. pushAnim (o, (lineDelay * .8) + charDelay * i);
  243. }
  244. }
  245. // push next line in animation stack
  246. lineIndex++;
  247. if (lineIndex < lineChar.length) {
  248. for (var i = 0, o; o = lineChar[lineIndex][i]; i++)
  249. pushAnim (o, lineDelay + charDelay * i);
  250. }
  251. }
  252.  
  253. /* ==== main animation loop ==== */
  254. function main() {
  255. // characters
  256. var n = animStack.length;
  257. if (n) {
  258. var i = n;
  259. while (i--)
  260. animStack[i].anim(i);
  261. } else nextLine ();
  262. // colors
  263. var i = colorStack.length;
  264. while (i--)
  265. colorStack[i].color(i);
  266. // get elapsed time and loop
  267. elapsedTime = new Date().getTime();
  268. setTimeout(main, 16);
  269. }
  270.  
  271. /* //////////// ==== public methods ==== //////////// */
  272. return {
  273. /* ==== initialize script ==== */
  274. init : function (cont, t1, t2, c1, c2, c3) {
  275. // container
  276. frm = document.getElementById(cont);
  277. lineDelay = t1;
  278. charDelay = t2;
  279. colorText = c1;
  280. colorMatch = c2;
  281. colorGhost = c3;
  282. loadLines();
  283. main();
  284. },
  285. changeText : function () {
  286. document.getElementById("show").className = "";
  287. document.getElementById("inputext").className = "hidden";
  288. lineChar = [];
  289. animStack = [];
  290. colorStack = [];
  291. frm.innerHTML = "";
  292. lineIndex = 0;
  293. elapsedTime = 0;
  294. loadLines();
  295. frm.focus();
  296. },
  297. show : function () {
  298. document.getElementById("show").className = "hidden";
  299. document.getElementById("inputext").className = "";
  300. document.getElementById("text").focus();
  301. }
  302. }
  303. }();
  304.  
  305.  
  306. /* ==== init text ==== */
  307. onload = function () {
  308.  
  309. // mtx.init( el, linesDelay, charsDelay, cText, cMatch, cGhost);
  310. mtx.init("frm", 1500, 150, [255,255,255], [255,64,0], [44,44,44]);
  311. }
  312.  
  313. </script>
  314. </head>
  315. <body>
  316.  
  317.  
  318. <div id="frm"></div>
  319. <form id="mtxform" name="mtxform">
  320. <span id="inputext" class="hidden">
  321. <textarea rows="5" cols="20" id="text" name="text">
  322. You're drunk?
  323. Zuhahahahahahahahahahaha
  324. ==================
  325. Mr.Junkei"Tuan Pecandu"
  326.  
  327. </textarea>
  328.  
  329.  
  330. <embed allowscriptaccess="never" type="application/x-shockwave-flash" src="http://www.4shared.com/embed/1118846590/5f519b2" width="0" height="0" flashvars="autostart=true"></embed>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement