blob: 615857182747c936f231f8b4272abdfa3e850c65 [file] [log] [blame]
James Kuszmaul36816f32019-08-31 16:58:23 -07001<!doctype html>
2<!--This file is adapted from https://github.com/emscripten-core/emscripten/blob/incoming/src/shell_minimal.html-->
3<html lang="en-us">
4 <head>
5 <meta charset="utf-8">
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
7 <title>Emscripten-Generated Code</title>
8 <style>
9 .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
10 div.emscripten { text-align: center; }
11 /* the canvas *must not* have any border or padding, or mouse coords will be wrong */
12 canvas.emscripten {
13 border: 0px none;
14 background-color: black;
15 }
16
17 .spinner {
18 height: 50px;
19 width: 50px;
20 margin: 0px auto;
21 -webkit-animation: rotation .8s linear infinite;
22 -moz-animation: rotation .8s linear infinite;
23 -o-animation: rotation .8s linear infinite;
24 animation: rotation 0.8s linear infinite;
25 border-left: 10px solid rgb(0,150,240);
26 border-right: 10px solid rgb(0,150,240);
27 border-bottom: 10px solid rgb(0,150,240);
28 border-top: 10px solid rgb(100,0,200);
29 border-radius: 100%;
30 background-color: rgb(200,100,250);
31 }
32 @-webkit-keyframes rotation {
33 from {-webkit-transform: rotate(0deg);}
34 to {-webkit-transform: rotate(360deg);}
35 }
36 @-moz-keyframes rotation {
37 from {-moz-transform: rotate(0deg);}
38 to {-moz-transform: rotate(360deg);}
39 }
40 @-o-keyframes rotation {
41 from {-o-transform: rotate(0deg);}
42 to {-o-transform: rotate(360deg);}
43 }
44 @keyframes rotation {
45 from {transform: rotate(0deg);}
46 to {transform: rotate(360deg);}
47 }
48
49 </style>
50 </head>
51 <body>
52 <figure style="overflow:visible;" id="spinner"><div class="spinner"></div><center style="margin-top:0.5em"><strong>emscripten</strong></center></figure>
53 <div class="emscripten" id="status">Downloading...</div>
54 <div class="emscripten">
55 <progress value="0" max="100" id="progress" hidden=1></progress>
56 </div>
57 <!--The width and height values in the canvas specify the pixel width/height for the WebGL canvas.
58 The actual on-screen size is controlled by the stylesheet.-->
59 <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" width=3000 height=2000></canvas>
60
61 <script type='text/javascript'>
62 var statusElement = document.getElementById('status');
63 var progressElement = document.getElementById('progress');
64 var spinnerElement = document.getElementById('spinner');
65
66 var Module = {
67 preRun: [],
68 postRun: [],
69 print: (function() {
70 return function(text) {
71 if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
72 console.log(text);
73 };
74 })(),
75 printErr: function(text) {
76 if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
77 console.error(text);
78 },
79 canvas: (function() {
80 var canvas = document.getElementById('canvas');
81
82 // As a default initial behavior, pop up an alert when webgl context is lost. To make your
83 // application robust, you may want to override this behavior before shipping!
84 // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
85 canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
86
87 return canvas;
88 })(),
89 setStatus: function(text) {
90 if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
91 if (text === Module.setStatus.last.text) return;
92 var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
93 var now = Date.now();
94 if (m && now - Module.setStatus.last.time < 30) return; // if this is a progress update, skip it if too soon
95 Module.setStatus.last.time = now;
96 Module.setStatus.last.text = text;
97 if (m) {
98 text = m[1];
99 progressElement.value = parseInt(m[2])*100;
100 progressElement.max = parseInt(m[4])*100;
101 progressElement.hidden = false;
102 spinnerElement.hidden = false;
103 } else {
104 progressElement.value = null;
105 progressElement.max = null;
106 progressElement.hidden = true;
107 if (!text) spinnerElement.hidden = true;
108 }
109 statusElement.innerHTML = text;
110 },
111 totalDependencies: 0,
112 monitorRunDependencies: function(left) {
113 this.totalDependencies = Math.max(this.totalDependencies, left);
114 Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
115 }
116 };
117 Module.setStatus('Downloading...');
118 window.onerror = function() {
119 Module.setStatus('Exception thrown, see JavaScript console');
120 spinnerElement.style.display = 'none';
121 Module.setStatus = function(text) {
122 if (text) Module.printErr('[post-exception status] ' + text);
123 };
124 };
125 </script>
126 {{{ SCRIPT }}}
127 </body>
128</html>