added optional button to restart game (door, panel and touch variants)
[rocksndiamonds.git] / build-projects / emscripten / index.html
1 <!doctype html>
2 <html lang="en-us">
3 <head>
4 <meta charset="utf-8"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 <title>Loading Rocks'n'Diamonds</title>
6 <link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32">
7 <link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16">
8 <style>
9 body {
10     background: black;
11     text-align: center;
12     vertical-align: middle;
13 }
14 #loading {
15     color: white;
16     font-size: 120%;
17     font-family: sans-serif;
18 }
19 #canvas {
20     position: absolute;
21     top: 0px;
22     left: 0px;
23     margin: 0px;
24     width: 100%;
25     height: 100%;
26     overflow: hidden;
27     display: block;
28 }
29 </style>
30 </head>
31 <body>
32 <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
33 <div id="loading">
34 <img src="loading.svg" width="200px" height="200px">
35 <br>
36 Loading Rocks'n'Diamonds ...
37 </div>
38 <script type='text/javascript'>
39       var Module = {
40         arguments: [],
41         preRun: [
42           function() {}
43         ],
44         postRun: [
45           function() { loading.style.display = 'none'; }
46         ],
47         print: (function() {
48           var element = document.getElementById('output');
49           if (element) element.value = ''; // clear browser cache
50           return function(text) {
51             if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
52             console.log(text);
53           };
54         })(),
55         printErr: function(text) {
56           if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
57           if(text.startsWith("[FATAL]")) console.error(text);
58           else console.warn(text);
59         },
60         setStatus: function(text) {/*if(text == '') { document.title = "Rocks'n'Diamonds (stopped)"; } */},
61         quit: (function()
62         {
63           document.title = "Rocks'n'Diamonds (exited)";
64         }),
65         canvas: (function() {
66           var canvas = document.getElementById('canvas');
67
68           // As a default initial behavior, pop up an alert when webgl context is lost. To make your
69           // application robust, you may want to override this behavior before shipping!
70           // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
71           canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
72
73           return canvas;
74         })(),
75         totalDependencies: 0,
76         monitorRunDependencies: function(left) {
77           this.totalDependencies = Math.max(this.totalDependencies, left);
78         }
79       };
80       window.onerror = function(event) {
81         alert("An error occurred, see console.");
82         document.title = "Rocks'n'Diamonds (aborted)";
83       };
84 </script>
85 <script async type="text/javascript" src="rocksndiamonds.data.js"></script>
86 <script async type="text/javascript" src="rocksndiamonds.js"></script>
87 </body>
88 </html>