-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
33 lines (30 loc) · 1.06 KB
/
index.html
File metadata and controls
33 lines (30 loc) · 1.06 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
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<title>Archmage - Fantasy Virtual Machine</title>
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
</head>
<body>
<div align="center">
<input type="file" id="kernel_upload">
</div>
<div align="center">
<canvas id="canvas" height="540" width="960"></canvas>
</div>
<script type="module">
import init from "./pkg/archmage.js";
document.getElementById('kernel_upload').addEventListener('change', handleKernelLoad, false);
function handleKernelLoad(event) {
const reader = new FileReader()
reader.onload = start;
reader.readAsArrayBuffer(event.target.files[0]);
document.getElementById('kernel_upload').style.display = 'none';
}
function start(event) {
window.kernel = new Uint8Array(event.target.result);
init();
}
</script>
</body>
</html>