<!doctype html>
<html lang="en-us">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>MKXP</title>
    <style>
    	body {
    	    margin: 0;
    	    padding: 0;
    	    background-color: black;
    	    height: 100vh
    	}
    
        #canvas {
      	    padding: 0;
      	    margin: 0 auto;
      	    display: block;
      	    border: 0px none;
      	    background-color: black;
      	    height: 100%;
        }
        #spinner {
            position: fixed;
            bottom: 20px;
            left: 20px;
        }
       .spinner {
            height: 50px;
            width: 50px;
            margin: 0px auto;
            -webkit-animation: rotation .8s linear infinite;
            -moz-animation: rotation .8s linear infinite;
            -o-animation: rotation .8s linear infinite;
            animation: rotation 0.8s linear infinite;
            border-left: 10px solid white;
            border-right: 10px solid white;
            border-bottom: 10px solid white;
            border-top: 10px solid transparent;
            border-radius: 100%;
            background-color: transparent;
       }
       
       @-webkit-keyframes rotation {
            from {-webkit-transform: rotate(0deg);}
            to {-webkit-transform: rotate(360deg);}
       }
       @-moz-keyframes rotation {
            from {-moz-transform: rotate(0deg);}
            to {-moz-transform: rotate(360deg);}
       }
       @-o-keyframes rotation {
            from {-o-transform: rotate(0deg);}
            to {-o-transform: rotate(360deg);}
       }
      @keyframes rotation {
            from {transform: rotate(0deg);}
            to {transform: rotate(360deg);}
      }
    </style>
  </head>
  <body>
    <div style="overflow:visible;" id="spinner">
    	<div class="spinner"></div>
    </div>
    
    <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1 width="640" height="480"></canvas>

    <script type='text/javascript'>
      var Module = {
        preRun: [],
        postRun: [],
        print: (function() {
          return function(text) {
            console.log(text);
          };
        })(),
        printErr: function(text) {
          if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
          console.error(text);
        },
        canvas: (function() {
          var canvas = document.getElementById('canvas');
          canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);

          return canvas;
        })(),
        setStatus: function(text) {

        }
      };

      window.setBusy = function() {
          document.getElementById('spinner').style.display = "block";
      };
      
      window.setNotBusy = function() {
          document.getElementById('spinner').style.display = "none";
      };

      window.onerror = function() {
          alert("An error occured!")
      };
    </script>

    {{{ SCRIPT }}}
  </body>
</html>