Advertisement
Guest User

StackFlow Help

a guest
Feb 28th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.23 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Welcome to VortexPvP!</title>
  6. </head>
  7.  
  8. <script>
  9. (function(){
  10. /**
  11. author: @manufosela
  12. 2013/08/27 copyleft 2013
  13.  
  14. ShootingStar class Main Methods:
  15. launch: launch shooting stars every N seconds received by param. 10 seconds by default.
  16. launchStar: launch a shooting star. Received options object by param with:
  17. - dir (direction between 0 and 1)
  18. - life (between 100 and 400)
  19. - beamSize (between 400 and 700)
  20. - velocity (between 2 and 10)
  21. **/
  22.  
  23. ShootingStar = function( id ) {
  24. this.n = 0;
  25. this.m = 0;
  26. this.defaultOptions = { velocity:8, starSize:10, life:300, beamSize:400, dir:-1 };
  27. this.options = {};
  28. id = ( typeof id != "undefined" )?id:"";
  29. this.capa = ( $( id ).lenght > 0 )?"body":id;
  30. this.wW = $( this.capa ).innerWidth();
  31. this.hW = $( this.capa ).innerHeight();
  32. };
  33.  
  34. ShootingStar.prototype.addBeamPart = function( x, y ) {
  35. this.n++;
  36. var name = this.getRandom( 100, 1 );
  37. $( "#star"+name ).remove();
  38. $( this.capa ).append( "<div id='star"+name+"'></div>" );
  39. $( "#star"+name ).append( "<div id='haz"+this.n+"' class='haz' style='position:absolute; color:#FF0; width:10px; height:10px; font-weight:bold; font-size:"+this.options.starSize+"px'>·</div>" );
  40. if ( this.n > 1 ) $( "#haz" + ( this.n - 1 ) ).css( { color:"rgba(255,255,255,0.5)" } );
  41. $( "#haz" + this.n ).css( { top: y + this.n, left: x + ( this.n * this.options.dir ) } );
  42. }
  43.  
  44. ShootingStar.prototype.delTrozoHaz = function() {
  45. this.m++;
  46. $( "#haz" + this.m ).animate( {opacity:0}, 75 );
  47. if ( this.m >= this.options.beamSize ) { $( "#ShootingStarParams" ).fadeOut( "slow" ); }
  48. }
  49.  
  50. ShootingStar.prototype.getRandom = function( max, min ) {
  51. return Math.floor( Math.random() * (max - min + 1)) + min;
  52. }
  53.  
  54. ShootingStar.prototype.toType = function ( obj ) {
  55. if ( typeof obj === "undefined" ) { return "undefined"; /* consider: typeof null === object */ }
  56. if ( obj === null ) { return "null"; }
  57. var type = Object.prototype.toString.call( obj ).match( /^\[object\s(.*)\]$/ )[1] || '';
  58. switch ( type ) {
  59. case 'Number': if ( isNaN( obj ) ) { return "nan"; } else { return "number"; }
  60. case 'String': case 'Boolean': case 'Array': case 'Date': case 'RegExp': case 'Function': return type.toLowerCase();
  61. }
  62. if ( typeof obj === "object" ) { return "object"; }
  63. return undefined;
  64. }
  65.  
  66. ShootingStar.prototype.launchStar = function( options ) {
  67. if ( this.toType( options ) != "object" ) { options = {}; }
  68. this.options = $.extend( {}, this.defaultOptions, options );
  69. this.n=0;
  70. this.m=0;
  71. var i=0, l=this.options.beamSize,
  72. x=this.getRandom( this.wW - this.options.beamSize - 100, 100 ), y=this.getRandom( this.hW - this.options.beamSize - 100, 100 ),
  73. self = this;
  74. for( ; i<l; i++ ) { setTimeout( function(){ self.addBeamPart( x, y ); }, self.options.life + ( i * self.options.velocity ) ); }
  75. for( i=0; i<l; i++ ) { setTimeout( function(){ self.delTrozoHaz() }, self.options.beamSize + ( i * self.options.velocity ) ); }
  76. $( "#ShootingStarParams" ).html();
  77. $( "#ShootingStarParams" ).fadeIn( "slow" );
  78. }
  79.  
  80. ShootingStar.prototype.launch = function( everyTime ) {
  81. if ( this.toType( everyTime ) != "number" ) { everyTime = 2; }
  82. everyTime = everyTime * 1000;
  83. this.launchStar();
  84. var self = this;
  85. setInterval( function() {
  86. var options = {
  87. dir: ( self.getRandom( 1, 0 ))?1:-1,
  88. life: self.getRandom( 400, 100 ),
  89. beamSize: self.getRandom( 700, 400 ),
  90. velocity: self.getRandom( 10, 4 )
  91. }
  92. self.launchStar( options );
  93. }, everyTime );
  94. }
  95.  
  96. })();
  97.  
  98. </script>
  99. </div>
  100. <style type="text/css">
  101. #top-image {
  102. background:url('https://www.14denoviembre.es/img/stars_5.png') -25px -50px;
  103. position:fixed ;
  104. top:0;
  105. width:100%;
  106. z-index:0;
  107. height:100%;
  108. background-size: calc(100% + 50px);
  109. }
  110.  
  111. body {
  112. color:#FFF;
  113. height:600px;
  114. width:99%;
  115. height:95%;
  116. color:#FFF;
  117. min-width:1920px;
  118. width: auto !important;
  119. }
  120.  
  121. .stars {
  122. z-index: 0;
  123. position: absolute;
  124. background-image: url( http://www.14denoviembre.es/img/hori.png ), url( http://www.14denoviembre.es/img/stars_5.png );
  125. background-repeat: repeat-x,repeat-x repeat-y;
  126. transform:translate3D(0em, 0em, 0);
  127. animation: stars 21s ease;
  128. transform-style: preserve-3d;
  129.  
  130. }
  131.  
  132. .Icon {
  133.  
  134. width: 1920px;
  135. height: 200px;
  136. top: 5px;
  137. position: fixed;
  138. z-index: 998 !important;
  139. padding: 10px;
  140. display: block;
  141. margin:auto;
  142. align-content: center;
  143.  
  144.  
  145. }
  146.  
  147. .container {
  148. position: relative;
  149. top: 0px;
  150. text-align: center;
  151. }
  152. #logo {
  153. height:auto;
  154. }
  155.  
  156.  
  157. .shadowfilter {
  158. -webkit-filter: drop-shadow(0px 0px 0px rgba(0,0,0,0.80));
  159. -webkit-transition: all 0.5s linear;
  160. -o-transition: all 0.5s linear;
  161. transition: all 0.5s linear;
  162.  
  163. }
  164.  
  165. .shadowfilter:hover {
  166. -webkit-filter: drop-shadow(0px 0px 8px rgba(255, 255, 255, 0.8));
  167. }
  168.  
  169. html {
  170. overflow-y: scroll;
  171. }
  172.  
  173.  
  174. #thumbs {
  175. width: 1000px;
  176. margin-top: 500px;
  177. margin-left: auto;
  178. margin-right: auto;
  179.  
  180. text-align: justify;
  181. -ms-text-justify: distribute-all-lines;
  182. text-justify: distribute-all-lines;
  183. }
  184.  
  185.  
  186. .stretch {
  187. width: 100%;
  188. display: inline-block;
  189. font-size: 5;
  190. }
  191.  
  192. </style>
  193. <body class="stars">
  194. <div id="thumbs">
  195.  
  196. <a href="http://vortexpvp.com/shop" id="single_image1"><img class="shadowfilter" src="http://i.imgur.com/pWLcgGj.png" alt="Shop_Icon" height="200" width="190"/></a>
  197.  
  198. <a href="http://vortexpvp.com/members" id="single_image2"><img class="shadowfilter" src="http://i.imgur.com/KLhSpnV.png" alt="Staff_Icon"/></a>
  199.  
  200. <a href="http://vortexpvp.com/forums" id="single_image3"><img class="shadowfilter" src="http://i.imgur.com/naxwKEM.png" alt="Forums_Icon"/></a>
  201.  
  202. <a href="http://vortexpvp.com/bans" id="single_image4"><img class="shadowfilter" src="http://i.imgur.com/Y99mgIG.png" alt="Bans_Icon"/></a>
  203.  
  204. <a href="http://vortexpvp.com/vote" id="single_image5"><img class="shadowfilter" src="http://i.imgur.com/iGIl9hs.png" alt="Vote_Icon"/></a>
  205.  
  206. <span class="stretch"></span>
  207. </div>​
  208.  
  209.  
  210. <div class="container">
  211. <div class="Icon">
  212. <img src="http://files.enjin.com/353719/module_header/10950667/background/Vortex-Network-Logonew.png" width="593" height="425"></img>
  213. </div>
  214. </div>
  215.  
  216. <div id="top-image"></div>
  217. <div id="ShootingStarParams"></div>
  218. <script type="text/javascript" src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script>
  219. <script type="text/javascript" src="ShootingStarClass.js"></script>
  220. <script type="text/javascript">
  221. $( document ).ready( function(){
  222. var shootingStarObj = new ShootingStar( "body" );
  223. shootingStarObj.launch();
  224. });
  225. </script>
  226.  
  227. </div>
  228. </body>
  229. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement