-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
188 lines (182 loc) · 5.86 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!-- OG - Facebook Tags -->
<meta
name="description"
content="A TypeScript re-write of the previous Snake game that I made."
/>
<meta name="author" content="Hasan Mothaffar" />
<meta
name="keywords"
content="snake, typescript, snake game, web application, game"
/>
<meta property="og:type" content="website" />
<meta
property="og:url"
content="https://github.com/HasanMothaffar/Snake-TS"
/>
<meta property="og:title" content="Snake-TS" />
<meta
property="og:description"
content="A TypeScript re-write of the previous Snake game that I made."
/>
<meta property="og:image" content="./snake-preview.jpg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image" />
<meta
property="twitter:url"
content="https://github.com/HasanMothaffar/Snake-TS"
/>
<meta
property="twitter:title"
content="Snake-TS"
/>
<meta
property="twitter:description"
content="A TypeScript re-write of the previous Snake game that I made."
/>
<meta property="twitter:image" content="./snake-preview.jpg">
<title>Snake-TS</title>
<!-- Favicons -->
<link rel="icon" href="./favicon-32.png" sizes="32x32" />
<link rel="icon" href="./favicon-76.png" sizes="76x76" />
<link rel="icon" href="./favicon-96.png" sizes="96x96" />
<link rel="icon" href="./favicon-128.png" sizes="128x128" />
<link href="./dist/app.css" rel="stylesheet" />
</head>
<body class="gradient">
<div><canvas id="snakeBoard" width="300" height="300"></canvas></div>
<div class="game-controls-container">
<button data-toggle="start">Start/Pause</button>
<button data-toggle="restart">Restart</button>
</div>
<div class="move-controls-container">
<div>
<button class="btn--open-modal">
Options
<svg
xmlns="http://www.w3.org/2000/svg"
width="19.455"
height="20"
viewBox="0 0 19.455 20"
>
<path
d="M857,3458.5a3.5,3.5,0,1,1,3.5-3.5A3.5,3.5,0,0,1,857,3458.5Zm7.43-2.52a6.9,6.9,0,0,0,0-1.96l2.11-1.65a.5.5,0,0,0,.12-.64l-2-3.46a.5.5,0,0,0-.609-.22l-2.491,1a7.281,7.281,0,0,0-1.69-.98l-.379-2.65A.487.487,0,0,0,859,3445h-4a.487.487,0,0,0-.489.42l-.381,2.65a7.661,7.661,0,0,0-1.689.98l-2.49-1a.489.489,0,0,0-.611.22l-2,3.46a.493.493,0,0,0,.12.64l2.111,1.65a6.79,6.79,0,0,0,0,1.96l-2.111,1.65a.5.5,0,0,0-.12.64l2,3.46a.5.5,0,0,0,.611.22l2.49-1a7.305,7.305,0,0,0,1.689.98l.381,2.65a.487.487,0,0,0,.489.42h4a.487.487,0,0,0,.491-.42l.379-2.65a7.648,7.648,0,0,0,1.69-.98l2.491,1a.487.487,0,0,0,.609-.22l2-3.46a.5.5,0,0,0-.12-.64Z"
transform="translate(-847.27 -3445)"
fill="#0D1C45"
/>
</svg>
</button>
</div>
<div class="game-state"></div>
<em class="start-label">Press space to start/pause the game 🐍</em>
<div class="score-container">
<span>Score: </span><span id="score">0 </span
><span class="score-animation">+1</span>
</div>
<div id="mobile-arrows">
<button class="btn--control" data-code="ArrowLeft">
<svg
xmlns="http://www.w3.org/2000/svg"
width="26.846"
height="26.828"
viewBox="0 0 26.846 26.828"
>
<path
d="M819.847,1153.414l-14.225,13.414-2.939-3.309,9.311-8.171H793l.123-3.9h18.869l-9.311-8.209,3.162-3.241Z"
transform="translate(819.847 1166.828) rotate(180)"
fill="#a3b5bf"
/>
</svg>
</button>
<button class="btn--control" data-code="ArrowUp">
<svg
xmlns="http://www.w3.org/2000/svg"
width="26.828"
height="26.846"
viewBox="0 0 26.828 26.846"
>
<path
d="M819.847,1153.414l-14.225,13.414-2.939-3.309,9.311-8.171H793l.123-3.9h18.869l-9.311-8.209,3.162-3.241Z"
transform="translate(-1140 819.847) rotate(-90)"
fill="#a3b5bf"
/>
</svg>
</button>
<button class="btn--control" data-code="ArrowDown">
<svg
xmlns="http://www.w3.org/2000/svg"
width="26.828"
height="26.846"
viewBox="0 0 26.828 26.846"
>
<path
d="M819.847,1153.414l-14.225,13.414-2.939-3.309,9.311-8.171H793l.123-3.9h18.869l-9.311-8.209,3.162-3.241Z"
transform="translate(1166.828 -793.001) rotate(90)"
fill="#a3b5bf"
/>
</svg>
</button>
<button class="btn--control" data-code="ArrowRight">
<svg
xmlns="http://www.w3.org/2000/svg"
width="26.846"
height="26.828"
viewBox="0 0 26.846 26.828"
>
<path
d="M819.847,1153.414l-14.225,13.414-2.939-3.309,9.311-8.171H793l.123-3.9h18.869l-9.311-8.209,3.162-3.241Z"
transform="translate(-793.001 -1140)"
fill="#a3b5bf"
/>
</svg>
</button>
</div>
</div>
<div class="options">
<button class="btn--close-modal">
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 10 10"
>
<path
d="M752,3779.007,750.993,3778,747,3781.993,743.007,3778,742,3779.007l3.993,3.993L742,3786.993l1.008,1.007,3.993-3.993,3.993,3.993,1.007-1.007L748.006,3783Z"
transform="translate(-741.999 -3778)"
fill="#0d1c45"
/>
</svg>
</button>
<div class="options__group">
<input
id="dark_mode_input"
name="dark_mode_input"
type="checkbox"
class="toggle"
autocomplete="off"
checked="checked"
/>
<label for="dark_mode_input">Dark Mode</label>
</div>
<div class="options__group">
<select
name="game-difficulty"
id="game-difficulty"
autocomplete="off"
>
<option value="300">Easy</option>
<option value="200">Medium</option>
<option value="100">Hard</option>
<option value="50">HARDCORE</option>
</select>
<label for="game-difficulty">Difficulty</label>
</div>
</div>
<script src="./dist/app.js"></script>
</body>
</html>