generated from piesku/goodluck
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
58 lines (56 loc) · 1.42 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
<!DOCTYPE html>
<meta charset="utf8" />
<meta name="viewport" content="width=device-width, user-scalable=0" />
<meta name="theme-color" content="#696" />
<title>ESCAPE</title>
<link rel="stylesheet" href="play/game.css" />
<style>
#debug {
display: flex;
flex-flow: column nowrap;
align-items: flex-end;
position: absolute;
top: 0;
right: 0;
color: #fff;
font-family: monospace;
}
#debug button {
cursor: pointer;
padding: 0;
background: none;
border: none;
font: inherit;
color: inherit;
}
#debug div {
width: max-content;
background: #000;
color: #fff;
}
</style>
<body>
<canvas id="scene"></canvas>
<main></main>
<div id="debug">
<div>update: <span id="update"></span></div>
<div>delta: <span id="delta"></span></div>
<div>fps: <span id="fps"></span></div>
<div><button onclick="toggle(this)">pause</button></div>
</div>
<script>
const DEBUG = true;
</script>
<script type="module">
import "./src/index.js";
window.toggle = function toggle(button) {
if (game.Running) {
game.Stop();
button.textContent = "resume";
} else {
game.Start();
button.textContent = "pause";
}
};
</script>
</body>