Advertisement
GIFCITY

shaking text

Nov 16th, 2021 (edited)
895
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. <style>
  2. .shaking {
  3.  
  4. animation: shake2 1s;
  5. animation-iteration-count: infinite;
  6. -webkit-transition: .4s ease-in;
  7. -moz-transition: .4s ease-in;
  8. transition: .4s ease-in;
  9. }
  10.  
  11. @keyframes shake {
  12. 0% {
  13. transform: translate(1px, 1px) rotate(0deg);
  14. }
  15.  
  16. 10% {
  17. transform: translate(-1px, -2px) rotate(-1deg);
  18. }
  19.  
  20. 20% {
  21. transform: translate(-2px, 0px) rotate(1deg);
  22. }
  23.  
  24. 30% {
  25. transform: translate(1px, 1px) rotate(0deg);
  26. }
  27.  
  28. 40% {
  29. transform: translate(1px, -1px) rotate(1deg);
  30. }
  31.  
  32. 50% {
  33. transform: translate(-1px, 2px) rotate(-1deg);
  34. }
  35.  
  36. 60% {
  37. transform: translate(-2px, 1px) rotate(0deg);
  38. }
  39.  
  40. 70% {
  41. transform: translate(2px, 1px) rotate(-1deg);
  42. }
  43.  
  44. 80% {
  45. transform: translate(-1px, -1px) rotate(1deg);
  46. }
  47.  
  48. 90% {
  49. transform: translate(1px, 1px) rotate(0deg);
  50. }
  51.  
  52. 100% {
  53. transform: translate(1px, -2px) rotate(-1deg);
  54. }
  55. }
  56.  
  57. @keyframes shake2 {
  58. 0% {
  59. transform: translate(1px, 1px) rotate(0deg);
  60. }
  61.  
  62. 10% {
  63. transform: translate(-1px, -2px) rotate(0deg);
  64. }
  65.  
  66. 20% {
  67. transform: translate(-1px, 0px) rotate(1deg);
  68. }
  69.  
  70. 30% {
  71. transform: translate(1px, 1px) rotate(0deg);
  72. }
  73.  
  74. 40% {
  75. transform: translate(1px, -1px) rotate(1deg);
  76. }
  77.  
  78. 50% {
  79. transform: translate(-1px, 2px) rotate(0deg);
  80. }
  81.  
  82. 60% {
  83. transform: translate(-1px, 1px) rotate(0deg);
  84. }
  85.  
  86. 70% {
  87. transform: translate(1px, 1px) rotate(-1deg);
  88. }
  89.  
  90. 80% {
  91. transform: translate(-1px, -1px) rotate(0deg);
  92. }
  93.  
  94. 90% {
  95. transform: translate(1px, 1px) rotate(0deg);
  96. }
  97.  
  98. 100% {
  99. transform: translate(1px, -2px) rotate(-1deg);
  100. }
  101. }
  102. </style>
  103. <script type="text/javascript">
  104. // <![CDATA[
  105. var cursor = "";
  106. // set cursor
  107. /***************************\
  108. * News Ticker Text Effect *
  109. *(c)2004-14 mf2fm web-design*
  110. * http://www.mf2fm.com/rv *
  111. * DON'T EDIT BELOW THIS BOX *
  112. \***************************/
  113. var newsp, cursp, flash, item = 0;
  114.  
  115. if (typeof ('addRVLoadEvent') != 'function')
  116. function addRVLoadEvent(funky) {
  117. var oldonload = window.onload;
  118. if (typeof (oldonload) != 'function')
  119. window.onload = funky;
  120. else
  121. window.onload = function() {
  122. if (oldonload)
  123. oldonload();
  124. funky();
  125. }
  126. }
  127.  
  128. addRVLoadEvent(teleprint);
  129.  
  130. function teleprint() {
  131. if (document.getElementById) {
  132. var span = document.getElementById("news");
  133. while (span.childNodes.length)
  134. span.removeChild(span.childNodes[0]);
  135. delay *= 1000;
  136. newsp = document.createElement("span");
  137. cursp = document.createElement("span");
  138. cursp.appendChild(document.createTextNode(String.fromCharCode(160) + cursor));
  139. span.appendChild(newsp);
  140. span.appendChild(cursp);
  141. ticker();
  142. }
  143. }
  144.  
  145. function ticker() {
  146. var i;
  147. while (newsp.childNodes.length)
  148. newsp.removeChild(newsp.childNodes[0]);
  149. newsp.appendChild(document.createTextNode(news[item].substring(0, 1)));
  150. for (i = 1; i < news[item].length; i++)
  151. setTimeout('newsp.firstChild.nodeValue="' + news[item].substring(0, i + 1) + '"', 100 * i);
  152. if (news[item].indexOf("www") != -1)
  153. setTimeout('linkit(' + item + ')', 100 * i);
  154. setTimeout('flash=setInterval("cursp.style.visibility=(cursp.style.visibility==\'visible\')?\'hidden\':\'visible\'", 234)', 100 * i)
  155. setTimeout('clearInterval(flash)', delay);
  156. setTimeout('cursp.style.visibility="visible"', delay);
  157. setTimeout('ticker()', delay);
  158. item = ++item % news.length;
  159. }
  160.  
  161. function linkit(q) {
  162. var a, p, e, l;
  163. p = news[q].indexOf("www");
  164. e = news[q].indexOf(" ", p);
  165. if (e == -1)
  166. e = news[q].length;
  167. l = news[q].substring(p, e);
  168. while (newsp.childNodes.length)
  169. newsp.removeChild(newsp.childNodes[0]);
  170. newsp.appendChild(document.createTextNode(news[q].substring(0, p)));
  171. a = document.createElement("a");
  172. a.href = "http://" + l;
  173. a.appendChild(document.createTextNode(l));
  174. newsp.appendChild(a);
  175. newsp.appendChild(document.createTextNode(news[q].substring(e)));
  176. }
  177. // ]]>
  178. </script>
  179.  
  180. <div class="shaking">text</div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement