-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
324 lines (310 loc) · 13.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Quiz App Version 1.65</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link rel="stylesheet" href="./dist/styles.css" />
</head>
<body>
<div id="app">
<main class="app__wrapper">
<!--* Header *-->
<header class="app__header" data-app-header>
<h2 class="header__title" data-app-heading>Javascript Quiz App 1.65</h2>
<nav class="header__actions">
<div class="app__information">
<i class="fa-solid fa-circle-info" data-app-information-toggle></i>
<span class="tag tag-blue">Information</span>
</div>
<div class="app__language">
<i class="fa-solid fa-language" data-app-language-toggle></i>
<span class="tag tag-green">Vietnamese</span>
</div>
<div class="app__theme">
<i class="fa-solid fa-moon" data-app-dark-theme-toggle></i>
<span class="tag tag-purple" data-app-dark-theme-label>Dark</span>
</div>
</nav>
</header>
<!--* Home *-->
<section class="app__home" data-app-home>
<p class="home__title--home">Welcome to the Quiz! 🐳</p>
<form data-form-home>
<div class=" form__group--home" data-form-group>
<label for="nickname" class=" form__label--home"
>Do you have a <span>🔥Cool Nickname🔥</span></label
>
<div class="flex-wrapper">
<input
id="nickname"
name="nickname"
type="text"
placeholder="Let's type your nickname..."
class="form__control--home"
autofocus
data-form-control-nickname
/>
<button class="form__submit btn btn-submit-home">
<i class="fa-solid fa-floppy-disk"></i>
Save
</button>
</div>
<span class="form__message" data-form-message></span>
</div>
</form>
<p class="home__description">
Press <span>continue button</span> to go forward.
<br />
Press <span>settings button</span> to go to game settings page.
<br />
Press <span>scores button</span> to see top players on the ⭐Leaderboard⭐.
</p>
</section>
<!--* Settings *-->
<section class="app__settings hide" data-app-settings>
<h3 class="form__heading">
<i class="fa-solid fa-screwdriver-wrench"></i>
Game Settings
<i class="fa-solid fa-sliders"></i>
</h3>
<form id="form__settings" class="form__wrapper" data-form-settings>
<!--* Amount *-->
<div class="form__group" data-form-group>
<div class="flex-wrapper">
<label for="amount" class="form__label">Amount of Questions</label>
<input
id="amount"
name="amount"
type="text"
value="5"
placeholder="Min is 5 and max is 20."
class="form__control"
data-form-control-amount
/>
</div>
<span class="form__message" data-form-message></span>
</div>
<!--* Difficulty *-->
<div class="form__group" data-form-group>
<div class="flex-wrapper">
<label for="difficulty" class="form__label">Difficulty</label>
<select
name="difficulty"
id="difficulty"
class="form__control custom-select text-center"
data-form-control-difficulty
>
<option value="">--- Difficulty ---</option>
<option value="easy">------ Easy ------</option>
<option value="medium" selected="selected">----- Medium -----</option>
<option disabled value="hard">------ Hard ------</option>
</select>
</div>
<span class="form__message" data-form-message></span>
</div>
<!--* Type *-->
<div class="form__group" data-form-group>
<div class="flex-wrapper">
<label for="type" class="form__label">Type</label>
<select
name="type"
id="type"
class="form__control custom-select text-center"
data-form-control-type
>
<option value="">------ Type ------</option>
<option value="multiple choice">- Multiple Choice -</option>
<option value="true / false">-- True / False --</option>
<option value="random" selected="selected">----- Random -----</option>
</select>
</div>
<span class="form__message" data-form-message></span>
</div>
<!--* Category *-->
<div class="form__group" data-form-group>
<label for="genre" class="form__label">Category</label>
<div class="genre__category flex flex-jc-sb flex-wrap">
<label class="genre__wrapper">
<input type="checkbox" id="animals" name="category" value="animals" checked data-form-control-category />
<span class="check-mark" id="animals"></span>
<label for="animals">Animals</label>
</label>
<label class="genre__wrapper">
<input type="checkbox" id="geography" name="category" value="geography" checked data-form-control-category />
<span class="check-mark" id="geography"></span>
<label for="geography">Geography</label>
</label>
<label class="genre__wrapper">
<input type="checkbox" id="sports" name="category" value="sports" disabled data-form-control-category />
<span class="check-mark" id="sports"></span>
<label for="sports">Sports</label>
</label>
<label class="genre__wrapper">
<input type="checkbox" id="food-drinks" name="category" value="food-drinks" disabled data-form-control-category />
<span class="check-mark" id="food-drinks"></span>
<label for="food-drinks">Food/Drinks</label>
</label>
<label class="genre__wrapper">
<input type="checkbox" id="science" name="category" value="science" checked data-form-control-category />
<span class="check-mark" id="science"></span>
<label for="science">Science</label>
</label>
<label class="genre__wrapper">
<input type="checkbox" id="it" name="category" value="it" checked data-form-control-category />
<span class="check-mark" id="it"></span>
<label for="it">IT</label>
</label>
<label class="genre__wrapper">
<input type="checkbox" id="music/books" name="category" value="music/books" disabled data-form-control-category />
<span class="check-mark" id="music/books"></span>
<label for="music/books">Music/Books</label>
</label>
<label class="genre__wrapper">
<input type="checkbox" id="general" name="category" value="general" checked data-form-control-category />
<span class="check-mark" id="math"></span>
<label for="general">General</label>
</label>
</div>
<span class="form__message" data-form-message></span>
</div>
</form>
</section>
<!--* Rules *-->
<section class="app__rules hide" data-app-rules>
<p class="rules__title">Rules of this Quiz</p>
<hr />
<div class="rules__list" data-rules-list></div>
<hr />
<form class="form__rules" data-form-rules>
<div class="form__group rules__decision" data-form-group>
<label for="rules__decision" class="form__label--rules">
Do you agree or disagree with the Rule above?
</label>
<input type="radio" name="decision" value="disagree" id="dot-1" data-form-control-rules />
<input type="radio" name="decision" value="agree" id="dot-2" data-form-control-rules />
<div class="decision__category">
<label for="dot-1">
<span class="dot one"></span>
<span class="gender__disagree">Disagree</span>
</label>
<label for="dot-2">
<span class="dot two"></span>
<span class="gender__agree">Agree</span>
</label>
</div>
<button class="form__submit btn btn-submit-rules">Submit</button>
<span class="form__message" data-form-message></span>
</div>
</form>
</section>
<!--* Questions *-->
<section class="app__questions hide" data-app-questions>
<div class="question__progress" data-question-progress></div>
<time class="question__timer" data-question-timer></time>
<p class="question__title" data-question-title></p>
<div class="question__answers" data-question-answers></div>
<div class="question__answers-progress" data-question-answers-progress></div>
</section>
<!--* Result *-->
<section class="app__result hide" data-app-result>
<h2 class="result__title" data-result-title>
<i class="fa-solid fa-graduation-cap"></i>
Quiz Result
</h2>
<p class="result__description" data-result-description></p>
<div class="result__table" data-result-table></div>
</section>
<!--* Leaderboard *-->
<section class="app__leaderboard mt-4 hide" data-app-leaderboard>
<h2 class="leaderboard__title" data-leaderboard-title>
<i class="fa-solid fa-star"></i><i class="fa-solid fa-star"></i>
Leaderboard
<i class="fa-solid fa-star"></i><i class="fa-solid fa-star"></i>
</h2>
<div class="leaderboard__table" data-leaderboard-table></div>
<p class="leaderboard__description" data-leaderboard-description></p>
</section>
<!--* Controls *-->
<section class="app__controls" data-app-controls>
<button class="btn btn-settings" data-btn-settings>
<i class="fa-solid fa-gears"></i>
Settings
</button>
<button form="form__settings" class="btn btn-submit-settings hide" data-btn-submit>
<i class="fa-solid fa-floppy-disk"></i>
Save
</button>
<button class="btn btn-continue" data-btn-continue>
<i class="fa-solid fa-angle-right"></i>
Continue
</button>
<button class="btn btn-back hide" data-btn-back>
<i class="fa-solid fa-angles-left"></i>
Back
</button>
<button class="btn btn-exit hide" data-btn-exit>
<i class="fa-solid fa-house"></i>
Exit
</button>
<button class="btn btn-start hide" data-btn-start>
<i class="fa-solid fa-play"></i>
Start
</button>
<button class="btn btn-next hide" data-btn-next>
<i class="fa-solid fa-angles-right"></i>
Next
</button>
<button class="btn btn-restart hide" data-btn-restart>
<i class="fa-solid fa-retweet"></i>
Restart
</button>
<button class="btn btn-save hide" data-btn-save>
<i class="fa-solid fa-floppy-disk"></i>
Save
</button>
<button class="btn btn-high-scores" data-btn-high-scores>
<i class="fa-solid fa-crown"></i>
Scores
</button>
</section>
<!--* Footer *-->
<footer class="app__footer">
<div class="footer__copyright">
Copyright © 2022 - Built with
<span>Vanilla</span>
<i class="fa-brands fa-js-square"></i>
by
<a href="https://github.com/anIcedAntFA" target="_blank">
<span><strong>ngockhoi96</strong></span>
</a>
</div>
<div class="footer__github-link">
Find an issue with this app?
<br />
<a
href="https://github.com/anIcedAntFA/quiz_app_version_1.2--vanillaJS"
target="_blank"
>
<span>Fix it on Github</span>
</a>
</div>
</footer>
</main>
<!--* Toasts *-->
<div id="toast" data-toast></div>
<!--* Modals *-->
<div id="modal" data-modal></div>
<script src="./src/js/global_variables.js"></script>
<script src="./src/js/data/dummy_data.js"></script>
<script type="module" src="./src/js/index.js"></script>
</body>
</html>