-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (54 loc) · 1.33 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Pathman</title>
<style>
html,
body {
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
/* background-color: rgb(20, 20, 20); */
background-color: black;
color: #333;
font-size: 16px;
line-height: 1.5;
overflow: hidden;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
display: flex;
flex-direction: column;
min-height: 100vh;
align-items: center;
justify-content: center;
}
canvas {
max-width: 90%;
margin: 0 auto;
}
@media (max-width: 768px) {
canvas {
max-width: 100%;
}
}
</style>
</head>
<body>
<canvas id="pathman"></canvas>
<script src="dist/bundle.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
const canvas = document.getElementById("pathman")
if (canvas) {
const game = Pathman(canvas)
game.run()
window.addEventListener("beforeunload", function () {
game.quit()
})
}
})
</script>
</body>
</html>