-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.html
218 lines (212 loc) · 6.01 KB
/
setup.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Snake game UniPV</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet" />
<link rel="stylesheet" href="setup.css" />
</head>
<body class="text-light" style="background-color: #212121">
<!-- Title bar -->
<nav
class="navbar navbar-expand-lg navbar-dark navbar-shadow"
style="background-color: #292929">
<div class="container d-flex justify-content-center align-items-center">
<p class="custom-navbar-text mb-0">SNAKE GAME ON DIFFERENT TOPOLOGY</p>
</div>
</nav>
<!-- Main content -->
<main class="container my-5" style="background-color: #212121">
<form id="setupForm">
<div class="row">
<div class="col-lg-5" style="margin-right: 20px">
<h2
class="mb-4"
style="
text-decoration-line: underline;
text-underline-offset: 6px;
">
Customize Your Snake Game
</h2>
<!-- Width selection -->
<div class="mb-3">
<label for="width" class="form-label">Width:</label>
<input
type="number"
id="width"
class="form-control"
min="1"
max="1000"
value="500"
required />
</div>
<!-- Height selection -->
<div class="mb-3">
<label for="height" class="form-label">Height:</label>
<input
type="number"
id="height"
class="form-control"
min="1"
max="1000"
value="500"
required />
</div>
<!-- Scale selection -->
<div class="mb-3">
<label for="scale" class="form-label">Scale:</label>
<input
type="number"
id="scale"
class="form-control"
min="1"
max="1000"
value="50"
required />
</div>
<!-- Topology selection -->
<p class="form-label mt-3">Select topology:</p>
<!-- square -->
<div class="mb-3">
<label
class="form-check custom-radio d-flex align-items-center px-3"
style="cursor: pointer">
<input
class="form-check-input"
id="square"
type="radio"
name="topology"
value="square"
required />
<span class="ms-2">Square</span>
</label>
</div>
<!-- cylinder -->
<div class="mb-3">
<label
class="form-check custom-radio d-flex align-items-center px-3"
style="cursor: pointer">
<input
class="form-check-input"
id="cylinder"
type="radio"
name="topology"
value="cylinder"
required />
<span class="ms-2">Cylinder</span>
</label>
</div>
<!-- moebius -->
<div class="mb-3">
<label
class="form-check custom-radio d-flex align-items-center px-3"
style="cursor: pointer">
<input
class="form-check-input"
id="moebius"
type="radio"
name="topology"
value="moebius"
required />
<span class="ms-2">Moebius strip</span>
</label>
</div>
<!-- torus -->
<div class="mb-3">
<label
class="form-check custom-radio d-flex align-items-center px-3"
style="cursor: pointer">
<input
class="form-check-input"
id="torus"
type="radio"
name="topology"
value="torus"
required />
<span class="ms-2">Torus</span>
</label>
</div>
<!-- klein -->
<div class="mb-3">
<label
class="form-check custom-radio d-flex align-items-center px-3"
style="cursor: pointer">
<input
class="form-check-input"
id="klein"
type="radio"
name="topology"
value="klein"
required />
<span class="ms-2">Klein bottle</span>
</label>
</div>
</div>
<!-- Game Preview -->
<div class="col-lg-6 mt-4 mt-lg-0">
<div class="game-preview p-4 rounded">
<h2 class="mb-3">Game Preview</h2>
<div
id="preview-area"
class="bg-light rounded"
style="height: 350px">
<img
src="./gamePreview.png"
alt="Game Preview Image"
style="
width: 100%;
height: 100%;
background-color: #292929;
" />
</div>
</div>
<!-- Button to start and reset the game -->
<div class="row justify-content-around">
<div class="col-auto">
<button type="submit" class="btn btn-primary">
Start Game
</button>
</div>
<div id="resetButton" class="col-auto" style="display: none">
<button
type="reset"
class="btn btn-primary"
style="background-color: #ff5370; border-color: #ff5370">
Reset
</button>
</div>
</div>
<script async src="setup.js"></script>
</div>
</div>
</form>
</main>
<!-- Footer bar -->
<footer
class="text-light py-2 fixed-bottom footer-shadow"
style="background-color: #292929">
<div class="container text-center">
<p class="mb-0 custom-footer-text">
© 2024 Dipartimento di Matematica, Felice Casorati
</p>
</div>
</footer>
<!-- Function to toggle the reset button -->
<script>
document.addEventListener("keydown", function (event) {
if (event.code === "KeyR") {
const resetButton = document.getElementById("resetButton");
if (resetButton.style.display === "none") {
resetButton.style.display = "block";
} else {
resetButton.style.display = "none";
}
}
});
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>