generated from piesku/goodluck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
64 lines (62 loc) · 1.7 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
<!DOCTYPE html>
<meta charset="utf8" />
<meta name="viewport" content="width=device-width, user-scalable=0" />
<meta name="monetization" content="$ilp.uphold.com/QgQz4P8FygUZ" />
<title>Mirrorisk (DEBUG)</title>
<link rel="stylesheet" href="./play/game.css" />
<link rel="stylesheet" href="https://unpkg.com/xp.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>
<canvas id="billboard"></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 {loop_start, loop_stop} from "./src/impl.js";
import "./src/index.js";
let running = true;
window.toggle = function toggle(button) {
if (running) {
running = false;
loop_stop();
button.textContent = "resume";
} else {
running = true;
loop_start(game);
button.textContent = "pause";
}
};
</script>
</body>