-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
279 lines (276 loc) · 14.5 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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Numeroteca</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.0/css/bulma.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
<link rel="stylesheet" href="./assets/custom.css?v=3.0">
<link href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;500&display=swap" rel="stylesheet">
</head>
<body style="font-family: 'Rubik', sans-serif;">
<section v-cloak id='app' class="hero is-fullheight">
<div v-if="phases.gameplay" class="is-overlay">
<div v-show="question_deck.visible" :class="['box has-text-centered animate__animated animate__fadeInDown', question_deck.container_class]" id="question_deck">
<nav v-if="question_deck.picked" class="level">
<!-- Left side -->
<div class="level-left">
<div class="level-item">
</div>
<div class="level-item">
<p class="is-size-3">{{current_question_content}}</p>
</div>
</div>
<p class="level-item">
<template v-if="game_deck.checked">
<p v-if="passes_test" class="is-size-3"> SI! <span class="icon has-text-primary"> <i class="fas fa-check"></i></span></p>
<p v-else class="is-size-3"> NO! <span class="icon has-text-danger"> <i class="fas fa-times"></i></span></p>
</template>
</p>
<!-- Right side -->
<div class="level-right">
<p class="level-item">
<template v-if="current_numbers.length == 1">
<a
class="button is-fullwidth is-success"
type="button" name="button"
@click="start(game.mode)">
Ricomincia</a>
</template>
<template v-else>
<a
v-if="!game_deck.checked"
class="button is-fullwidth is-warning"
type="button" name="button"
@click="check_current()">
Mostra Risposta</a>
<a
v-else
class="button is-fullwidth is-danger"
type="button" name="button"
@click="checks()">
Elimina Carte</a>
</template>
</p>
</div>
</nav>
<p v-if="!question_deck.picked" class="is-size-4">Seleziona una carta e scopri la domanda</p>
<div class="columns is-centered">
<div :class="{'column':true,
'is-12': (questions.length - current_question) > 4 ,
'is-7': (questions.length - current_question) < 5 && (questions.length - current_question) > 1,
'is-4': (questions.length - current_question) == 1 }">
<div :class="{'questions-container':true, 'animate__animated animate__fadeOut':question_deck.picked}" :style="{'grid-template-columns':get_qst_grid}" style="transition: all 0.5s ease;">
<div v-for= "n in this.question_deck.card_list" @click="pick_question(n);">
<div :class="{'image num num-has-shadow':true, 'animate__animated animate__zoomOut':question_deck.card_picked==n}">
<img class="qst-image" src="./assets/images/back/question.png" :style={height:qst_height} alt="">
<span style="position:absolute; left: calc(50% - 0.5em);">{{n}}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div @click="get_info()" :class="{'modal':true, 'is-active':info.number_info}" id="info">
<div :class="{'modal-background animate__animated':true,
'animate__fadeIn animate__slow':info.number_info && !info.is_hiding_info,
'animate__fadeOut animated__faster':info.is_hiding_info
}">
</div>
<div :class="{
'modal-card animate__animated':true,
'animate__fadeInDown animate__faster': info.number_info && !info.is_hiding_info,
'animate__fadeOutUp animated_faster':info.is_hiding_info
}"
style="width:65% !important; height:70vh !important">
<header class="modal-card-head">
<p class="modal-card-title">Informazioni</p>
<button class="delete" aria-label="close" @click="get_info()"></button>
</header>
<section class="modal-card-body">
<div v-if="info.info_selection" class="columns">
<div class="column is-one-third">
<div class="image">
<img v-if="games.info[info.info_selection].image" :src="`./assets/images/info/${games.info[info.info_selection].image}`" alt="">
<img v-else :src="get_image(info.info_selection)" alt="">
</div>
</div>
<div class="column is-size-5">
{{games.info[info.info_selection].text}}
</div>
</div>
</section>
</div>
</div>
<div class="hero-head">
<nav class="navbar">
<div class="container">
<div class="navbar-brand animate__animated animate__fadeInLeft" @click="reset">
<a class="navbar-item" style="width: 56px;padding: 5px;">
<img src="./assets/images/logo-stroked.png" alt="Logo" style="max-height: 56px">
</a>
<span class="navbar-burger burger" data-target="navbarMenuHeroA">
<span></span>
<span></span>
<span></span>
</span>
</div>
<div v-if="phases.gameplay" id="navbarMenuHeroA" class="navbar-menu animate__animated animate__fadeInDown">
<div class="navbar-end">
<span class="navbar-item">
<a class="button" @click="reset">
<span class="icon">
<i class="fas fa-arrow-left"></i>
</span>
<span>Indietro</span>
</a>
</span>
<span class="navbar-item">
<a class="button" @click="start(game.mode, true)">
<span class="icon">
<i class="fas fa-redo-alt"></i>
</span>
<span>Restart</span>
</a>
</span>
</div>
</div>
</div>
</nav>
</div>
<div class="hero-body is-paddingless">
<template v-if="phases.welcome">
<div class="container">
<div class="columns is-centered">
<div class="column is-half">
<div class="box animate__animated animate__fadeInDown">
<div class="image">
<img alt="" v-if="phases.welcome" src="assets/images/background.png" style="z-index:1"/>
</div>
</div>
</div>
</div>
<div class="columns is-centered">
<div class="column is-one-quarter">
<div class="buttons are-medium is-centered animate__animated animate__fadeInUp">
<button :class="{'button is-primary is-rounded':true, 'is-loading':!games_loaded}" @click="start('easy')"></button>
<button :class="{'button is-warning is-rounded':true, 'is-loading':!games_loaded}" @click="start('medium')"></button>
<button :class="{'button is-danger is-rounded':true, 'is-loading':!games_loaded}" @click="start('hard')"></button>
</div>
</div>
</div>
</div>
</template>
<template v-else-if="phases.chosing_for_you">
<div class="container">
<div class="columns is-centered">
<div class="column is-12 is-10-fullhd columns is-centered">
<div class="column is-narrow" style="height:80vh;">
<div style="transform: translate(0, 30vh); width: 2px; height: 2px; transform-origin: center; background: black;">
<div class="" v-for="n in Array.from(Array(30).keys())" style="position:absolute; width:60px;" :style="get_translation2(n,30)">
<!-- <div @click="chosing_deck.closed=!chosing_deck.closed; pick_mistery(n)" :style="{'width':'10px', 'height':'20px', 'background': 'rgb('+n*255/30+',100,100)' }"></div> -->
<img src="./assets/images/back/0.png" style="width:80px;" alt=""
@click="pick_mistery(n)"
:class="{'num num-has-shadow': true, 'animate__animated animate__tada glow-right': chosing_deck.card_picked === n}"
>
</div>
</div>
</div>
<div class="column is-7 has-text-centered" style="position: absolute;top: 30vh;margin-left: 30px;">
<template v-if="chosing_deck.picked">
<div class="buttons is-centered animate__animated animate__fadeIn">
<button type="button" name="button" class="button is-success" @click="toggle_phase('gameplay'); pick_game(0);">Pronti</button>
<button type="button" name="button" class="button is-danger" @click="toggle_phase('gameplay'); pick_game(1);">Partenza</button>
<button type="button" name="button" class="button is-warning" @click="toggle_phase('gameplay'); pick_game(2)">Via!</button>
</div>
</template>
</div>
<!-- <div v-for="i in Array.from(Array(3).keys())" class="columns">
<div v-for="j in Array.from({length: 10}, (_, i) => i + 1)" class="column" :style="get_translation(j,i)">
<img @click="chosing_deck.closed=!chosing_deck.closed; pick_mistery(i, j)" :class="{'num num-has-shadow': true, 'animate__animated animate__bounce glow-right': chosing_deck.card_picked == `${i}${j}`}" src="./assets/images/back/0.png" alt="">
</div>
</div> -->
</div>
</div>
<div class="columns is-centered is-marginless">
<div class="column is-7 has-text-centered" style="min-height:60px;">
<button v-if="chosing_deck.closed && !chosing_deck.picked" type="button" name="button" class="button is-large">Clicca sul mazzo!</button>
<button v-if="!chosing_deck.closed && !chosing_deck.picked" type="button" name="button" class="button is-large">Seleziona una carta misteriosa</button>
</div>
</div>
</div>
</template>
<template v-else-if="phases.gameplay">
<div class="container">
<div class="columns is-centered animate__animated animate__fadeIn" style="min-width: 100%;">
<div :class="{'column':true, 'is-10 is-10-fullhd':current_numbers.length>3, 'is-7':current_numbers.length<=3}">
<div v-if="current_numbers.length > 1" class="grid-container animate__animated animate__fadeIn animate__slow" :style="{'grid-template-columns': get_grid}">
<div v-for="n in current_numbers"
:class="{
'image num num-has-shadow animate__animated filler':true,
'glow animate__bounce':fake_eliminated.has(n),
'glow-right':game_deck.checked && game_deck.is_eliminating && !eliminated.has(n),
'glow animate__flipOutX animate__fast': game_deck.is_eliminating && eliminated.has(n)
}"
:style="{'animation-delay':delay(n)}"
@click="toggle_fake_eliminated(n)"
>
<img :src="get_image(n)" alt="">
<a v-if="games.info[n]" type="button" class="num-info" name="button" @click.stop="get_info(n)">
<div class="icon">
<i class="fas fa-info-circle"></i>
</div>
</a>
<!-- <span style="position:absolute;">{{n}}</span> -->
</div>
</div>
<div v-else class="columns is-centered is-vcentered">
<div class="column is-4">
<div
:class="{
'image animate__animated':true,
'animate__tada':game_deck.tada,
'animate__pulse animate__slow':!game_deck.tada
}"
:style="{'animation-iteration-count': !game_deck.tada || 'infinite'}"
>
<img :src="`./assets/images/numbers/${current}.png`" alt="right guess">
</div>
</div>
<div class="column is-narrow">
<p v-for="a, i in active_questions">{{a[2]}}
<span v-if="game.answers[i]" class="is-size-3"> SI! <span class="icon has-text-primary"> <i class="fas fa-check"></i></span></span>
<span v-else class="is-size-3"> NO! <span class="icon has-text-danger"> <i class="fas fa-times"></i></span></span>
</p>
</div>
</div>
</div>
</div>
</div>
</template>
</div>
<!-- Hero footer: will stick at the bottom -->
<div v-if="phases.welcome || phases.gameplay" :class="{'hero-foot':true, 'has-background-light':phases.welcome}" style="z-index: 2; min-height:130px;">
<template v-if="phases.welcome">
<div class="animate__animated animate__fadeInUp animate__delay-300ms">
<div class="tabs is-centered" style="width:60%; margin:auto;">
<ul style="width:50%">
<li style="padding:10px;"><div class="image animate__animated animate__fadeIn animate__slower "><img src="./assets/images/logos/loghi.png" alt="bergamo scienza"></div></li>
</ul>
</div>
</div>
</template>
<template v-else-if="phases.gameplay">
<div class="buttons is-centered" v-if="!question_deck.visible">
<button class="button" type="button" name="button" @click="question_deck.visible = true;"> Carte Domanda</button>
</div>
</template>
</div>
</section>
</body>
<script src="./index.js?v=3.0"></script>
</html>