-
Notifications
You must be signed in to change notification settings - Fork 1
/
flashcard.html
395 lines (349 loc) · 19.4 KB
/
flashcard.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="stylesheet" href="./assets/css/flashcard.css">
<link rel="stylesheet" href="./assets/css/global.css">
<title>Game Hub</title>
</head>
<body>
<!-- navigation -->
<nav class="navbar navbar-expand-lg">
<div class="container-fluid">
<a class="navbar-brand" href="./index.html">ByteMe</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="./index.html">Quiz</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="./flashcard.html">Flashcard</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- card -->
<div class="container w-50 w-md-100 text-center mt-5">
<section class="flashcard-container">
<div class="row">
<div id="flashcard-settings" class="d-flex col col-md-2 col-xlg-2">
<!-- settings icon -->
<button id="f-settings" class="f-settings" type="button" data-bs-toggle="modal" data-bs-target="#settingsModal">
<i class="fas fa-cog px-2"></i>
</button>
<!-- instruction icon -->
<button id="f-instructions" class="f-instructions" type="button" data-bs-toggle="modal" data-bs-target="#instructionsModal">
<i class="fas fa-info-circle"></i>
</button>
</div>
<div id="flashcard-trophy" class="col col-md-8 col-xlg-8 header flashcard-trophy" title="Max Score">
<img src="./assets/svg/trophy.svg" alt="Icon represent max user score">
<span id="flashcard-trophy-num" class="flashcard-trophy-num"></span>
</div>
<div id="flashcard-exit" class="d-flex col col-md-2 col-xlg-2 exit">
<div class="ms-auto px-2"> ✖ </div>
</div>
</div>
<div id="flashcard-bar">
<div class="wrapper">
<div class="progress" id="progress"></div>
</div>
</div>
</section>
<section class="flashcard-card">
<div class="row">
<div class="col">
<!-- Flashcard -->
<div class="flashcard">
<!-- mobile keyboard -->
<div class="screen-keyboard" id="screen-keyboard">
<div class="guess-word" id="guess-word-top">
<!-- generated word goes here -->
</div>
<button class="keyboard" id="keyboard">
<i class="far fa-keyboard"></i>
</button>
<!-- Hidden input field -->
<input type="text" id="hiddenInput">
</div>
<div class="flashcard-inner">
<div class="flashcard-front">
<div class="row justify-content-center">
<div id="flashcard-hint" class="col col-md-3 col-lg-2 flashcard-hint">Hint</div>
<div class="col col-md-6 col-lg-8 d-flex justify-content-center">
<div class="flashcard-hears" id="flashcard-heart3">❤️</div>
<div class="flashcard-hears" id="flashcard-heart2">❤️</div>
<div class="flashcard-hears" id="flashcard-heart1">❤️</div>
</div>
<div id="flashcard-points" class="col col-md-3 col-lg-2 f-points"></div>
</div>
<!-- blink screen on error -->
<div id="flashcard-blink" class="flashcard-blink">
</div>
<!-- images -->
<img id="find-image" class="find-image" src="" alt="">
<!-- loadng bar -->
<div id="loading-container" class="loading-container">
<p class="loading-header">Loading...</p>
<div class="loading">
<div class="color"></div>
</div>
</div>
<!-- Image index -->
<div class="image-index">
<div class="d-flex justify-content-end">
<span id="flashcard-number" class="flashcard-number"></span>
</div>
</div>
<!-- end game message -->
<div class="end-game-container" id="end-game-container">
<div class="end-game-message">
<p id="end-game-message"></p>
<div id="end-game-buttons">
<button class="btn btn-modal" id="reset-game">Back to Menu</button>
</div>
</div>
</div>
<!-- messages middle screen -->
<div id="flashcard-msg" class="flashcard-msg">
</div>
<!-- messages bottom screen -->
<div id="flashcard-msg-bottom" class="flashcard-msg-bottom">
</div>
</div>
<!-- Hint -->
<div class="flashcard-back">
<p class="flashcard-back-hint" id="flashcard-back-hint">Hint</p>
</div>
<!-- Categories start screen -->
<div class="flashcard-start" id="flashcard-outer">
<div class="categories-container">
<p class="categories-pick">CHOOSE CATEGORY</p>
<div class="categories-ring"></div>
<div class="categories" id="categories">
<button class="category cat-active category1" data-cat="animals" title="animals">
<i class="fas fa-cat"></i>
</button>
<button class="category category2" data-cat="fruits" title="fruits">
<i class="fas fa-apple-alt"></i>
</button>
<button class="category category3" data-cat="countries" title="countries">
<i class="fas fa-globe-africa"></i>
</button>
<button class="category category4" data-cat="professions" title="professions">
<i class="fas fa-user-tie"></i>
</button>
<button class="category category5" data-cat="sports" title="sports">
<i class="fas fa-running"></i>
</button>
<button class="category category6" data-cat="clothing" title="clothing">
<i class="fas fa-tshirt"></i>
</button>
</div>
<!-- Start button -->
<button class="start-button" id="flashcard-start">
START
</button>
</div>
</div>
</div>
</div>
<div id="desktop">
<div class="guess-word" id="guess-word-bottom">
<!-- generated word goes here -->
</div>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- Settings Modal -->
<div class="modal fade" id="settingsModal" tabindex="-1" aria-labelledby="settingsModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="settingsModalLabel">Settings</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
<div class="setting-version">
<p>Version 1.0</p>
</div>
</div>
<div class="modal-body">
<div class="row">
<div class="col" id="settings">
<div class="setting-container">
<div class="row setting-apperance">
<p class="settings-header">Theme</p>
<div class="col">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="setting-appearance" id="setting-appearance-light" checked>
<label class="form-check-label" for="setting-appearance-light">
Light
</label>
</div>
</div>
<div class="col">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="setting-appearance" id="setting-appearance-dark">
<label class="form-check-label" for="setting-appearance-dark"">
Dark
</label>
</div>
</div>
</div>
</div>
<div class="setting-container">
<p class="settings-header settings-ls">Reset Data</p>
<button class="btn btn-danger" data-bs-target="#restoreModalToggle" data-bs-toggle="modal" title="Restore to default settings and remove all progress">Reset</button>
</div>
</div>
<div class="col">
<div class="setting-container">
<p class="settings-header">Notifications</p>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="setting-note" checked>
<label class="form-check-label" for="setting-note">Off/On</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button type="button" id="settings-save" class="btn btn-modal">Save</button>
</div>
</div>
</div>
</div>
</div>
<!-- Reset game settings -->
<div class="modal fade" id="restoreModalToggle" aria-hidden="true" aria-labelledby="restoreModalToggleLabel" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="restoreModalToggleLabel">Warning!</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Resetting data will erase all saved scores, completed categories and revert themes.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<button id="clear-storage" class="btn btn-modal" title="Restore to defaulr settings and all progress" data-bs-target="#restoreModalToggle" data-bs-toggle="modal">Confirm</button>
</div>
</div>
</div>
</div>
<!-- Final message -->
<div class="modal fade" id="finalMessage" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true" >
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header d-flex justify-content-center">
<h3 class="modal-title">Achievement Adventure Completed!</h3>
</div>
<div class="modal-body">
<div class="row">
<div class="col achievementUnlocked">
<h4>Congratulations, Word Wizard!</h4>
<p>You've mastered all categories in the Flashcard game!</p>
<p>Get ready for exciting future updates and adventures!</p>
<p>Follow us on social media for exclusive updates:</p>
<div class="social-media-icons">
<a href="https://twitter.com/MartinTatarski" target="_blank"><i class="fab fa-twitter icon-twitter"></i></a>
<a href="https://www.linkedin.com/in/marcin-tatarski/" target="_blank"><i class="fab fa-linkedin icon-linkedin"></i></a>
</div>
<div class="additional-info">
<p>Thank you for your dedication and skill in mastering the Flashcard game.</p>
<p>We appreciate your support and hope you continue enjoying the experience!</p>
</div>
</div>
<div class="col giphy">
<img id="giphy" src="" alt="">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" id="restart-game">Close</button>
</div>
</div>
</div>
</div>
<!-- Instructions modal -->
<div class="modal fade" id="instructionsModal" tabindex="-1" aria-labelledby="instructionsModalLabel" aria-hidden="true" >
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header d-flex justify-content-center">
<h3 class="modal-title">Flashcard Instructions</h3>
</div>
<div class="modal-body">
<h4 class="d-flex justify-content-center instruction-zoom">Zoom in on an image by clicking/tapping on it.</h4>
<div class="container-fluid">
<div class="row">
<div class="col-lg-6"><h5 class="instruction-head text-center">Main menu</h5></div>
<div class="col-lg-6"></div>
</div>
<div class="row">
<div class="col-lg-6">
<img class="instructions-img" id="main-img" src="" alt="">
</div>
<div class="col-lg-6">
<ul class="instruction-desc">
<li>1. <i>Settings</i> - Access game preferences and customize settings.</li>
<li>2. <i>Trophy</i> - Displays user's highest score.</li>
<li>3. <i>Exit</i> - Allows users to exit the game and return to the main menu.</li>
<li>4. <i>Progress Bar</i> - Represents user progress through the game</li>
<li>5. <i>Categories</i> - Select a category to guess words from multiple images.</li>
<li>6. <i>Notifications</i> - Displays short information about different parts of the layout. Can be disabled in the Settings area.</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-lg-6"><h5 class="instruction-head text-center">Gameplay</h5></div>
<div class="col-lg-6"></div>
</div>
<div class="row">
<div class="col-lg-6">
<img class="instructions-img" id="gameplay-img" src="" alt="">
</div>
<div class="col-lg-6">
<ul class="instruction-desc">
<li>7. <i>Hint Link</i> - Click to flip the flashcard and reveal a short description for the image.</li>
<li>8. <i>Hearts</i> - Represents the number of attempts remaining.</li>
<li>9. <i>Score</i> - Shows the current score for the ongoing game.</li>
<li>10. <i>Image Index</i> - Indicates the current image out of the total in the current category.</li>
<li>11. <i>Underscores</i> - Displays underscores representing the word to be guessed.</li>
<li>12. <i>Mobile</i> - Only visible for tablets/mobiles. Tap to trigger the off-screen keyboard <i class="far fa-keyboard"></i></li>
</ul>
</div>
</div>
</div>
</div>
<div class="modal-body resetInstructions">
<h5>Reset the Game</h5>
<p>If you wish to start the game anew:</p>
<ol>
<li>Go to the settings ⚙️ in the game.</li>
<li>Find the reset option under <strong>Local Storage</strong>.</li>
<li>Click on the <strong>Reset</strong> option to reset your game progress.</li>
</ol>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" id="game-instructions">Close</button>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js" integrity="sha256-lSjKY0/srUM9BE3dPm+c4fBo1dky2v27Gdjm2uoZaL0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script src="./assets/js/words.js"></script>
<script src="./assets/js/flashcard.js"></script>
</body>
</html>