-
Notifications
You must be signed in to change notification settings - Fork 1
/
cc.js
583 lines (489 loc) · 21.3 KB
/
cc.js
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
// v10 - 09-01-2023
const origin = ""//"https://culturecrossover.eu";
let lang = "eng";
let appReady = false;
let gameNumber = 'game';
let player;
const pages = {
"": "lang-page",
"players": "player-page",
"scores": "score-page",
"materials": "materials-page",
"404": "404-page",
"fortune": "fortune-page",
"dice": "dice-page",
"trivia": "trivia-page",
"culture": "culture-page"
}
const translate = {
eng: {
players: "Players",
fortune: "Fortune",
culture: "Culture",
trivia: "Trivia",
countries: ["Albania", "Cape verde", "Chechnya", "China", "Egypt", "France", "Germany", "Ghana", "Greece", "Ireland", "Italy", "Poland", "Portugal", "Syria", "Ukraine"],
info:["RULES", "REFRESH", "Restart all the scores. Attention, it’s not undoable", "INSTALL", "Install the App on your phone, computer or other device and play the game offline, anytime!", "This App was<br>brought to you by", "and developed by<br>Sugodesign with the<br>collaboration of Steve Mills"]
},
pol: {
players: "Osoby grające",
fortune: "Karta losu",
culture: "Karty kultury",
trivia: "Karty ciekawostek",
countries: ["Albania", "Republika Zielonego Przylądka", "Czeczenia", "Chiny", "Egipt", "Francja", "Niemcy", "Ghana", "Grecja", "Irlandia", "Włochy", "Polska", "Portugalia", "Syria", "Ukraina"],
info:["POL-RULES", "POL-REFRESH", "Restart all the scores. Attention, it’s not undoable", "INSTALL", "Install the App on your phone, computer or other device and play the game offline, anytime!", "This App was<br>brought to you by", "and developed by<br>Sugodesign with the<br>collaboration of Steve Mills"]
},
ger: {
players: "Spieler*innen",
fortune: "Glück",
culture: "Kultur",
trivia: "Wissen",
countries: ["Albanien", "Kap Verde", "Tschetschenien", "China", "Ägypten", "Frankreich", "Deutschland", "Ghana", "Griechenland", "Irland", "Italien", "Polen", "Portugal", "Syrien", "Ukraine"],
info:["RULES", "REFRESH", "Restart all the scores. Attention, it’s not undoable", "INSTALL", "Install the App on your phone, computer or other device and play the game offline, anytime!", "This App was<br>brought to you by", "and developed by<br>Sugodesign with the<br>collaboration of Steve Mills"]
},
ita: {
players: "Giocatoris",
fortune: "Fortuna",
culture: "Cultura",
trivia: "Curiosità",
countries: ["Albania", "Cape verde", "Chechnya", "China", "Egypt", "France", "Germany", "Ghana", "Greece", "Ireland", "Italy", "Poland", "Portugal", "Syria", "Ukraine"],
info:["RULES", "REFRESH", "Restart all the scores. Attention, it’s not undoable", "INSTALL", "Install the App on your phone, computer or other device and play the game offline, anytime!", "This App was<br>brought to you by", "and developed by<br>Sugodesign with the<br>collaboration of Steve Mills"]
},
por: {
players: "Jogadores",
fortune: "Sorte",
culture: "Cultura",
trivia: "Curiosidades",
countries: ["Albânia", "Cabo Verde", "Chechénia", "China", "Egipto", "França", "Alemanha", "Gana", "Grécia", "Irelanda", "Itália", "Polónia", "Portugal", "Síria", "Ucrânia"],
info:["RULES", "REFRESH", "Restart all the scores. Attention, it’s not undoable", "INSTALL", "Install the App on your phone, computer or other device and play the game offline, anytime!", "This App was<br>brought to you by", "and developed by<br>Sugodesign with the<br>collaboration of Steve Mills"]
},
gre: {
players: "ΠΑΙΧΤΕΣ",
fortune: "ΤΥΧΗΣ",
culture: "ΠΟΛΙΤΙΣΜΟΥ",
trivia: "Trivia",
countries: ["Αλβανία", "Πράσινο Ακρωτήριο", "Τσετσενία", "Κίνα", "Αίγυπτος", "Γαλλία", "Γερμανία", "Γκάνα", "Ελλάδα", "Ιρλανδία", "Ιταλία", "Πολωνία", "Πορτογαλία", "Συρία", "Ουκρανία"],
info:["RULES", "REFRESH", "Restart all the scores. Attention, it’s not undoable", "INSTALL", "Install the App on your phone, computer or other device and play the game offline, anytime!", "This App was<br>brought to you by", "and developed by<br>Sugodesign with the<br>collaboration of Steve Mills"]
},
ukr: {
players: "Граче",
fortune: "Карта фортуни",
culture: "Карти культури",
trivia: "Цікавий факт",
countries: ["Албанія", " Кабо-Верде", "Чечня", "Китай", "Єгипет", "Франція", "Німеччи", "Гана", "Греція", "Ірланді", "Італія", "Польща", "Португалія", "Сирія", "Україна"],
info:["RULES", "REFRESH", "Restart all the scores. Attention, it’s not undoable", "INSTALL", "Install the App on your phone, computer or other device and play the game offline, anytime!", "This App was<br>brought to you by", "and developed by<br>Sugodesign with the<br>collaboration of Steve Mills"]
}
}
Array.prototype.shuffle = function () {
let input = this;
for (let i = input.length - 1; i >= 0; i--) {
let randomIndex = Math.floor(Math.random() * (i + 1));
let itemAtIndex = input[randomIndex];
input[randomIndex] = input[i];
input[i] = itemAtIndex;
}
return input;
}
const navigate = async () => {
let path = window.location.pathname.split('/').pop()
let page = pages[path] || pages[404];
let newPage = document.createElement(page)
newPage.className = 'page';
let current = document.querySelector('.page')
if (current) {
current.disconnect();
current.parentNode.replaceChild(newPage, current)
}
else { document.querySelector('body').appendChild(newPage); }
};
const clickHandle = event => {
event.preventDefault();
let { currentTarget, target } = event;
currentTarget[target.dataset.event]?.(event)
if (target.dataset.page) {
window.history.pushState({}, "", `${origin}${target.dataset.page}`);
navigate();
}
};
window.onpopstate = navigate;
window.onload = navigate;
//const channel = new BroadcastChannel('loading')
//channel.onmessage = ({ data }) => data.status == 'loaded' ? appReady() : appFailed();
class baseElement extends HTMLElement {
constructor() { super() }
handleCLicks = clickHandle;
render(selector) {
let temp = document.querySelector(`[part = ${selector}]`).content.cloneNode(true);
this.appendChild(temp);
let slots = document.querySelectorAll(`[data-slot]`);
for (let i of slots) { i.textContent = translate[lang][i.dataset.slot] }
}
unselect() {
let nodes = document.querySelectorAll('.selected')
for (let el of nodes) { el.classList.remove('selected') }
}
async disconnect() { this.removeEventListener('click', this.handleCLicks) }
connectedCallback() { this.addEventListener('click', clickHandle); }
back() { history.back() }
}
class langPage extends baseElement {
constructor() { super() }
async setLanguage(event) {
lang = event.target.dataset.lang;
//let ready = await navigator.serviceWorker.ready;
navigator.serviceWorker.controller.postMessage({ type: 'LANGUAGE', msg: lang });
}
async refresh() {
//let ready = await navigator.serviceWorker.ready;
navigator.serviceWorker.controller.postMessage({ type: 'REFRESH', });
}
connectedCallback() { this.render('lang-page'); super.connectedCallback() }
}
class playerPage extends baseElement {
constructor() { super() }
plus() {
let items = localStorage.getItem(gameNumber)
let game = JSON.parse(items) || { players: [] }
let inputs = document.querySelectorAll('input')
for (let i = 0, len = inputs.length; i < len; i++) {
if (inputs[i].value) game.players[i].name = inputs[i].value;
}
game.players.push({ name: undefined, badges: 0, visa: 0, ticket: 0 })
localStorage.setItem(gameNumber, JSON.stringify(game))
document.querySelector('[part = "temp-lit"]').diff();
}
minus({ target }) {
player = undefined;
let items = localStorage.getItem(gameNumber)
let game = JSON.parse(items)
let inputs = document.querySelectorAll('input')
for (let i = 0, len = inputs.length; i < len; i++) {
if (inputs[i].value) game.players[i].name = inputs[i].value;
}
game.players.splice(target.dataset.index, 1);
localStorage.setItem(gameNumber, JSON.stringify(game))
document.querySelector('[part = "temp-lit"]').diff()
}
start() {
let items = localStorage.getItem(gameNumber)
let game = JSON.parse(items)
let inputs = document.querySelectorAll('input')
for (let i = 0, len = inputs.length; i < len; i++) {
if (inputs[i].value) game.players[i].name = inputs[i].value;
else game.players[i].name = `P${i + 1}`
}
localStorage.setItem(gameNumber, JSON.stringify(game))
}
connectedCallback() { this.render('player-page'); super.connectedCallback() }
}
class scorePage extends baseElement {
constructor() { super() }
select({ target }) {
document.querySelectorAll('.selected').forEach(x => x.classList.remove('selected'))
target.className = 'selected'
player = target.dataset.prop;
}
plus() {
let element;
if (player == undefined) { element = document.querySelector(".selected"); if (!element) return; player = element.dataset.prop }
else element = document.querySelector(`[data-prop = "${player}"]`)
let value = parseInt(element.value) + 1;
element.value = value;
let items = localStorage.getItem(gameNumber)
let game = JSON.parse(items)
let [i, type] = player.split('-');
game.players[i][type] = value;
localStorage.setItem(gameNumber, JSON.stringify(game))
document.querySelector('[part = "temp-lit"]').diff()
}
minus() {
let element;
if (player == undefined) { element = document.querySelector(".selected"); if (!element) return; player = element.dataset.prop }
else element = document.querySelector(`[data-prop = "${player}"]`)
let value = parseInt(element.value) - 1;
if (value < 0) return
element.value = value;
let items = localStorage.getItem(gameNumber)
let game = JSON.parse(items)
let [i, type] = player.split('-');
game.players[i][type] = value;
localStorage.setItem(gameNumber, JSON.stringify(game))
document.querySelector('[part = "temp-lit"]').diff()
}
// Dice - Keeping in separate window for now
dice() { window.open("https://app.culturecrossover.eu/dice/"); }
connectedCallback() { this.render('score-page'); super.connectedCallback() }
}
class errorPage extends baseElement {
constructor() { super() }
}
class triviaPage extends baseElement {
constructor() { super() }
lang({ target }) {
let node = document.createElement('trivia-card')
node.dataset.url = `https://app.culturecrossover.eu/wp-json/crossover/${lang}/trivia-cards/${target.dataset.country}`
node.dataset.clang = `${target.dataset.country}`
node.className = 'center'
target.parentNode.replaceWith(node)
}
select({ target }) {
if (target.dataset.val === "correct") {
target.style.backgroundColor = "#59ba9d"
target.style.color = "#fff"
}
else { target.style.backgroundColor = "#e94e15" }
}
connectedCallback() { this.render('trivia-page'); super.connectedCallback() }
}
class fortunePage extends baseElement {
constructor() { super() }
select() {
}
connectedCallback() { this.render('fortune-page'); super.connectedCallback() }
}
class culturePage extends baseElement {
constructor() { super() }
lang({ target }) {
let node = document.createElement('culture-card')
node.dataset.url = `https://app.culturecrossover.eu/wp-json/crossover/${lang}/culture-cards/${target.dataset.country}`
node.dataset.clang = `${target.dataset.country}`
node.className = 'center'
target.parentNode.replaceWith(node)
}
select({ target }) {
if (target.dataset.val === "correct") {
target.style.backgroundColor = "#59ba9d"
target.style.color = "#fff"
}
else { target.style.backgroundColor = "#e94e15" }
}
flip({ target }) {
target.remove()
let visible = document.querySelectorAll('.hide');
visible.forEach(x => x.remove())
let hidden = document.querySelectorAll('.hidden')
hidden.forEach(x => x.classList.remove('hidden'))
}
connectedCallback() { this.render('culture-page'); super.connectedCallback() }
}
// Dice page
class dicePage extends baseElement {
constructor() { super() }
roll() {
const dadoImg = document.getElementById("img_dado");
const audio_fx_01 = document.getElementById("audio_fx_01");
const audio_fx_02 = document.getElementById("audio_fx_02");
const audio_fx_03 = document.getElementById("audio_fx_03");
const audio_fx = [audio_fx_01, audio_fx_02, audio_fx_03];
let dadoNum = Math.ceil(Math.random() * 6);
let audioNum = Math.floor(Math.random() * 3);
if (dadoNum === 1 || dadoNum === 6) {
dadoNum = 1;
}
else if (dadoNum === 3 || dadoNum === 5) {
dadoNum = 2;
}
else if (dadoNum === 2 || dadoNum === 4) {
dadoNum = 3;
}
audio_fx[audioNum].play();
dadoImg.classList.toggle("rola");
setTimeout(() => {
dadoImg.classList.toggle("rola");
}, 1000);
setTimeout(() => {
dadoImg.src = `https://app.culturecrossover.eu/dice/dice-${dadoNum}.jpg`;
}, 200);
}
connectedCallback() { this.render('dice-page'); super.connectedCallback() }
}
customElements.define('base-element', baseElement)
//customElements.define('main-page', mainPage)
customElements.define('lang-page', langPage)
customElements.define('player-page', playerPage)
customElements.define('score-page', scorePage)
customElements.define('fortune-page', fortunePage)
// customElements.define('dice-page', dicePage) // Turn off?
customElements.define('trivia-page', triviaPage)
customElements.define('culture-page', culturePage)
//customElements.define('404-page', errorPage)
// Number of cards
class slotElement extends HTMLElement {
constructor() { super() }
connectedCallback() { if (this.diff) this.diff() }
setCards() {
localStorage.setItem('cards', JSON.stringify({
fortune: {},
trivia: {},
culture: {},
}))
}
}
class playerBoard extends slotElement {
constructor() { super() }
diff() {
let find = localStorage.getItem(gameNumber);
let get = JSON.parse(find) || { players: [] }
let players = get.players;
let frag = document.createElement('template')
let str = "";
for (let i = 0, len = players.length; i < len; i++) {
let p = players[i]
str +=
`<input type="text" ${p.name ? `value = "${p.name}"` : `placeholder = "P${i + 1}"`}><svg data-event = "minus" class = 'svg-icon' class = 'svg-icon' data-index = ${i} fill="none" xmlns="http://www.w3.org/2000/svg" > <use href="#minus"/></svg>`
};
str += `<svg data-event="plus" class='svg-icon' class='svg-icon back' fill="none" xmlns="http://www.w3.org/2000/svg"><use href="#plus" /></svg>`
str += `<svg data-event='start' data-page='scores' class="svg-icon" fill="none" xmlns="http://www.w3.org/2000/svg" transform="scale(1.5), translate(-70 50)"><use href="#play" /></svg>`
frag.innerHTML = str;
this.innerHTML = '';
this.appendChild(frag.content)
}
}
class scoreBoard extends slotElement {
constructor() { super() }
diff() {
let find = localStorage.getItem(gameNumber);
let get = JSON.parse(find) || { players: [] }
let players = get.players;
let frag = document.createElement('template')
let str = "";
for (let i = 0, len = players.length; i < len; i++) {
let p = players[i];
str +=
`<score-row>
<strong data-prop="0-name" >${p.name}</strong>
<input readonly data-event='select' data-prop="${i}-badges" value = ${p.badges}></input>
<input readonly data-event='select' data-prop="${i}-ticket" value = ${p.ticket}></input>
</score-row>`
};
frag.innerHTML = str;
this.innerHTML = '';
this.appendChild(frag.content)
let selected = document.querySelectorAll(`[data-prop = "${player}"]`).forEach(el => el.classList.add('selected'))
let sel = document.querySelectorAll('.selected')
if (sel.length == 0) {
let inputs = document.querySelectorAll('input');
if (inputs.length > 0) inputs[0].classList.add('selected');
}
}
}
class triviaCard extends slotElement {
constructor() { super() }
async diff() {
let url = this.dataset.url
let clang = this.dataset.clang;
let get = localStorage.getItem('cards')
if (get == undefined) { await super.setCards(); get = localStorage.getItem('cards') }
let cards = JSON.parse(get);
let find = await fetch(url)
if (!find.ok) return alert('network connection error')
let parsed = await find.json();
if (!cards.trivia[clang] || cards.trivia[clang].deck.length !== parsed.length) cards.trivia[clang] = { deck: [...Array(parsed.length).keys()].shuffle(), iter: 0 }
let iter = cards.trivia[clang].iter;
let deck = cards.trivia[clang].deck;
if (iter >= deck.length) { iter = 0; cards.trivia[clang].iter = 0; cards.trivia[clang].deck = [...Array(deck.length).keys()].shuffle(); }
let trivia = parsed[deck[iter]]
let frag = document.createElement('template')
let str =
`${trivia.question}
<button data-event = "select" data-val = ${trivia.correct == "A" ? "correct" : "incorrect"}>${trivia.opt_a}</button
<br>
<button data-event = "select" data-val = ${trivia.correct == "B" ? "correct" : "incorrect"}>${trivia.opt_b}</button
<br>
<button data-event = "select" data-val = ${trivia.correct == "C" ? "correct" : "incorrect"}>${trivia.opt_c}</button`
frag.innerHTML = str;
this.innerHTML = '';
this.appendChild(frag.content)
let selected = document.querySelectorAll(`[data-prop = "${player}"]`).forEach(el => el.classList.add('selected'))
cards.trivia[clang].iter++;
localStorage.setItem('cards', JSON.stringify(cards))
}
}
class fortuneCard extends slotElement {
constructor() { super() }
async diff() {
let get = localStorage.getItem('cards')
if (get == undefined) { await super.setCards(); get = localStorage.getItem('cards') }
let cards = JSON.parse(get);
let find = await fetch(`https://app.culturecrossover.eu/wp-json/crossover/${lang}/fortune-cards`)
if (!find.ok) return alert('network connection error')
let parsed = await find.json();
if (!cards.fortune[lang] || cards.fortune[lang].deck.length !== parsed.length) cards.fortune[lang] = { deck: [...Array(parsed.length).keys()].shuffle(), iter: 0 }
let iter = cards.fortune[lang].iter;
let deck = cards.fortune[lang].deck;
if (iter >= deck.length) { iter = 0; cards.fortune[lang].iter = 0; cards.fortune[lang].deck }
let fortune = parsed[deck[iter]]
let frag = document.createElement('template')
let str = `${fortune.fortune}`
frag.innerHTML = str;
this.innerHTML = '';
this.appendChild(frag.content)
fortune.unlucky ? document.querySelector(".page").style.backgroundColor = "#e94e15" : document.querySelector(".page").style.backgroundColor = "#59ba9d"
cards.fortune[lang].iter++
localStorage.setItem('cards', JSON.stringify(cards))
}
}
class cultureCard extends slotElement {
constructor() { super() }
async diff() {
let url = this.dataset.url
let clang = this.dataset.clang;
let get = localStorage.getItem('cards')
if (get == undefined) { await super.setCards(); get = localStorage.getItem('cards') }
let cards = JSON.parse(get);
let find = await fetch(url)
if (!find.ok) return alert('network connection error')
let parsed = await find.json();
if (!cards.culture[clang] || cards.culture[clang].deck.length !== parsed.length) cards.culture[clang] = { deck: [...Array(parsed.length).keys()].shuffle(), iter: 0 }
let iter = cards.culture[clang].iter;
let deck = cards.culture[clang].deck;
if (iter >= deck.length) { iter = 0; cards.culture[clang].iter = 0; cards.culture[clang].deck = [...Array(deck.length).keys()].shuffle(); }
let culture = parsed[deck[iter]]
let frag = document.createElement('template')
let str =
`<div class='hide culture-question'>${culture.question}</div>
${culture.opt_a ?
`<div class = 'hide'>
<div class="culture-option">A</div><button data-event = "select" data-val = ${culture.correct == "A" ? "correct" : "incorrect"}>${culture.opt_a}</button>
<div class="culture-option">B</div><button data-event = "select" data-val = ${culture.correct == "B" ? "correct" : "incorrect"}>${culture.opt_b}</button>
<div class="culture-option">C</div><button data-event = "select" data-val = ${culture.correct == "C" ? "correct" : "incorrect"}>${culture.opt_c}</button>
</div>
`
: ``}
${culture.truth ?
`<div class = 'hide'>
<button data-event = "select" data-val = ${culture.truth == "true" ? "correct" : "incorrect"}>TRUE</button>
<button data-event = "select" data-val = ${culture.truth == "false" ? "correct" : "incorrect"}>FALSE</button>
</div>`
: ``}
${culture.explain ?
`<div class="culture-answer hidden">
${culture.explain}
</div>`
: ``}
<svg class = 'center hide turn' data-event="flip" xmlns="http://www.w3.org/2000/svg" width="17.6mm" height="17.5mm" viewBox="0 0 50 49.7">
<defs>
<style>
.cls-1 { fill: none; stroke: #59ba9d; stroke-miterlimit: 10; stroke-width: 5.51px;}
.cls-2 { fill: #59ba9d; }
</style>
</defs>
<g id="Layer_1" data-name="Layer 1">
<g>
<path class="cls-1" d="M19.9,43.4a18.3,18.3,0,0,1-4.8-2.5,16.8,16.8,0,1,1,20.1-27l.9.8"/>
<polygon class="cls-2" points="43.3 7.8 27 19.6 41.1 21.8 43.3 7.8"/>
</g>
</g>
</svg>`
frag.innerHTML = str;
this.innerHTML = '';
this.appendChild(frag.content)
let selected = document.querySelectorAll(`[data-prop = "${player}"]`).forEach(el => el.classList.add('selected'))
cards.culture[clang].iter++;
localStorage.setItem('cards', JSON.stringify(cards))
}
}
customElements.define("player-board", playerBoard)
customElements.define("score-board", scoreBoard)
customElements.define("trivia-card", triviaCard)
customElements.define("fortune-card", fortuneCard)
customElements.define("culture-card", cultureCard)