Advertisement
Guest User

Untitled

a guest
May 17th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>  
  2. <!--[if lt IE 7 ]> <html lang="en" class="no-js ie6"> <![endif]-->
  3. <!--[if IE 7 ]>    <html lang="en" class="no-js ie7"> <![endif]-->
  4. <!--[if IE 8 ]>    <html lang="en" class="no-js ie8"> <![endif]-->
  5. <!--[if IE 9 ]>    <html lang="en" class="no-js ie9"> <![endif]-->
  6. <!--[if (gt IE 9)|!(IE)]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
  7. <head>
  8.     <meta charset="utf-8">
  9.     <title>Global Trust Gaming</title>
  10.     <link href='http://fonts.googleapis.com/css?family=Audiowide' rel='stylesheet' type='text/css'>
  11. <style>
  12.         * { margin: 0; padding: 0; }
  13.        
  14.     html, body{
  15.         margin: 0;
  16.         padding: 0;
  17.         width: 100%;
  18.         height: 100%;
  19.         overflow: hidden;
  20.     }
  21.     body{
  22.         background:url(http://i.imgur.com/xIVcCyf.png) no-repeat center center fixed;
  23.         background-size: cover;
  24.         COLOR: #fc6a2c
  25.     }
  26.    
  27.     </style>
  28.     <meta name="description" content="">
  29.     <meta name="viewport" content="width=device-width; initial-scale=1.0">
  30.  
  31.     <script type="text/javascript" src="http://code.jquery.com/jquery-2.0.0.min.js"></script>    
  32. </head>
  33. <body>
  34.  
  35.  
  36.     <div id="gameLoadingText" style="position: absolute; top: 45%; text-align: center; width: 100%; font-family: 'Audiowide'; font-size: xx-large;">Please wait<br>your game is loading...</div>
  37.  
  38.     <div id="loadingText" style="position: absolute; top: 45%; text-align: center; width: 100%; font-family: 'Audiowide'; font-size: xx-large;"></div>
  39.  
  40.     <div id="debug" style="position: absolute; top: 70%; text-align: center; width: 100%; font-family: 'Audiowide'; font-size: xx-large;"></div>
  41.  
  42.     <script type="text/javascript">
  43.         var iFilesNeeded = 0;
  44.         var iFilesBeginning = 0;
  45.         var iFilesTotal = 0;
  46.         var filesDownloaded = -1;
  47.         var pct = 0;
  48.         var isDownloading = false;
  49.        
  50.         function SetFilesNeeded( iNeeded ) {
  51.             iFilesNeeded = iNeeded;
  52.             iFilesBeginning = iNeeded;
  53.             RefreshFileBox();
  54.         }
  55.            
  56.         function SetFilesTotal( iTotal ) {
  57.             iFilesTotal = iTotal;
  58.             RefreshFileBox();
  59.         }
  60.         function RefreshPct() {
  61.             pct = Math.floor((filesDownloaded / iFilesBeginning) * 100) + 1;
  62.         }
  63.         function DownloadingFile( filename ) {
  64.             if (isDownloading)
  65.             {
  66.                 iFilesNeeded = iFilesNeeded - 1;
  67.                 filesDownloaded = filesDownloaded + 1;
  68.             }
  69.             isDownloading = true;
  70.             RefreshPct();              
  71.             RefreshFileBox();
  72.         }
  73.  
  74.         function SetStatusChanged(strStatus)
  75.         {
  76.             isDownloading = false;
  77.             RefreshFileBox();
  78.         }
  79.        
  80.         function RefreshFileBox() {
  81.             if (iFilesNeeded > 5)
  82.                 $('#loadingText').html(iFilesNeeded + " downloads remaining<br>"+pct+"%");
  83.             else if (iFilesNeeded === 1 && filesDownloaded > 5)
  84.                 $('#loadingText').html(iFilesNeeded + " download remaining<br>"+pct+"%");
  85.                
  86.             if (isDownloading && iFilesNeeded > 5) {
  87.                 $("#loadingText").show();
  88.                 $('#gameLoadingText').hide();
  89.             }else{
  90.                 $("#loadingText").hide();
  91.                 $('#gameLoadingText').show();
  92.             }
  93.         }
  94.         RefreshFileBox();
  95.     </script>
  96.  
  97. <div id="loaderImage" style="position: absolute; left: 50%; margin-left: -64px; top: 25%; width: 100%;">
  98.     <script type="text/javascript">
  99.             var cSpeed=12;
  100.             var cWidth=128;
  101.             var cHeight=128;
  102.             var cTotalFrames=8;
  103.             var cFrameWidth=128;
  104.             var cImageSrc='http://i.imgur.com/TtjBQHr.png';
  105.    
  106.             var cImageTimeout=false;
  107.             var cIndex=0;
  108.             var cXpos=0;
  109.             var SECONDS_BETWEEN_FRAMES=0;
  110.    
  111.     function startAnimation(){
  112.        
  113.         document.getElementById('loaderImage').style.backgroundImage='url('+cImageSrc+')';
  114.         document.getElementById('loaderImage').style.width=cWidth+'px';
  115.         document.getElementById('loaderImage').style.height=cHeight+'px';
  116.        
  117.         //FPS = Math.round(100/(maxSpeed+2-speed));
  118.         FPS = Math.round(100/cSpeed);
  119.         SECONDS_BETWEEN_FRAMES = 1 / FPS;
  120.        
  121.         setTimeout('continueAnimation()', SECONDS_BETWEEN_FRAMES/1000);
  122.        
  123.     }
  124.    
  125.     function continueAnimation(){
  126.        
  127.         cXpos += cFrameWidth;
  128.         //increase the index so we know which frame of our animation we are currently on
  129.         cIndex += 1;
  130.          
  131.         //if our cIndex is higher than our total number of frames, we're at the end and should restart
  132.         if (cIndex >= cTotalFrames) {
  133.             cXpos =0;
  134.             cIndex=0;
  135.         }
  136.        
  137.         document.getElementById('loaderImage').style.backgroundPosition=(-cXpos)+'px 0';
  138.        
  139.         setTimeout('continueAnimation()', SECONDS_BETWEEN_FRAMES*1000);
  140.     }
  141.    
  142.     function imageLoader(s, fun)//Pre-loads the sprites image
  143.     {
  144.         clearTimeout(cImageTimeout);
  145.         cImageTimeout=0;
  146.         genImage = new Image();
  147.         genImage.onload=function (){cImageTimeout=setTimeout(fun, 0)};
  148.         genImage.onerror=new Function('alert(\'Could not load the image\')');
  149.         genImage.src=s;
  150.     }
  151.    
  152.     //The following code starts the animation
  153.     new imageLoader(cImageSrc, 'startAnimation()');
  154. </script>  
  155. </div>
  156.  
  157. </body>
  158. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement