generated from Code-Institute-Org/gitpod-full-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
206 lines (198 loc) · 6.65 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="description" content="Canvas snake game built with JavaScript featuring HammerJS and HowlerJS">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=1.0" />
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-icon-180x180.png" />
<link rel="icon"type="image/png" sizes="192x192" href="assets/favicon/android-icon-192x192.png" />
<link rel="icon" type="image/png" sizes="96x96" href="assets/favicon/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon/favicon-16x16.png" />
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@600&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="assets/css/style.css" type="text/css" />
<title>Cyber Snake</title>
</head>
<body>
<!-- Game container -->
<div id="game-container" class="avoid-clicks">
<!-- NB all data fields are manipulated by game.setElementStyle() -->
<!-- Headings -->
<div
id="instructions-heading"
class="menu-heading-container"
data-show-on-state="MAIN"
data-hide-on-state="PLAY PAUSE OPTIONS GAMEOVER"
>
<h1>Cyber Snake</h1>
</div>
<div
id="scores-heading"
class="menu-heading-container hidden"
data-show-on-state="GAMEOVER"
data-hide-on-state="PLAY PAUSE OPTIONS MAIN"
>
<h1>Score Board</h1>
</div>
<div
id="options-heading"
class="menu-heading-container hidden"
data-show-on-state="OPTIONS PAUSE"
data-hide-on-state="PLAY MAIN GAMEOVER"
>
<h1>Options</h1>
</div>
<!-- Instructions -->
<div
id="instructions-container"
class="menu-content-container"
data-show-on-state="MAIN"
data-hide-on-state="PLAY PAUSE OPTIONS GAMEOVER"
>
<p>
Use the <span class="desktop-controls-text">ARROW keys</span> or
<span class="mobile-controls-text">SWIPE</span> anywhere to change
direction
</p>
<p>
Press <span class="desktop-controls-text">SPACE</span> or
<span class="mobile-controls-text">TWO-FINGER TAP</span> to pause
</p>
<p>
The more you eat, the bigger you grow and the
<span class="special-menu-text">messier</span> things become
</p>
<p>Don't eat yourself</p>
</div>
<!-- Scores -->
<div
id="scores-container"
class="menu-content-container hidden"
data-show-on-state="GAMEOVER"
data-hide-on-state="PLAY PAUSE OPTIONS MAIN"
>
<p id="scores-award-text">
You haven't achieved anything yet. Once you do, your top 5 scores of
the session will be displayed here.
</p>
<div id="session-scores-container" class="hidden" data-show-on-state="PLAY">
<ol></ol>
</div>
</div>
<!-- Options -->
<div
id="options-container"
class="menu-content-container hidden"
data-show-on-state="OPTIONS PAUSE"
data-hide-on-state="PLAY MAIN GAMEOVER"
>
<div id="checkbox-container">
<label class="options-choice-button" for="audio-checkbox">
<input id="audio-checkbox" type="checkbox" checked />
<span>Sound</span>
</label>
<label class="options-choice-button" for="walls-checkbox">
<input
id="walls-checkbox"
type="checkbox"
data-enable-on-state="OPTIONS"
data-disable-on-state="PAUSE"
/>
<span>Walls</span>
</label>
</div>
<div id="radio-container">
<label class="options-choice-button" for="slow-radio">
<input
id="slow-radio"
type="radio"
name="difficulty"
data-enable-on-state="OPTIONS"
data-disable-on-state="PAUSE"
/>
<span>Slow</span>
</label>
<label class="options-choice-button" for="medium-radio">
<input
id="medium-radio"
type="radio"
name="difficulty"
data-enable-on-state="OPTIONS"
data-disable-on-state="PAUSE"
checked
/>
<span>Medium</span>
</label>
<label class="options-choice-button" for="fast-radio">
<input
id="fast-radio"
type="radio"
name="difficulty"
data-enable-on-state="OPTIONS"
data-disable-on-state="PAUSE"
/>
<span>Fast</span>
</label>
</div>
</div>
<!-- Menu buttons -->
<div id="menu-buttons-container">
<button
id="play-button"
class="button"
data-show-on-state="MAIN OPTIONS GAMEOVER"
data-hide-on-state="PLAY PAUSE"
>
Play
</button>
<button
id="resume-button"
class="button hidden"
data-show-on-state="PAUSE"
data-hide-on-state="PLAY MAIN OPTIONS GAMEOVER"
>
Resume
</button>
<button
id="options-button"
class="button"
data-show-on-state="MAIN GAMEOVER"
data-hide-on-state="PLAY PAUSE OPTIONS"
>
Options
</button>
<button
id="main-button"
class="button hidden"
data-show-on-state="OPTIONS GAMEOVER"
data-hide-on-state="PLAY PAUSE MAIN"
>
Main
</button>
<button
id="scores-button"
class="button"
data-show-on-state="MAIN OPTIONS"
data-hide-on-state="PLAY PAUSE GAMEOVER"
>
Scores
</button>
</div>
</div>
<!-- Canvas -->
<canvas
id="canvas"
class="hidden paused-effect"
data-show-on-state="PLAY"
data-blur-on-state="PAUSE MAIN OPTIONS GAMEOVER"
data-unblur-on-state="PLAY"
></canvas>
<!-- Scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.0/howler.min.js"></script>
<script src="assets/js/script.js"></script>
<script src="assets/js/scoreboard.js"></script>
</body>
</html>