-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
452 lines (425 loc) · 17.3 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Frontend Mentor | Tic Tac Toe</title>
<link rel="icon" type="image/png" sizes="32x32" href="assets/images/favicon/favicon-32x32.png">
<link rel="stylesheet" href="assets/css/main.css" />
<!-- fonts google -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@500;700&display=swap"
rel="stylesheet"
/>
</head>
<body class="body">
<!-- ##### START MENU ##### -->
<div class="start-menu">
<div class="start-menu__logo">
<svg class="start-menu__logo-svg">
<use href="#svg-logo"></use>
</svg>
</div>
<!-- sm player-tokens(pt)-->
<div class="game-tokens">
<span class="game-tokens__prompt"> PICK PLAYER 1's Token </span>
<div class="game-tokens__choices">
<div class="choice-token cross">
<svg class="choice-token__svg">
<use href="#svg-tokens--cross"></use>
</svg>
</div>
<div class="choice-token circle">
<svg class="choice-token__svg">
<use href="#svg-tokens--circle"></use>
</svg>
</div>
</div>
<span class="game-tokens__reminder">REMEMBER: X GOES FIRST</span>
<span class="game-tokens__alert">Players need to choose tokens!</span>
</div>
<!-- -->
<button class="btn btn--ng-pvc btn--sm">
<span class="btn__text">NEW GAME (VS CPU)</span>
</button>
<button class="btn btn--ng-pvp btn--sm">
<span class="btn__text">NEW GAME (VS PLAYER)</span>
</button>
</div>
<!-- ##### END OF START MENU ##### -->
<!-- ##### MAIN GAME ##### -->
<div class="main-game">
<div class="main-game__logo">
<svg class="main-game__logo-svg" viewBox="0 0 72 32">
<use href="#svg-logo"></use>
</svg>
</div>
<!-- # MG-1 Turn Indicator -->
<div class="turn-indicator">
<div class="turn-indicator__svg-wrapper">
<svg class="turn-indicator__svg">
<use class="turn-indicator__svg-link" href="#svg-indicator--cross"></use>
</svg>
<span class="turn-indicator__text">TURN</span>
</div>
</div>
<!-- # MG-1 End -->
<!-- # MG-2 Reset Button -->
<div class="btn-reset">
<div class="btn-reset__svg-wrapper">
<svg class="btn-reset__svg">
<use href="#svg-reset"></use>
</svg>
</div>
</div>
<!-- # MG-2 End -->
<!-- # MG-3 Play Field -->
<div id="cell-0" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-1" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-2" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-3" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-4" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-5" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-6" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-7" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<div id="cell-8" class="cell">
<div class="cell__svg">
<svg >
<use class="cell__svg-link" href=""></use>
</svg>
</div>
</div>
<!-- MG-3 End Play Field -->
<!-- MG-4 Scoreboards-->
<!-- MG-4-1 Cross -->
<div class="scoreboard scoreboard--cross">
<span class="scoreboard__label">
X <span id="owner-cross">(YOU)</span>
</span>
<span id="counter--cross" class="scoreboard__counter X">0</span>
</div>
<!-- -->
<!-- MG-4-2 Ties -->
<div class="scoreboard scoreboard--ties">
<span class="scoreboard__label">TIES</span>
<span id="counter--ties" class="scoreboard__counter tie">0</span>
</div>
<!-- -->
<!-- MG-4-3 Circle -->
<div class="scoreboard scoreboard--circle">
<span class="scoreboard__label">
O <span id="owner-circle">(CPU)</span>
</span>
<span id="counter--circle" class="scoreboard__counter O">0</span>
</div>
<!-- -->
<!-- MG-4-4 Settings -->
<div id="settings" class="btn-settings__wrapper">
<button class="btn-settings">
<span>Settings</span>
</button>
</div>
<!-- -->
</div>
<!-- MG-4 End Scoreboards -->
<!-- END of MAIN GAME -->
<!-- ##### START of MODALS ##### -->
<!-- Mod-1 Modal Base Result -->
<div class="modal-wrapper" id="modal-base-result">
<div class="modal-body modal-base">
<p id="variable-message" class="modal-base__winning-player">
YOU WON!
</p>
<p class="modal-base__winning-announcement">
<svg class="modal-base__svg" viewBox="0 0 66 66">
<use id="base-svg" href="#cross"></use>
</svg>
<span class="modal__generic-text modal-base__winning-text">TAKES THE ROUND</span>
</p>
<div class="modal__button-group">
<button class="btn--modal btn__quit-game">
<span class="btn__text--modal">QUIT</span>
</button>
<button class="btn--modal btn__next-round base">
<span class="btn__text--modal">NEXT ROUND</span>
</button>
</div>
</div>
</div>
<!-- Mod-2 Modal Tied Result -->
<div class="modal-wrapper" id="modal-tied-result">
<div class="modal-body modal-tied">
<p
class="modal__generic-text"
>
ROUND TIED
</p>
<div class="modal__button-group">
<button class="btn--modal btn__quit-game">
<span class="btn__text--modal">QUIT</span>
</button>
<button class="btn--modal btn__next-round tied">
<span class="btn__text--modal">NEXT ROUND</span>
</button>
</div>
</div>
</div>
<!-- Mod-3 Modal Settings -->
<div class="modal-wrapper" id="modal-settings">
<div class="modal-body modal-settings">
<span class="modal__generic-text modal-settings__header">Settings</span>
<!-- Mod-4-1 FX Slider -->
<div class="slider__wrapper">
<div id="label-fx-slider" class="slider__label">
<span>Sound Fx:</span>
<span id="sfx-value" class="slider__value">20</span>
</div>
</div>
<input type="range" id="sfx-slider" class="slider__input" min="1" max="100" value="20" autocomplete="off">
<!-- Mod-4-2 Music Slider -->
<div class="slider__wrapper">
<div id="label-music-slider" class="slider__label">
<span>Music:</span>
<span id="music-value" class="slider__value">5</span>
</div>
</div>
<input type="range" id="music-slider" class="slider__input" min="1" max="100" value="5" autocomplete="off">
<!-- Mod-4-3 FX Checkboxes -->
<div class="checkbox-group">
<div class="checkbox-wrapper">
<label for="sfx-checkbox">
Sound-Fx
<input type="checkbox" id="sfx-checkbox" class="checkbox__input" checked autocomplete="off">
</label>
</div>
<!-- -->
<div class="checkbox-wrapper">
<label for="music-checkbox">
Music
<input type="checkbox" id="music-checkbox" class="checkbox__input" checked autocomplete="off">
</label>
</div>
</div>
<!-- Mod-4-4 Save Btn -->
<button class="modal-settings__save-btn">
<span>Save</span>
</button>
</div>
</div>
<!-- Mod-4 Modal Reset -->
<div class="modal-wrapper" id="modal-reset">
<div class="modal-body modal-reset">
<span class="modal__generic-text modal-reset__prompt">Restart Game?</span>
<div class="modal__button-group">
<button class="btn--modal btn--affirmative">
<span class="btn__text--modal">Restart</span>
</button>
<button class="btn--modal btn--denied">
<span class="btn__text--modal">Continue</span>
</button>
</div>
</div>
</div>
<!-- Mod-5 Modal Coundown -->
<div class="modal-wrapper" id="modal-countdown">
<div class="modal-body modal-countdown">
<span class="modal__generic-text">
Restarting in ...
</span>
<span id="countdown">5</span>
</div>
</div>
<!-- Mod-6 Modal Restore -->
<div class="modal-wrapper" id="modal-restore-session">
<div class="modal-body modal-restore">
<span class="modal__generic-text modal-restore__prompt">Restore previous session?</span>
<div class="modal__button-group">
<button class="btn--modal btn--affirmative">
<span class="btn__text--modal">Restore</span>
</button>
<button class="btn--modal btn--denied">
<span class="btn__text--modal">New Session</span>
</button>
</div>
</div>
</div>
<!-- ##### END of MODALS ##### -->
<!-- start menu logo -->
<svg style="display: none">
<symbol id="svg-logo" viewBox="0 0 72 32">
<g fill="none" fill-rule="evenodd">
<path
d="M8.562 1.634 16 9.073l7.438-7.439a3 3 0 0 1 4.243 0l2.685 2.685a3 3 0 0 1 0 4.243L22.927 16l7.439 7.438a3 3 0 0 1 0 4.243l-2.685 2.685a3 3 0 0 1-4.243 0L16 22.927l-7.438 7.439a3 3 0 0 1-4.243 0L1.634 27.68a3 3 0 0 1 0-4.243L9.073 16 1.634 8.562a3 3 0 0 1 0-4.243L4.32 1.634a3 3 0 0 1 4.243 0Z"
fill="#31C3BD"
/>
<path
d="M56.1 0c8.765 0 15.87 7.106 15.87 15.87 0 8.766-7.105 15.871-15.87 15.871-8.765 0-15.87-7.105-15.87-15.87C40.23 7.106 47.334 0 56.1 0Zm0 9.405a6.466 6.466 0 1 0 0 12.931 6.466 6.466 0 0 0 0-12.931Z"
fill="#F2B137"
fill-rule="nonzero"
/>
</g>
</symbol>
</svg>
<!-- cross - start-menu token -->
<svg style="display: none">
<symbol id="svg-tokens--cross" viewBox="0 0 64 64">
<path
d="M15.002 1.147 32 18.145 48.998 1.147a3 3 0 0 1 4.243 0l9.612 9.612a3 3 0 0 1 0 4.243L45.855 32l16.998 16.998a3 3 0 0 1 0 4.243l-9.612 9.612a3 3 0 0 1-4.243 0L32 45.855 15.002 62.853a3 3 0 0 1-4.243 0L1.147 53.24a3 3 0 0 1 0-4.243L18.145 32 1.147 15.002a3 3 0 0 1 0-4.243l9.612-9.612a3 3 0 0 1 4.243 0Z"
fill-rule="evenodd"
/>
</symbol>
</svg>
<!-- circle - start-menu token -->
<svg style="display: none">
<symbol id="svg-tokens--circle" viewBox="0 0 64 64">
<path
d="M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0Zm0 18.963c-7.2 0-13.037 5.837-13.037 13.037 0 7.2 5.837 13.037 13.037 13.037 7.2 0 13.037-5.837 13.037-13.037 0-7.2-5.837-13.037-13.037-13.037Z"
/>
</symbol>
</svg>
<!--cross -->
<svg style="display: none">
<symbol id="cross">
<path
d="M15.002 1.147 32 18.145 48.998 1.147a3 3 0 0 1 4.243 0l9.612 9.612a3 3 0 0 1 0 4.243L45.855 32l16.998 16.998a3 3 0 0 1 0 4.243l-9.612 9.612a3 3 0 0 1-4.243 0L32 45.855 15.002 62.853a3 3 0 0 1-4.243 0L1.147 53.24a3 3 0 0 1 0-4.243L18.145 32 1.147 15.002a3 3 0 0 1 0-4.243l9.612-9.612a3 3 0 0 1 4.243 0Z"
fill="#31C3BD"
fill-rule="evenodd"
/>
</symbol>
</svg>
<!-- cross outline -->
<svg style="display: none">
<symbol id="cross--outline">
<path
d="M51.12 1.269c.511 0 1.023.195 1.414.586l9.611 9.611c.391.391.586.903.586 1.415s-.195 1.023-.586 1.414L44.441 32l17.704 17.705c.391.39.586.902.586 1.414 0 .512-.195 1.024-.586 1.415l-9.611 9.611c-.391.391-.903.586-1.415.586a1.994 1.994 0 0 1-1.414-.586L32 44.441 14.295 62.145c-.39.391-.902.586-1.414.586a1.994 1.994 0 0 1-1.415-.586l-9.611-9.611a1.994 1.994 0 0 1-.586-1.415c0-.512.195-1.023.586-1.414L19.559 32 1.855 14.295a1.994 1.994 0 0 1-.586-1.414c0-.512.195-1.024.586-1.415l9.611-9.611c.391-.391.903-.586 1.415-.586s1.023.195 1.414.586L32 19.559 49.705 1.855c.39-.391.902-.586 1.414-.586Z"
stroke="#31C3BD"
stroke-width="2"
fill="none"
/>
</symbol>
</svg>
<!--cross win -->
<svg style="display: none">
<symbol id="cross--win">
<path
d="M15.002 1.147 32 18.145 48.998 1.147a3 3 0 0 1 4.243 0l9.612 9.612a3 3 0 0 1 0 4.243L45.855 32l16.998 16.998a3 3 0 0 1 0 4.243l-9.612 9.612a3 3 0 0 1-4.243 0L32 45.855 15.002 62.853a3 3 0 0 1-4.243 0L1.147 53.24a3 3 0 0 1 0-4.243L18.145 32 1.147 15.002a3 3 0 0 1 0-4.243l9.612-9.612a3 3 0 0 1 4.243 0Z"
fill="#1A2A33"
fill-rule="evenodd"
/>
</symbol>
</svg>
<!-- circle -->
<svg style="display: none">
<symbol id="circle">
<path
d="M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0Zm0 18.963c-7.2 0-13.037 5.837-13.037 13.037 0 7.2 5.837 13.037 13.037 13.037 7.2 0 13.037-5.837 13.037-13.037 0-7.2-5.837-13.037-13.037-13.037Z"
fill="#F2B137"
/>
</symbol>
</svg>
<!-- circle outline -->
<svg style="display: none">
<symbol id="circle--outline">
<path
d="M33 1c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C15.327 65 1 50.673 1 33 1 15.327 15.327 1 33 1Zm0 18.963c-7.2 0-13.037 5.837-13.037 13.037 0 7.2 5.837 13.037 13.037 13.037 7.2 0 13.037-5.837 13.037-13.037 0-7.2-5.837-13.037-13.037-13.037Z"
stroke="#F2B137"
stroke-width="2"
fill="none"
/>
</symbol>
</svg>
<!-- circle wins -->
<svg style="display: none">
<symbol id="circle--win">
<path
d="M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0Zm0 18.963c-7.2 0-13.037 5.837-13.037 13.037 0 7.2 5.837 13.037 13.037 13.037 7.2 0 13.037-5.837 13.037-13.037 0-7.2-5.837-13.037-13.037-13.037Z"
fill="#1A2A33"
/>
</symbol>
</svg>
<!-- circle -- turn indicator svg -->
<svg style="display: none">
<symbol id="svg-indicator--circle" viewBox="0 -2 65 65">
<path
d="M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0Zm0 18.963c-7.2 0-13.037 5.837-13.037 13.037 0 7.2 5.837 13.037 13.037 13.037 7.2 0 13.037-5.837 13.037-13.037 0-7.2-5.837-13.037-13.037-13.037Z"
/>
</symbol>
</svg>
<!-- cross -- turn indicator svg -->
<svg style="display: none">
<symbol id="svg-indicator--cross" viewBox="0 0 66 66">
<path
d="M15.002 1.147 32 18.145 48.998 1.147a3 3 0 0 1 4.243 0l9.612 9.612a3 3 0 0 1 0 4.243L45.855 32l16.998 16.998a3 3 0 0 1 0 4.243l-9.612 9.612a3 3 0 0 1-4.243 0L32 45.855 15.002 62.853a3 3 0 0 1-4.243 0L1.147 53.24a3 3 0 0 1 0-4.243L18.145 32 1.147 15.002a3 3 0 0 1 0-4.243l9.612-9.612a3 3 0 0 1 4.243 0Z"
/>
</symbol>
</svg>
<!-- Reset svg -->
<svg style="display: none">
<symbol id="svg-reset" viewBox="0 0 20 20">
<path
d="M19.524 0h-1.88a.476.476 0 0 0-.476.499l.159 3.284A9.81 9.81 0 0 0 9.835.317C4.415.317-.004 4.743 0 10.167.004 15.597 4.406 20 9.835 20a9.796 9.796 0 0 0 6.59-2.536.476.476 0 0 0 .019-.692l-1.348-1.349a.476.476 0 0 0-.65-.022 6.976 6.976 0 0 1-9.85-.63 6.987 6.987 0 0 1 .63-9.857 6.976 6.976 0 0 1 10.403 1.348l-4.027-.193a.476.476 0 0 0-.498.476v1.881c0 .263.213.476.476.476h7.944A.476.476 0 0 0 20 8.426V.476A.476.476 0 0 0 19.524 0Z"
/>
</symbol>
</svg>
<!-- -->
<audio id="audio-bgm" class="music"src="./assets/audio/bgm.wav" ></audio>
<audio id="audio-generic-click" class="sound-fx" src="./assets/audio/generic-click.wav"></audio>
<audio id="audio-hover" class="sound-fx" src="./assets/audio/hover.wav"></audio>
<audio id="audio-lose" class="sound-fx" src="./assets/audio/lose.wav"></audio>
<audio id="audio-roll" class="sound-fx" src="./assets/audio/roll.wav"></audio>
<audio id="audio-select" class="sound-fx" src="./assets/audio/select.wav"></audio>
<audio id="audio-tie" class="sound-fx" src="./assets/audio/tie.wav"></audio>
<audio id="audio-win" class="sound-fx" src="./assets/audio/win.wav"></audio>
<script type="module" src="./assets/js/app.mjs"></script>
</body>
</html>