-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
94 lines (83 loc) · 1.94 KB
/
index.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
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
87
88
89
90
91
92
93
94
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
<title>pfr</title>
<style type="text/css">
body {
background-color: #000;
margin: 0;
overflow: hidden;
}
.start {
text-align: center;
font-size: 72px;
color: #fff;
cursor: crosshair; /* it's cute */
height: 100%;
width: 100%;
position: fixed;
z-index: 101;
}
.hidden {
display: none;
}
canvas {
cursor: none;
/* below fixes weird behavior w/ resizable winit windows */
position: absolute;
top: 0;
left: 0;
}
</style>
</head>
<body>
<div class="start">Click to start!</div>
<script type="module">
document.oncontextmenu = function() {return false;} // buggy, but we can't do better
window.get_asset = function(a) {
return(window.assets[a]);
};
window.bind_mobile_events = function() {
//const isMobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
const isMobile = true;
window.canvas = document.querySelector("canvas");
if (isMobile) {
window.canvas.style.width = "100%";
window.canvas.style.height = "100%";
}
return isMobile;
}
window.assets = [];
let promises = [];
[
"TABLE4.PRG",
"TABLE3.PRG",
"TABLE2.PRG",
"TABLE1.PRG",
"TABLE1.MOD",
"TABLE2.MOD",
"TABLE3.MOD",
"TABLE4.MOD",
"INTRO.MOD",
"INTRO.PRG",
"MOD2.MOD"
].forEach(file => {
promises.push(fetch(`/${file}`)
.then(response => response.arrayBuffer())
.then(buffer => {
window.assets[file] = new Uint8Array(buffer);
}));
})
import init from "./pfr.js";
Promise.all(promises).then(() => {
let start = document.querySelector(".start");
start.addEventListener("click", () => {
init();
start.style="display:none;";
});
})
</script>
</body>
</html>