Debian Codegraph @

res/emscripten/shell.html

raw symbols SCIP
1 <!doctype html>
2 <html lang="en-us">
3 <head>
4 <meta charset="utf-8">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>OpenJazz</title>
7 <style>
8 body {
9 font-family: arial;
10 margin: 0;
11 padding: none;
12 background-color: rgb(23, 23, 123);
13 }
14
15 .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; }
16 div.emscripten { text-align: center; }
17 /* the canvas *must not* have any border or padding, or mouse coords will be wrong */
18 canvas.emscripten { border: 0px none; background-color: black; }
19
20 .spinner {
21 height: 30px;
22 width: 30px;
23 margin: 0;
24 margin-top: 20px;
25 margin-left: 20px;
26 display: inline-block;
27 vertical-align: top;
28
29 -webkit-animation: rotation .8s linear infinite;
30 -moz-animation: rotation .8s linear infinite;
31 -o-animation: rotation .8s linear infinite;
32 animation: rotation 0.8s linear infinite;
33
34 border-left: 5px solid rgb(235, 235, 235);
35 border-right: 5px solid rgb(235, 235, 235);
36 border-bottom: 5px solid rgb(235, 235, 235);
37 border-top: 5px solid rgb(120, 120, 120);
38
39 border-radius: 100%;
40 background-color: rgb(189, 215, 46);
41 }
42
43 @-webkit-keyframes rotation {
44 from {-webkit-transform: rotate(0deg);}
45 to {-webkit-transform: rotate(360deg);}
46 }
47 @-moz-keyframes rotation {
48 from {-moz-transform: rotate(0deg);}
49 to {-moz-transform: rotate(360deg);}
50 }
51 @-o-keyframes rotation {
52 from {-o-transform: rotate(0deg);}
53 to {-o-transform: rotate(360deg);}
54 }
55 @keyframes rotation {
56 from {transform: rotate(0deg);}
57 to {transform: rotate(360deg);}
58 }
59
60 #status {
61 display: inline-block;
62 vertical-align: top;
63 margin-top: 30px;
64 margin-left: 20px;
65 font-weight: bold;
66 color: rgb(120, 120, 120);
67 }
68
69 #progress {
70 height: 20px;
71 width: 300px;
72 }
73
74 #infobox {
75 padding: 20px;
76 background-color: rgb(222, 222, 222);
77 }
78 </style>
79 </head>
80 <body>
81 <div class="spinner" id='spinner'></div>
82 <div class="emscripten" id="status">Downloading...</div>
83
84 <div class="emscripten">
85 <progress value="0" max="100" id="progress" hidden=1></progress>
86 </div>
87
88 <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1></canvas>
89
90 <br> <br>
91
92 <div id="infobox">
93 This is <a href="http://alister.eu/jazz/oj/">OpenJazz</a> powered by <a href="http://emscripten.org">emscripten</a>.
94 </div>
95
96 <script type='text/javascript'>
97 var statusElement = document.getElementById('status');
98 var progressElement = document.getElementById('progress');
99 var spinnerElement = document.getElementById('spinner');
100 var canvasElement = document.getElementById('canvas');
101
102 // As a default initial behavior, pop up an alert when webgl context is lost. To make your
103 // application robust, you may want to override this behavior before shipping!
104 // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
105 canvasElement.addEventListener('webglcontextlost', (e) => {
106 alert('WebGL context lost. You will need to reload the page.');
107 e.preventDefault();
108 }, false);
109
110 var Module = {
111 print(...args) {
112 console.log(...args);
113 },
114 canvas: canvasElement,
115 setStatus(text) {
116 if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
117 if (text === Module.setStatus.last.text) return;
118 var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
119 var now = Date.now();
120 // if this is a progress update, skip it if too soon
121 if (m && now - Module.setStatus.last.time < 30) return;
122 Module.setStatus.last.time = now;
123 Module.setStatus.last.text = text;
124 if (m) {
125 text = m[1];
126 progressElement.value = parseInt(m[2])*100;
127 progressElement.max = parseInt(m[4])*100;
128 progressElement.hidden = false;
129 spinnerElement.hidden = false;
130 } else {
131 progressElement.value = null;
132 progressElement.max = null;
133 progressElement.hidden = true;
134 if (!text) spinnerElement.style.display = 'none';
135 }
136 statusElement.innerHTML = text;
137 },
138 totalDependencies: 0,
139 monitorRunDependencies(left) {
140 this.totalDependencies = Math.max(this.totalDependencies, left);
141 Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
142 },
143 onExit(status) {
144 Module.setStatus('OpenJazz has closed. Refresh the browser window to play again.');
145 }
146 };
147 Module.setStatus('Downloading...');
148 window.onerror = (event) => {
149 // TODO: do not warn on ok events like simulating an infinite loop or exitStatus
150 Module.setStatus('Exception thrown, see JavaScript console');
151 spinnerElement.style.display = 'none';
152 Module.setStatus = (text) => {
153 if (text) console.error('[post-exception status] ' + text);
154 };
155 };
156 </script>
157 <script async type="text/javascript" src=data.js></script>
158 {{{ SCRIPT }}}
159 </body>
160 </html>