Advertisement
Guest User

Untitled

a guest
Dec 5th, 2013
1,004
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.75 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <head>
  3. <title>PartyHard</title>
  4.  
  5. <script type="text/javascript">
  6.  
  7.   var _gaq = _gaq || [];
  8.   _gaq.push(['_setAccount', 'UA-19349612-1']);
  9.   _gaq.push(['_trackPageview']);
  10.  
  11.   (function() {
  12.     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  13.     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  14.     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  15.   })();
  16.  
  17. </script>
  18.  
  19. <script>
  20.  
  21.   function partyHard( drunkenness ) {
  22.  
  23.     var mapCanvas = [];
  24.     var mapCanvasCtx = [];
  25.     for (var i = 0; i < drunkenness * 1200; i++) {
  26.    mapCanvas[i] = document.createElement('canvas');
  27.        mapCanvas[i].width = 2500;
  28.        mapCanvas[i].height = 2500;
  29.        mapCanvasCtx[i] = mapCanvas[i].getContext('2d');
  30.        mapCanvasCtx[i].fillStyle = 'rgb(0, 0, 0)';
  31.        mapCanvasCtx[i].fillRect( 0, 0, 1700, 1700 );
  32.    }
  33.    console.log(window);
  34.  }
  35.  
  36.  function INIT() {
  37.  
  38.    var progress = 0;
  39.  
  40.    document.querySelector('.progessBar div').style.width = '0%';
  41.  
  42.    var mainInterval = setInterval(function() {
  43.  
  44.      document.querySelector('.label').innerHTML += '.';
  45.      if ( document.querySelector('.label').innerHTML.length > 10 ) document.querySelector('.label').innerHTML = 'Loading';
  46.      
  47.       progress += 200 / (2 * progress + 40);
  48.  
  49.       document.querySelector('.progessBar div').style.width = progress + '%';
  50.  
  51.       if (progress > 10) {
  52.         partyHard( 4 * progress - 10 );
  53.       }
  54.  
  55.     }, 300);
  56.  
  57.   }
  58.  
  59.   window.onload = INIT;
  60.  
  61. </script>
  62. </head>
  63.  
  64. <style>
  65.  
  66.   body {
  67.     position: absolute;
  68.     top: 0px;
  69.     left: 0px;
  70.     width: 100%;
  71.     height: 100%;
  72.     background-color: #111;
  73.     overflow: hidden;
  74.   }
  75.  
  76.   .mainBlock {
  77.     position: relative;
  78.     margin-left: auto;
  79.     margin-right: auto;
  80.     margin-top: 20%;
  81.     width: 400px;
  82.   }
  83.  
  84.   .progessBar {
  85.     width: 400px;
  86.     height: 4px;
  87.     border-radius: 3px;
  88.     background-color: #181818;
  89.   }
  90.  
  91.   .progessBar div {
  92.     position: absolute;
  93.     width: 0%;
  94.     height: 3px;
  95.     border-radius: 4px;
  96.     background-color: #fff;
  97.   }
  98.  
  99.   .label {
  100.     padding-top: 5px;
  101.     font: normal 13px arial;
  102.     letter-spacing: 0.1em;
  103.     color: #eee;
  104.   }
  105.  
  106.   .ohmedWasHere {
  107.     position: relative;
  108.     width: 400px;
  109.     margin-right: auto;
  110.     margin-left: auto;
  111.     text-align: right;
  112.     color: #555;
  113.     font: normal 10px tahoma;
  114.     letter-spacing: 0.1em;
  115.   }
  116.  
  117. </style>
  118.  
  119.  
  120. <body>
  121.  
  122.   <div class="mainBlock" >
  123.     <div class="label">Loading</div>
  124.     <div class="progessBar">
  125.       <div></div>
  126.     </div>
  127.   </div>
  128.  
  129.   <div class="ohmedWasHere">ohmed was here.</div>
  130.  
  131. </body>
  132. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement