-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.html
54 lines (46 loc) · 1.39 KB
/
shell.html
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Rooms</title>
</head>
<body>
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1
style="position:fixed;height:100%;width:100%;top:0%;left:0%;resize:both;"></canvas>
<template id="main-script">
{{{ SCRIPT }}}
</template>
<script type='text/javascript'>
function loadApp() {
}
var Module = {
preRun: [],
postRun: [],
canvas: (function () {
var canvas = document.getElementById('canvas');
// Event handler to resize the canvas when the document view is changed
window.addEventListener('resize', () => {
canvas.clientWidth = window.innerWidth;
canvas.clientHeight = window.innerHeight;
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}, false);
return canvas;
})(),
totalDependencies: 0
};
(async () => {
// Custom for WebGPU
if (!navigator.gpu) {
console.error("Sorry, WebGPU is not suported by your browser.");
return;
} else {
const jsTemplate = document.getElementById("main-script");
const js = jsTemplate.content.cloneNode(true);
document.body.appendChild(js);
}
})();
</script>
</body>
</html>