-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb_shell.html
More file actions
66 lines (60 loc) · 1.98 KB
/
web_shell.html
File metadata and controls
66 lines (60 loc) · 1.98 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>C Orbit - Web Version</title>
<style>
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
background-color: #000;
font-family: Arial, sans-serif;
overflow: hidden;
}
#loading {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 18px;
z-index: 1000;
}
#canvas {
width: 100%;
height: 100%;
display: block;
object-fit: contain;
}
</style>
</head>
<body>
<div id="loading">Loading C Orbit...</div>
<canvas id="canvas" oncontextmenu="event.preventDefault()"></canvas>
<script type='text/javascript'>
var Module = {
onRuntimeInitialized: function() {
document.getElementById('loading').style.display = 'none';
},
canvas: (function() {
var canvas = document.getElementById('canvas');
// Only monitor for dev console changes and let Emscripten handle everything else
var lastWidth = window.innerWidth;
var lastHeight = window.innerHeight;
setInterval(function() {
if (window.innerWidth !== lastWidth || window.innerHeight !== lastHeight) {
lastWidth = window.innerWidth;
lastHeight = window.innerHeight;
// Just dispatch a resize event - let Emscripten handle the canvas
window.dispatchEvent(new Event('resize'));
}
}, 250);
return canvas;
})()
};
</script>
{{{ SCRIPT }}}
</body>
</html>