aboutsummaryrefslogtreecommitdiff
path: root/src/shell.html
blob: 284bc8d6351c87df1d2d3bb4ab7a189274d9e2b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
  <head>
    <title>Emscripten-Generated Code</title>
  <body>
    <center>
      <canvas id='canvas' width='256' height='256'></canvas>
    </center>
    <hr>
    <div id='output'></div>
    <hr>
    <script type='text/javascript'>
      // implement print
      var print = (function() {
        var element = document.getElementById('output');
        return function(text) {
          element.innerHTML += text.replace('\n', '<br>', 'g') + '<br>';
        };
      })();

      // connect to canvas
      var Module = {
        canvas: document.getElementById('canvas'),
        ctx2D: document.getElementById('canvas').getContext('2d')
      };
      if (!Module.ctx2D) alert('Canvas not available :(');

      // The compiled code
      {{{ SCRIPT_CODE }}}
    </script>
  </body>
</html>