-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.html
More file actions
86 lines (84 loc) · 2.72 KB
/
Copy pathshell.html
File metadata and controls
86 lines (84 loc) · 2.72 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<html>
<head>
<style>
body {
margin: 0px;
}
canvas.emscripten {
object-fit: contain;
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
width: 100%;
background-color: black;
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: pixelated;
-webkit-tap-highlight-color: transparent;/
outline: 0;
border-radius: 0;
}
</style>
<script>
// This prevents inputs from scrolling the webpage
window.addEventListener(
"keydown",
function (e) {
if (
[
"Space",
"ArrowUp",
"ArrowDown",
"ArrowLeft",
"ArrowRight",
].indexOf(e.code) > -1
) {
e.preventDefault();
}
},
false,
);
</script>
</head>
<body>
<canvas
class="emscripten"
id="canvas"
oncontextmenu="event.preventDefault()"
tabindex="-1"
></canvas>
<p id="output" />
<script>
var Module = {
print: (function () {
var element = document.getElementById("output");
if (element) element.value = ""; // clear browser cache
return function (text) {
if (arguments.length > 1)
text = Array.prototype.slice
.call(arguments)
.join(" ");
console.log(text);
if (element) {
element.value += text + "\n";
element.scrollTop = element.scrollHeight; // focus on bottom
}
};
})(),
canvas: (function () {
var canvas = document.getElementById("canvas");
return canvas;
})(),
};
</script>
{{{ SCRIPT }}}
</body>
</html>