-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
347 lines (334 loc) · 13.2 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>True or False</title>
<link rel="stylesheet" href="css/reset.min.css" />
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="preloader">
<div class="preloader__wrapper">
<div class="preloader__ball preloader__ball_one">
<div class="preloader__ball-inner"></div>
</div>
<div class="preloader__ball preloader__ball_two">
<div class="preloader__ball-inner"></div>
</div>
<div class="preloader__ball preloader__ball_three">
<div class="preloader__ball-inner"></div>
</div>
<div class="preloader__ball preloader__ball_four">
<div class="preloader__ball-inner"></div>
</div>
<div class="preloader__ball preloader__ball_five">
<div class="preloader__ball-inner"></div>
</div>
<div class="preloader__ball preloader__ball_six">
<div class="preloader__ball-inner"></div>
</div>
<div class="preloader__ball preloader__ball_center">
<div class="preloader__ball-inner preloader__ball-inner_center"></div>
</div>
</div>
</div>
<div class="game">
<div class="game__wrapper">
<div class="levels-list" v-show="levels">
<h2 class="levels-title">
Уровни
<span class="stars-amount">
{{ stars.reduce((acc, e) => acc + e, 0)}}/{{ stars.length * 3 }}
<img src="images/star.svg" width="40px" height="40px" />
</span>
</h2>
<div
class="level"
v-for="(j, i) in numOfLevels"
@click="startLevel(i)"
>
<div class="level__num">
{{ j }}
<div
class="level__lock"
v-show="i !== 0 && stars[i-1] === 0"
></div>
</div>
<div class="stars">
<div
class="star"
:class="[stars[i] > 0 ? '' : 'star_black']"
></div>
<div
class="star"
:class="[stars[i] > 1 ? '' : 'star_black']"
></div>
<div
class="star"
:class="[stars[i] > 2 ? '' : 'star_black']"
></div>
</div>
</div>
</div>
<div class="game__content" v-show="content">
<div class="header">
<div class="progress-bar">
<div
class="progress-bar__label"
:style="`left: ${numOfQuestions * 10}%`"
>
<span>{{ numOfQuestions }}/10</span>
</div>
<div
class="progress-bar__bar"
:style="`width: ${numOfQuestions * 10}%`"
></div>
</div>
<div class="header__lvl">Уровень {{ levelNum + 1 }}</div>
<div class="timer" style="position: relative" v-if="!isAnswerGiven">
<span class="timer__time">{{ timer }}</span>
<svg
width="100"
viewBox="0 0 100 100"
xmlns="http://www.w3.org/2000/svg"
class="timer__icon"
>
<g transform="translate(50,50)">
<circle r="40" class="timer__icon-base"></circle>
<g transform="rotate(-90)">
<circle r="40" class="timer__icon-progress"></circle>
<g class="timer__icon-pointer">
<circle cx="40" cy="0" r="5" fill="#2196f3"></circle>
</g>
</g>
</g>
</svg>
</div>
<div class="hearts">
<div
class="heart"
:class="[hearts > 0 ? '' : 'heart_hide']"
></div>
<div
class="heart"
:class="[hearts > 1 ? '' : 'heart_hide']"
></div>
<div
class="heart"
:class="[hearts > 2 ? '' : 'heart_hide']"
></div>
</div>
</div>
<div class="question-wrap" v-show="!endGame">
<div class="question">
<div
class="question-answer question-answer_success"
v-if="isAnswerGiven && result == 1 && !endGame"
>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 455 455"
style="enable-background:new 0 0 455 455;"
xml:space="preserve"
>
<path
d="M227.5,0C101.855,0,0,101.855,0,227.5S101.855,455,227.5,455S455,353.145,455,227.5S353.145,0,227.5,0z M303.514,146.486 c19.33,0,35,15.67,35,35s-15.67,35-35,35c-19.33,0-35-15.67-35-35S284.184,146.486,303.514,146.486z M151.486,146.486 c19.33,0,35,15.67,35,35s-15.67,35-35,35c-19.33,0-35-15.67-35-35S132.156,146.486,151.486,146.486z M227.5,370 c-59.42,0-113.171-37.504-133.752-93.325l28.148-10.378C138.15,310.381,180.589,340,227.5,340s89.35-29.619,105.604-73.703 l28.148,10.378C340.671,332.496,286.92,370,227.5,370z"
/>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
</svg>
</div>
<div
class="question-answer question-answer_danger"
v-if="isAnswerGiven && result == 0 && !endGame"
>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 455 455"
style="enable-background:new 0 0 455 455;"
xml:space="preserve"
>
<path
d="M227.5,0C101.855,0,0,101.855,0,227.5S101.855,455,227.5,455S455,353.145,455,227.5S353.145,0,227.5,0z M303.514,146.486 c19.33,0,35,15.67,35,35s-15.67,35-35,35c-19.33,0-35-15.67-35-35S284.184,146.486,303.514,146.486z M151.486,146.486 c19.33,0,35,15.67,35,35s-15.67,35-35,35c-19.33,0-35-15.67-35-35S132.156,146.486,151.486,146.486z M227.5,370 c-59.42,0-113.171-37.504-133.752-93.325l28.148-10.378C138.15,310.381,180.589,340,227.5,340s89.35-29.619,105.604-73.703 l28.148,10.378C340.671,332.496,286.92,370,227.5,370z"
/>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
</svg>
</div>
<div
class="question-answer question-answer_time_out"
v-show="isAnswerGiven && result == 2"
>
<span class="mb-2">Время вышло</span>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="Layer_1"
x="0px"
y="0px"
viewBox="0 0 330 330"
style="enable-background:new 0 0 330 330;"
xml:space="preserve"
>
<path
id="XMLID_23_"
d="M165,0C74.019,0,0,74.019,0,165s74.019,165,165,165c90.982,0,165-74.019,165-165S255.982,0,165,0z M81,133 c0-5.26,2.14-10.42,5.859-14.141C90.58,115.14,95.73,113,101,113c5.26,0,10.42,2.14,14.14,5.859C118.869,122.58,121,127.74,121,133 c0,5.26-2.131,10.42-5.86,14.14c-3.72,3.72-8.88,5.86-14.14,5.86c-5.26,0-10.42-2.141-14.141-5.86C83.14,143.42,81,138.26,81,133z M226.518,226.518c-5.857,5.857-15.355,5.857-21.213,0c-10.767-10.766-25.08-16.694-40.305-16.694 c-15.227,0-29.539,5.929-40.306,16.694c-2.929,2.929-6.768,4.394-10.606,4.394s-7.678-1.465-10.607-4.394 c-5.858-5.857-5.858-15.355-0.001-21.213c16.432-16.432,38.281-25.482,61.519-25.482c0.001,0-0.001,0,0.001,0 c23.238,0,45.086,9.05,61.518,25.482C232.375,211.162,232.375,220.66,226.518,226.518z M243.14,147.14 c-3.72,3.72-8.88,5.86-14.14,5.86c-5.26,0-10.42-2.141-14.141-5.86C211.13,143.42,209,138.26,209,133 c0-5.26,2.13-10.42,5.859-14.141C218.58,115.14,223.73,113,229,113c5.26,0,10.42,2.14,14.14,5.859 c3.73,3.721,5.86,8.881,5.86,14.141C249,138.26,246.869,143.42,243.14,147.14z"
/>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
</svg>
</div>
<p>
{{ question }}
</p>
</div>
</div>
<footer class="footer">
<div class="buttons">
<div
class="yes"
v-show="!isAnswerGiven && !endGame"
@click="giveAnswer(true)"
>
Правда
</div>
<button
class="btn btn_with_icon"
v-if="isAnswerGiven && !endGame"
@click="getQuestion()"
>
<span class="btn__text">
Далее
</span>
<svg
class="btn__icon"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
width="268.832px"
height="268.832px"
viewBox="0 0 268.832 268.832"
style="enable-background:new 0 0 268.832 268.832;"
xml:space="preserve"
>
<g>
<path
d="M265.171,125.577l-80-80c-4.881-4.881-12.797-4.881-17.678,0c-4.882,4.882-4.882,12.796,0,17.678l58.661,58.661H12.5 c-6.903,0-12.5,5.597-12.5,12.5c0,6.902,5.597,12.5,12.5,12.5h213.654l-58.659,58.661c-4.882,4.882-4.882,12.796,0,17.678 c2.44,2.439,5.64,3.661,8.839,3.661s6.398-1.222,8.839-3.661l79.998-80C270.053,138.373,270.053,130.459,265.171,125.577z"
/>
</g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
<g></g>
</svg>
</button>
<div
class="no"
@click="giveAnswer(false)"
v-show="!isAnswerGiven && !endGame"
>
Ложь
</div>
</div>
</footer>
<div class="result" v-if="endGame">
<p class="result__given-answers mb-2">
Правильных ответов: {{ this.rightAnswers }}/10
</p>
<div class="stars mb-2">
<div
class="star"
:class="givenStars > 0 ? '': 'star_black'"
></div>
<div
class="star"
:class="givenStars > 1 ? '': 'star_black'"
></div>
<div
class="star"
:class="givenStars > 2 ? '': 'star_black'"
></div>
</div>
<p class="mb-1" v-if="gameResult === 0">
К сожалению, вы не набрали минимального количества верных ответов
</p>
<p class="mb-1" v-if="gameResult === 1">
Переходите к следующему уровню!
</p>
<p class="mb-1" v-else>Попробуйте снова!</p>
<button class="btn" @click="returnMenu" v-show="endGame">
Вернуться к уровням
</button>
</div>
</div>
</div>
</div>
<script src="js/vue.min.js"></script>
<script src="js/index.js"></script>
</body>
</html>