generated from piesku/goodluck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
93 lines (87 loc) · 2.15 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
<!DOCTYPE html>
<meta charset="utf8" />
<title>Time Is Money™ 1.0</title>
<meta name="monetization" content="$coil.xrptipbot.com/3lcUCVS5Rm-e6Ch_O7vpQA" />
<link rel="stylesheet" href="./node_modules/98.css/dist/98.css" />
<style>
html,
body {
margin: 0;
}
canvas,
main {
position: absolute;
width: 100vw;
height: 100vh;
user-select: none;
-webkit-user-select: none;
overflow: auto;
}
#debug {
display: flex;
flex-flow: column nowrap;
align-items: flex-end;
position: absolute;
bottom: 0;
right: 0;
color: #fff;
font-family: monospace;
}
#debug button {
cursor: pointer;
padding: 0;
background: none;
border: none;
font: inherit;
color: inherit;
box-shadow: none;
min-width: auto;
min-height: auto;
}
#debug div {
width: max-content;
background: #000;
color: #fff;
}
.field-row {
flex: 1;
}
progress[value] {
background-color: #fff;
border: 1px inset #dfdfdf;
width: 100%;
height: 15px;
}
progress[value]::-webkit-progress-bar {
background-color: #fff;
}
progress[value]::-webkit-progress-value {
background-color: #00007f;
}
</style>
<body>
<canvas></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 type="module">
import {loop_start, loop_stop} from "./src/core.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>