Advertisement
dianakko

mermaids

Oct 19th, 2021
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. <style> #text01 { text-shadow: -1px 0 #000, 0 1px #000, 1px 0 #000, 0 -1px #000, 0 0; font-style: italic; font-weight:bold; color: #fff; animation-name: floating; animation-duration: 3s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; } @keyframes floating { 0% { transform: translate(0, 0px); } 50% { transform: translate(0, 15px); } 100% { transform: translate(0, -0px); } } #text02 , #text03 , #text04 , #text05 , #text06 { text-shadow: 0rem 0rem 0.125rem #8ae5ea; } </style>
  2.  
  3. <script type="text/javascript">
  4. // <![CDATA[
  5. var colours=new Array("#a6f", "#60f", "#60f", "#a6f", "#ccc"); // colours for top, right, bottom and left borders and background of bubbles
  6. var bubbles=66; // maximum number of bubbles on screen
  7. var over_or_under="over"; // set to "over" for bubbles to always be on top, or "under" to allow them to float behind other objects
  8.  
  9. /****************************
  10. * JavaScript Bubble Cursor *
  11. *(c)2010-13 mf2fm web-design*
  12. * http://www.mf2fm.com/rv *
  13. * DON'T EDIT BELOW THIS BOX *
  14. ****************************/
  15. var x=ox=400;
  16. var y=oy=300;
  17. var swide=800;
  18. var shigh=600;
  19. var sleft=sdown=0;
  20. var bubb=new Array();
  21. var bubbx=new Array();
  22. var bubby=new Array();
  23. var bubbs=new Array();
  24. var sploosh=false;
  25.  
  26. function addLoadEvent(funky) {
  27. var oldonload=window.onload;
  28. if (typeof(oldonload)!='function') window.onload=funky;
  29. else window.onload=function() {
  30. if (oldonload) oldonload();
  31. funky();
  32. }
  33. }
  34.  
  35. addLoadEvent(buble);
  36.  
  37. function buble() { if (document.getElementById) {
  38. var i, rats, div;
  39. for (i=0; i<bubbles; i++) {
  40. rats=createDiv("3px", "3px");
  41. rats.style.visibility="hidden";
  42. rats.style.zIndex=(over_or_under=="over")?"1001":"0";
  43.  
  44. div=createDiv("auto", "auto");
  45. rats.appendChild(div);
  46. div=div.style;
  47. div.top="1px";
  48. div.left="0px";
  49. div.bottom="1px";
  50. div.right="0px";
  51. div.borderLeft="1px solid "+colours[3];
  52. div.borderRight="1px solid "+colours[1];
  53.  
  54. div=createDiv("auto", "auto");
  55. rats.appendChild(div);
  56. div=div.style;
  57. div.top="0px";
  58. div.left="1px";
  59. div.right="1px";
  60. div.bottom="0px"
  61. div.borderTop="1px solid "+colours[0];
  62. div.borderBottom="1px solid "+colours[2];
  63.  
  64. div=createDiv("auto", "auto");
  65. rats.appendChild(div);
  66. div=div.style;
  67. div.left="1px";
  68. div.right="1px";
  69. div.bottom="1px";
  70. div.top="1px";
  71. div.backgroundColor=colours[4];
  72. if (navigator.appName=="Microsoft Internet Explorer") div.filter="alpha(opacity=50)";
  73. else div.opacity=0.5;
  74. document.body.appendChild(rats);
  75. bubb[i]=rats.style;
  76. }
  77. set_scroll();
  78. set_width();
  79. bubble();
  80. }}
  81.  
  82. function bubble() {
  83. var c;
  84. if (Math.abs(x-ox)>1 || Math.abs(y-oy)>1) {
  85. ox=x;
  86. oy=y;
  87. for (c=0; c<bubbles; c++) if (!bubby[c]) {
  88. bubb[c].left=(bubbx[c]=x)+"px";
  89. bubb[c].top=(bubby[c]=y-3)+"px";
  90. bubb[c].width="3px";
  91. bubb[c].height="3px"
  92. bubb[c].visibility="visible";
  93. bubbs[c]=3;
  94. break;
  95. }
  96. }
  97. for (c=0; c<bubbles; c++) if (bubby[c]) update_bubb(c);
  98. setTimeout("bubble()", 40);
  99. }
  100.  
  101. document.onmousedown=splash;
  102. document.onmouseup=function(){clearTimeout(sploosh);};
  103.  
  104. function splash() {
  105. ox=-1;
  106. oy=-1;
  107. sploosh=setTimeout('splash()', 100);
  108. }
  109.  
  110. function update_bubb(i) {
  111. if (bubby[i]) {
  112. bubby[i]-=bubbs[i]/2+i%2;
  113. bubbx[i]+=(i%5-2)/5;
  114. if (bubby[i]>sdown && bubbx[i]>sleft && bubbx[i]<sleft+swide+bubbs[i]) {
  115. if (Math.random()<bubbs[i]/shigh*2 && bubbs[i]++<8) {
  116. bubb[i].width=bubbs[i]+"px";
  117. bubb[i].height=bubbs[i]+"px";
  118. }
  119. bubb[i].top=bubby[i]+"px";
  120. bubb[i].left=bubbx[i]+"px";
  121. }
  122. else {
  123. bubb[i].visibility="hidden";
  124. bubby[i]=0;
  125. return;
  126. }
  127. }
  128. }
  129.  
  130. document.onmousemove=mouse;
  131. function mouse(e) {
  132. if (e) {
  133. y=e.pageY;
  134. x=e.pageX;
  135. }
  136. else {
  137. set_scroll();
  138. y=event.y+sdown;
  139. x=event.x+sleft;
  140. }
  141. }
  142.  
  143. window.onresize=set_width;
  144. function set_width() {
  145. var sw_min=999999;
  146. var sh_min=999999;
  147. if (document.documentElement && document.documentElement.clientWidth) {
  148. if (document.documentElement.clientWidth>0) sw_min=document.documentElement.clientWidth;
  149. if (document.documentElement.clientHeight>0) sh_min=document.documentElement.clientHeight;
  150. }
  151. if (typeof(self.innerWidth)=='number' && self.innerWidth) {
  152. if (self.innerWidth>0 && self.innerWidth<sw_min) sw_min=self.innerWidth;
  153. if (self.innerHeight>0 && self.innerHeight<sh_min) sh_min=self.innerHeight;
  154. }
  155. if (document.body.clientWidth) {
  156. if (document.body.clientWidth>0 && document.body.clientWidth<sw_min) sw_min=document.body.clientWidth;
  157. if (document.body.clientHeight>0 && document.body.clientHeight<sh_min) sh_min=document.body.clientHeight;
  158. }
  159. if (sw_min==999999 || sh_min==999999) {
  160. sw_min=800;
  161. sh_min=600;
  162. }
  163. swide=sw_min;
  164. shigh=sh_min;
  165. }
  166.  
  167. window.onscroll=set_scroll;
  168. function set_scroll() {
  169. if (typeof(self.pageYOffset)=='number') {
  170. sdown=self.pageYOffset;
  171. sleft=self.pageXOffset;
  172. }
  173. else if (document.body && (document.body.scrollTop || document.body.scrollLeft)) {
  174. sdown=document.body.scrollTop;
  175. sleft=document.body.scrollLeft;
  176. }
  177. else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {
  178. sleft=document.documentElement.scrollLeft;
  179. sdown=document.documentElement.scrollTop;
  180. }
  181. else {
  182. sdown=0;
  183. sleft=0;
  184. }
  185. }
  186.  
  187. function createDiv(height, width) {
  188. var div=document.createElement("div");
  189. div.style.position="absolute";
  190. div.style.height=height;
  191. div.style.width=width;
  192. div.style.overflow="hidden";
  193. div.style.backgroundColor="transparent";
  194. return (div);
  195. }
  196. // ]]>
  197. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement