Advertisement
izuemis

munequita background

Feb 19th, 2023
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.81 KB | None | 0 0
  1. <script type="text/javascript">
  2. // <![CDATA[
  3. var speed=50; // lower number for faster
  4. var warp=3; // from 1 to 10
  5. var stars=150; // number of stars
  6. var colours=new Array("#94abff", "#36457d", "#1a194f"); // colours of stars
  7. var position=-1; // set to '0' for foreground and '-1' for stars to appear in the background, behind text on the page
  8.  
  9. /****************************
  10. * Star Warp Effect *
  11. *(c)2005-14 mf2fm web-design *
  12. * http://www.mf2fm.com/rv *
  13. * DON'T EDIT BELOW THIS BOX *
  14. ****************************/
  15. var strs=new Array();
  16. var strx=new Array();
  17. var stry=new Array();
  18. var stdx=new Array();
  19. var stdy=new Array();
  20. var strz=new Array();
  21. var swide=800;
  22. var shigh=600;
  23. warp=1+warp/125;
  24.  
  25. if (typeof('addRVLoadEvent')!='function') function addRVLoadEvent(funky) {
  26. var oldonload=window.onload;
  27. if (typeof(oldonload)!='function') window.onload=funky;
  28. else window.onload=function() {
  29. if (oldonload) oldonload();
  30. funky();
  31. }
  32. }
  33.  
  34. addRVLoadEvent(initiate_hyperjump);
  35.  
  36. function initiate_hyperjump() { if (document.getElementById) {
  37. var i, temp;
  38. boddie=document.createElement("div");
  39. boddie.style.position="fixed";
  40. boddie.style.top="0px";
  41. boddie.style.left="0px";
  42. boddie.style.width="1px";
  43. boddie.style.height="1px";
  44. boddie.style.overflow="visible";
  45. boddie.style.backgroundColor="transparent";
  46. boddie.style.zIndex=position;
  47. i=document.body.style.backgroundColor;
  48. if (document.body.parentNode) {
  49. if (i) document.body.parentNode.style.backgroundColor=i;
  50. document.body.style.backgroundColor="transparent";
  51. }
  52. document.body.insertBefore(boddie, document.body.firstChild);
  53. set_width();
  54. for (i=0; i<stars; i++) {
  55. strs[i]=document.createElement("div");
  56. strs[i].style.color=colours[i%colours.length];
  57. strs[i].style.backgroundColor="transparent";
  58. strs[i].style.position="absolute";
  59. strs[i].appendChild(document.createTextNode("*"));
  60. strs[i].style.font="13px monospace";
  61. stdy[i]=Math.random()*6-3;
  62. stdx[i]=Math.random()*8-4;
  63. temp=Math.random()*100;
  64. strx[i]=swide/2+temp*stdx[i];
  65. stry[i]=shigh/2+temp*stdy[i];
  66. if (Math.abs(stdx[i])+Math.abs(stdy[i])>5) strz[i]=13;
  67. else if (Math.abs(stdx[i])+Math.abs(stdy[i])>3) strz[i]=7;
  68. else strz[i]=2;
  69. strs[i].style.fontSize=strz[i]+"px";
  70. boddie.appendChild(strs[i]);
  71. }
  72. setInterval("warp_drive()", speed);
  73. }}
  74.  
  75. function warp_drive() {
  76. var i;
  77. for (i=0; i<stars; i++) {
  78. stry[i]+=stdy[i];
  79. strx[i]+=stdx[i];
  80. stdx[i]*=warp;
  81. stdy[i]*=warp;
  82. if (stry[i]>0 && stry[i]<shigh && strx[i]>0 && strx[i]<swide) {
  83. if (Math.abs(stdx[i])+Math.abs(stdy[i])>strz[i]) strs[i].style.fontSize=++strz[i]+"px";
  84. strs[i].style.left=strx[i]+"px";
  85. strs[i].style.top=stry[i]+"px"
  86. }
  87. else {
  88. strx[i]=swide/2;
  89. stry[i]=shigh/2;
  90. strx[i]+=3*(stdx[i]=Math.random()*8-4);
  91. stry[i]+=3*(stdy[i]=Math.random()*6-3);
  92. if (Math.abs(stdx[i])+Math.abs(stdy[i])>5) strz[i]=13;
  93. else if (Math.abs(stdx[i])+Math.abs(stdy[i])>3) strz[i]=7;
  94. else strz[i]=2;
  95. strs[i].style.fontSize=strz[i]+"px";
  96. }
  97. }
  98. }
  99.  
  100. window.onresize=set_width;
  101. function set_width() {
  102. var sw_min=999999;
  103. var sh_min=999999;
  104. if (document.documentElement && document.documentElement.clientWidth) {
  105. if (document.documentElement.clientWidth>0) sw_min=document.documentElement.clientWidth;
  106. if (document.documentElement.clientHeight>0) sh_min=document.documentElement.clientHeight;
  107. }
  108. if (typeof(self.innerWidth)!="undefined" && self.innerWidth) {
  109. if (self.innerWidth>0 && self.innerWidth<sw_min) sw_min=self.innerWidth;
  110. if (self.innerHeight>0 && self.innerHeight<sh_min) sh_min=self.innerHeight;
  111. }
  112. if (document.body.clientWidth) {
  113. if (document.body.clientWidth>0 && document.body.clientWidth<sw_min) sw_min=document.body.clientWidth;
  114. if (document.body.clientHeight>0 && document.body.clientHeight<sh_min) sh_min=document.body.clientHeight;
  115. }
  116. if (sw_min==999999 || sh_min==999999) {
  117. sw_min=800;
  118. sh_min=600;
  119. }
  120. swide=sw_min;
  121. shigh=sh_min;
  122. }
  123. // ]]>
  124. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement