-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
226 lines (215 loc) · 6.66 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>
Parejas
</title>
<link
rel="shortcut icon"
type="image/x-icon"
href="assets/images/favicon.ico"
/>
<link rel="stylesheet" href="assets/css/styles.css" />
</head>
<body>
<div id="app" v-cloak>
<div class="page-content">
<div class="current-date-time">
<time :datetime="`${currentDateTime.date}`">
{{ currentDateTime.date }}
</time>
<time :datetime="`${currentDateTime.time}`">
{{ currentDateTime.time }}
</time>
</div>
<img
class="logo-pokemon"
src="assets/images/logo-pokemon.svg"
alt=""
/>
<h1 class="page-title">
El juego de las parejas
</h1>
<form class="game-options">
<label for="gameOption1" class="game-options__label">
<input
id="gameOption1"
class="game-options__input"
type="radio"
value="4"
v-model="gameData.changed.selectedDeck"
/>
<svg width="20px" height="20px" viewBox="0 0 20 20">
<circle cx="10" cy="10" r="9"></circle>
<path
d="M10,7 C8.34314575,7 7,8.34314575 7,10 C7,11.6568542 8.34314575,13 10,13 C11.6568542,13 13,11.6568542 13,10 C13,8.34314575 11.6568542,7 10,7 Z"
class="inner"
></path>
<path
d="M10,1 L10,1 L10,1 C14.9705627,1 19,5.02943725 19,10 L19,10 L19,10 C19,14.9705627 14.9705627,19 10,19 L10,19 L10,19 C5.02943725,19 1,14.9705627 1,10 L1,10 L1,10 C1,5.02943725 5.02943725,1 10,1 L10,1 Z"
class="outer"
></path>
</svg>
<span class="game-options__text">
4
</span>
</label>
<label for="gameOption2" class="game-options__label">
<input
id="gameOption2"
class="game-options__input"
type="radio"
value="6"
v-model="gameData.changed.selectedDeck"
/>
<svg width="20px" height="20px" viewBox="0 0 20 20">
<circle cx="10" cy="10" r="9"></circle>
<path
d="M10,7 C8.34314575,7 7,8.34314575 7,10 C7,11.6568542 8.34314575,13 10,13 C11.6568542,13 13,11.6568542 13,10 C13,8.34314575 11.6568542,7 10,7 Z"
class="inner"
></path>
<path
d="M10,1 L10,1 L10,1 C14.9705627,1 19,5.02943725 19,10 L19,10 L19,10 C19,14.9705627 14.9705627,19 10,19 L10,19 L10,19 C5.02943725,19 1,14.9705627 1,10 L1,10 L1,10 C1,5.02943725 5.02943725,1 10,1 L10,1 Z"
class="outer"
></path>
</svg>
<span class="game-options__text">
6
</span>
</label>
<label for="gameOption3" class="game-options__label">
<input
id="gameOption3"
class="game-options__input"
type="radio"
value="8"
v-model="gameData.changed.selectedDeck"
/>
<svg width="20px" height="20px" viewBox="0 0 20 20">
<circle cx="10" cy="10" r="9"></circle>
<path
d="M10,7 C8.34314575,7 7,8.34314575 7,10 C7,11.6568542 8.34314575,13 10,13 C11.6568542,13 13,11.6568542 13,10 C13,8.34314575 11.6568542,7 10,7 Z"
class="inner"
></path>
<path
d="M10,1 L10,1 L10,1 C14.9705627,1 19,5.02943725 19,10 L19,10 L19,10 C19,14.9705627 14.9705627,19 10,19 L10,19 L10,19 C5.02943725,19 1,14.9705627 1,10 L1,10 L1,10 C1,5.02943725 5.02943725,1 10,1 L10,1 Z"
class="outer"
></path>
</svg>
<span class="game-options__text">
8
</span>
</label>
<label for="gameOption4" class="game-options__label">
<input
id="gameOption4"
class="game-options__input"
type="radio"
value="10"
v-model="gameData.changed.selectedDeck"
/>
<svg width="20px" height="20px" viewBox="0 0 20 20">
<circle cx="10" cy="10" r="9"></circle>
<path
d="M10,7 C8.34314575,7 7,8.34314575 7,10 C7,11.6568542 8.34314575,13 10,13 C11.6568542,13 13,11.6568542 13,10 C13,8.34314575 11.6568542,7 10,7 Z"
class="inner"
></path>
<path
d="M10,1 L10,1 L10,1 C14.9705627,1 19,5.02943725 19,10 L19,10 L19,10 C19,14.9705627 14.9705627,19 10,19 L10,19 L10,19 C5.02943725,19 1,14.9705627 1,10 L1,10 L1,10 C1,5.02943725 5.02943725,1 10,1 L10,1 Z"
class="outer"
></path>
</svg>
<span class="game-options__text">
10
</span>
</label>
</form>
<div class="game-data">
<p class="game-data__item game-data__attempts">
Intentos: {{ gameData.changed.attempts }}
</p>
<p class="game-data__item game-data__fails">
Fallos: {{ gameData.changed.fails }}
</p>
<p
v-if="gameData.changed.difficult"
class="game-data__item game-data__opportunities"
:class="{'game-data__opportunities--error': gameData.changed.opportunities.last}"
>
Oportunidades: {{ gameData.changed.opportunities.number }}
</p>
<button
v-if="gameData.changed.selectedDeck > 8"
class="button button--color"
:disabled="counter.disabled"
@click="setCounter"
>
<span
v-if="counter.init"
class="game-data__item game-data__counter"
>
{{ counter.changed }}
</span>
<span v-else>
Iniciar contador
</span>
</button>
</div>
<ul
class="game-list-cards"
:class="{'game-list-cards--8': (gameData.changed.selectedDeck == 8), 'game-list-cards--10': (gameData.changed.selectedDeck > 8)}"
>
<li
v-for="card in cards"
:key="card.image"
@click="selectCard(card)"
:class="{'is-covered': coveredCards.includes(card), 'is-uncovered': uncoveredCards.includes(card)}"
class="game-card"
>
<div class="game-card__face game-card-front">
<h3 class="game-card-front__name">
{{ card.name }}
</h3>
<img
:src="card.image"
class="game-card-front__image"
/>
</div>
<div class="game-card__face game-card-back">
<div class="game-card-back__inner">?</div>
</div>
</li>
</ul>
<button
@click="resetGame"
v-if="gameResult.finish"
class="button button--game"
>
Jugar de nuevo
</button>
<transition name="slide-down-up">
<div
v-if="gameResult.win"
class="game-result game-result--win"
>
¡Bien hecho!
</div>
</transition>
<transition name="slide-down-up">
<div
v-if="gameResult.lose"
class="game-result game-result--lose"
>
Prueba de nuevo
</div>
</transition>
</div>
<div v-if="showLoader" class="loader"></div>
</div>
<script src="https://unpkg.com/vue"></script>
<script src="assets/js/main.js"></script>
</body>
</html>