-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
100 lines (98 loc) · 2.57 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
95
96
97
98
99
100
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>snake text rs wasm</title>
<style>
body {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: 20px;
font-family: courier;
}
input {
width: 50px;
}
.dummy-button {
border: 2px solid black;
padding: 10px;
cursor: pointer;
font-weight: bold;
background-color: lightgray;
}
#play-pause {
margin-top: 20px;
}
#score-block {
margin-top: 20px;
}
.game-state {
position: absolute;
top: 40%;
border: 3px solid black;
padding: 30px;
font-size: 40px;
font-weight: bold;
}
#game-over {
color: red;
display: none;
}
#controls-info {
margin-bottom: 40px;
}
#controls-line-2 {
margin-top: 40px;
}
#button-left {
margin-right: 40px;
}
#button-right {
margin-left: 40px;
}
#gamepads {
margin-top: 30px;
display: none;
}
</style>
</head>
<body>
<div id="creation-bar">
Width: <input type="number" id="width">
Height: <input type="number" id="height">
Speed: <input type="number" id="speed">
<span id="create" class="dummy-button">Create !</span><!-- don't use button element to avoid issues with focus -->
</div>
<button id="play-pause"></button>
<div id="score-block">
<span>Score: </span><span id="score">0</span>,
<span>Speed: </span><span id="current-speed">0</span>
</div>
<pre id="snake-text-canvas"></pre>
<div class="game-state" id="game-over">Game Over</div>
<div class="game-state" id="pause">Pause</div>
<div id="controls-info">Use a,s,d,w to control snake, space to pause</div>
<div>
<span id="button-up" class="dummy-button">⬆</span>
</div>
<div id="controls-line-2">
<span id="button-left" class="dummy-button">⬅</span>
<span id="button-down" class="dummy-button">⬇</span>
<span id="button-right" class="dummy-button">➡</span>
</div>
<div id="gamepads">
🎮 Gamepads:
<ul id="gamepad-list">
</ul>
</div>
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
<script src="./bootstrap.js"></script>
</body>
</html>