-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
579 lines (543 loc) · 25 KB
/
index.html
File metadata and controls
579 lines (543 loc) · 25 KB
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
<!doctype html>
<html lang="de">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<title>One Chance – Das Ratespiel</title>
<meta
name="description"
content="One Chance – Das kooperative Multiplayer-Wort-Ratespiel"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Syne:wght@400;700;800&family=DM+Sans:wght@300;400;500&display=swap"
rel="stylesheet"
/>
<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/9.22.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.22.0/firebase-database-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.22.0/firebase-auth-compat.js"></script>
<!-- QR-Code Bibliothek (CDN, keine npm nötig) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<!-- Wortlisten (eigene Dateien, leicht erweiterbar) -->
<script src="assets/words/words-leicht.js"></script>
<script src="assets/words/words-mittel.js"></script>
<script src="assets/words/words-schwer.js"></script>
<script src="assets/words/words-fsk18.js"></script>
<link rel="stylesheet" href="assets/css/style.css" />
</head>
<body>
<!-- ════════════════════════════════════════════════════════════
SCREEN 1 – START / JOIN
════════════════════════════════════════════════════════════ -->
<div id="screen-start" class="screen active">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span
><span class="orb orb3"></span>
</div>
<div class="card center-card">
<h1 class="logo">One<br /><em>Chance</em></h1>
<p class="tagline">Das kooperative Wort-Ratespiel</p>
<div class="field-group">
<input
id="input-name"
type="text"
placeholder="Dein Name"
maxlength="16"
autocomplete="off"
/>
</div>
<!-- Rollen-Auswahl -->
<div class="role-select-group">
<button
class="role-btn active-spieler"
data-role="spieler"
id="role-btn-spieler"
>
🎮 Spieler
</button>
<button
class="role-btn"
data-role="zuschauer"
id="role-btn-zuschauer"
>
👁 Zuschauer
</button>
</div>
<div class="divider"><span>Lobby</span></div>
<div class="field-group">
<input
id="input-lobby"
type="text"
placeholder="Lobby-Code (leer = neu erstellen)"
maxlength="6"
autocomplete="off"
style="text-transform: uppercase"
/>
</div>
<!-- Optionen für neue Lobby (nur wenn kein Code eingegeben) -->
<div id="new-lobby-options">
<!-- Spieler-Limit Slider -->
<div class="slider-group">
<div class="slider-label">
<span>Max. Spieler</span>
<strong id="slider-val-display">8</strong>
</div>
<input
type="range"
id="slider-max-players"
min="3"
max="12"
value="8"
/>
</div>
<!-- Kategorie-Auswahl -->
<div class="category-group">
<span class="category-label">Kategorie</span>
<div class="category-chips">
<button class="chip active" data-cat="leicht">😊 Leicht</button>
<button class="chip" data-cat="mittel">🤔 Mittel</button>
<button class="chip" data-cat="schwer">🧠 Schwer</button>
<button class="chip fsk" data-cat="fsk18">🔞 FSK18</button>
</div>
</div>
</div>
<button id="btn-join" class="btn-primary">Beitreten / Erstellen</button>
<p id="start-error" class="error-msg"></p>
<!-- GitHub & Coffee Links -->
<div class="footer-links">
<a
href="https://github.com/poiscoding/"
target="_blank"
rel="noopener"
class="footer-link"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"
/>
</svg>
GitHub
</a>
<a
href="https://buymeacoffee.com/poiscoding"
target="_blank"
rel="noopener"
class="footer-link coffee"
>
☕ Buy me a coffee
</a>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 2 – LOBBY
════════════════════════════════════════════════════════════ -->
<div id="screen-lobby" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span>
</div>
<div class="card lobby-card">
<div class="lobby-header">
<h2>Lobby</h2>
<div class="lobby-code-box">
<span id="lobby-code-display">----</span>
<button id="btn-copy-code" class="btn-copy" title="Code kopieren">
⧉
</button>
</div>
</div>
<p class="lobby-subtitle">
Spieler: <strong id="player-count">0 / 8</strong> ·
Kategorie: <strong id="category-display">Leicht</strong>
</p>
<div class="lobby-inner">
<!-- Linke Spalte: Spielerliste + QR -->
<div class="lobby-left">
<!-- QR-Code: nur sichtbar wenn dieser Client der TV-Spieler ist -->
<div id="qr-area" class="qr-area hidden">
<div id="qrcode"></div>
<p class="qr-label">QR-Code scannen zum Beitreten</p>
</div>
<ul id="player-list" class="player-list"></ul>
<!-- Einlade-Bereich -->
<div id="invite-area" class="invite-area hidden">
<p class="invite-label">Einladen</p>
<div class="invite-buttons">
<button id="btn-invite-link" class="btn-invite">
🔗 Link kopieren
</button>
<button id="btn-invite-wa" class="btn-invite btn-wa">
WhatsApp
</button>
</div>
</div>
</div>
<!-- Rechte Spalte: Controls -->
<div class="lobby-right">
<!-- Host-Controls -->
<div id="host-controls" class="host-controls hidden">
<!-- Spieler-Limit Slider -->
<div class="slider-group">
<div class="slider-label">
<span>Spieler-Limit</span>
<strong id="lobby-slider-val">8</strong>
</div>
<input
type="range"
id="lobby-slider-max"
min="3"
max="12"
value="8"
/>
</div>
<!-- Kategorie in Lobby ändern -->
<div class="category-group">
<span class="category-label">Kategorie</span>
<div class="category-chips" id="lobby-category-chips">
<button class="chip active" data-cat="leicht">
😊 Leicht
</button>
<button class="chip" data-cat="mittel">🤔 Mittel</button>
<button class="chip" data-cat="schwer">🧠 Schwer</button>
<button class="chip fsk" data-cat="fsk18">🔞 FSK18</button>
</div>
</div>
<p id="host-hint" class="host-hint">
Mindestens 3 Spieler werden benötigt.
</p>
<button id="btn-start" class="btn-primary" disabled>
Spiel starten
</button>
<button
id="btn-close-lobby"
class="btn-secondary"
style="
margin-top: 8px;
border-color: rgba(255, 107, 107, 0.3);
color: var(--accent2);
"
>
✕ Lobby schließen
</button>
</div>
<p id="waiting-msg" class="waiting-msg">Warte auf den Host…</p>
<button
id="btn-leave-lobby"
class="btn-secondary hidden"
style="
margin-top: 12px;
border-color: rgba(255, 107, 107, 0.3);
color: var(--accent2);
"
>
↩ Lobby verlassen
</button>
</div>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 3 – HINWEIS GEBEN (Wortgeber / Spieler)
════════════════════════════════════════════════════════════ -->
<div id="screen-clue" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span>
</div>
<div class="card clue-card">
<p class="role-badge">Wortgeber</p>
<p class="round-label">Das gesuchte Wort ist:</p>
<div class="secret-word-box">
<span id="secret-word-display">—</span>
</div>
<p class="clue-instruction">Gib einen einzigen Hinweis-Begriff ein:</p>
<div class="field-group">
<input
id="input-clue"
type="text"
placeholder="Dein Hinweis…"
maxlength="30"
autocomplete="off"
/>
</div>
<button id="btn-submit-clue" class="btn-primary">Bestätigen</button>
<p id="clue-submitted-msg" class="success-msg hidden">
✓ Hinweis abgeschickt! Warte auf die anderen…
</p>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 4 – WARTEN (Rater / TV-Spieler)
════════════════════════════════════════════════════════════ -->
<div id="screen-guesser-wait" class="screen">
<div class="bg-orbs"><span class="orb orb1"></span></div>
<div class="card center-card" style="text-align: center">
<p class="role-badge rater">Rater</p>
<h2 class="wait-title">Die anderen denken nach…</h2>
<div class="spinner"></div>
<p class="wait-sub">Du bekommst gleich deine Hinweise!</p>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 5 – MODERATOR-PRÜFUNG (nach Clue-Phase)
Moderator kann Hinweise manuell streichen
════════════════════════════════════════════════════════════ -->
<div id="screen-mod-review" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span>
</div>
<div class="card reveal-card">
<p class="role-badge mod">Moderator</p>
<p class="round-label">Hinweise prüfen</p>
<p class="reveal-sub">
Streiche ungültige Hinweise manuell. Dann bestätigen.
</p>
<ul id="mod-clue-list" class="clue-list"></ul>
<button id="btn-mod-confirm" class="btn-primary">
✓ Prüfung abgeschlossen
</button>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 6 – REVEAL (animiertes Durchstreichen)
Nur für Wortgeber & Host sichtbar – NICHT für Rater
════════════════════════════════════════════════════════════ -->
<div id="screen-reveal" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span>
</div>
<div class="card reveal-card">
<p class="round-label">Hinweise für den Rater</p>
<p class="reveal-sub">Doppelte Begriffe werden gestrichen…</p>
<ul id="clue-list" class="clue-list"></ul>
<!-- Countdown-Ring statt Bestätigungs-Button -->
<div id="reveal-countdown" class="countdown-ring hidden">
<svg width="80" height="80" viewBox="0 0 80 80">
<circle cx="40" cy="40" r="36" />
<circle
cx="40"
cy="40"
r="36"
class="progress"
id="countdown-circle"
/>
</svg>
<div class="countdown-num" id="countdown-num">5</div>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 7 – RATEN (Rater / TV-Spieler nach Animation)
════════════════════════════════════════════════════════════ -->
<div id="screen-guess" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span>
</div>
<div class="card clue-card">
<p class="role-badge rater">Rater</p>
<p class="round-label">Deine Hinweise:</p>
<ul id="guesser-clue-list" class="clue-list-inline"></ul>
<p class="clue-instruction">Was ist das gesuchte Wort?</p>
<div class="field-group">
<input
id="input-guess"
type="text"
placeholder="Deine Antwort…"
maxlength="30"
autocomplete="off"
/>
</div>
<button id="btn-submit-guess" class="btn-primary">
Antwort abgeben
</button>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 8a – TV-SCREEN: COUNTDOWN (Ratender muss sich umdrehen)
════════════════════════════════════════════════════════════ -->
<div id="screen-tv-countdown" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span
><span class="orb orb3"></span>
</div>
<div class="card tv-card tv-countdown-card">
<p class="role-badge tv-badge-screen">📺 TV-Modus</p>
<div class="tv-countdown-msg">
<span id="tv-countdown-guesser-name">Ratender</span>,<br />bitte
umdrehen! 🙈
</div>
<div class="tv-countdown-number" id="tv-countdown-number">5</div>
<p class="tv-hint">Das Wort wird gleich angezeigt…</p>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 8a – TV-SCREEN: CLUE-PHASE
Zeigt das Geheimwort groß auf dem Fernseher.
TV-Spieler sitzt mit Rücken zum Bildschirm.
════════════════════════════════════════════════════════════ -->
<div id="screen-tv-clue" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span
><span class="orb orb3"></span>
</div>
<div class="card tv-card">
<p class="role-badge tv-badge-screen">📺 TV-Modus</p>
<p class="tv-label">Das gesuchte Wort:</p>
<div class="tv-secret-word" id="tv-secret-word">—</div>
<p class="tv-hint">Der Ratende sitzt mit dem Rücken zum Bildschirm!</p>
<div class="tv-counter-area">
<span class="tv-counter-label">Hinweise eingegangen:</span>
<span class="tv-counter" id="tv-clue-counter">0 / 0</span>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 8b – TV-SCREEN: WARTEN (Mod-Review / Reveal lädt)
════════════════════════════════════════════════════════════ -->
<div id="screen-tv-wait" class="screen">
<div class="bg-orbs"><span class="orb orb1"></span></div>
<div class="card center-card" style="text-align: center">
<p
class="role-badge rater"
style="
background: rgba(229, 62, 62, 0.12);
color: #e53e3e;
border-color: rgba(229, 62, 62, 0.28);
"
>
📺 TV-Spieler
</p>
<h2 class="wait-title" id="tv-wait-title">Kein Spicken!</h2>
<div class="spinner" style="border-top-color: #e53e3e"></div>
<p class="wait-sub" id="tv-wait-sub">
Bitte mit dem Rücken zum Bildschirm sitzen.
</p>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 8c – TV-SCREEN: GUESS
Zeigt übrige Hinweise. Kein Eingabefeld – Host/Mod bestätigt.
════════════════════════════════════════════════════════════ -->
<div id="screen-tv-guess" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span>
</div>
<div class="card tv-card">
<p class="role-badge tv-badge-screen">📺 TV-Modus</p>
<p class="tv-label">Deine Hinweise:</p>
<ul id="tv-clue-list" class="clue-list-inline tv-clue-list"></ul>
<p class="tv-hint" id="tv-guess-hint">
Der Ratende darf sich jetzt umdrehen!
</p>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 9 – ZUSCHAUER / MODERATOR BEOBACHTEN
Sehen Wort + alle Eingaben in Echtzeit
════════════════════════════════════════════════════════════ -->
<div id="screen-observer" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span>
</div>
<div class="card observer-card">
<p id="observer-role-badge" class="role-badge viewer">Zuschauer</p>
<!-- Geheimwort (immer sichtbar) -->
<div class="observer-secret">
<span class="label">Geheimwort:</span>
<span class="word" id="observer-secret-word">—</span>
</div>
<!-- Eingaben der Spieler live -->
<p class="observer-clues-label">Eingaben der Spieler:</p>
<ul id="observer-clue-list" class="clue-list"></ul>
<!-- Rater-Antwort (sobald vorhanden) -->
<div id="observer-guess-area" class="hidden">
<p class="observer-clues-label">Antwort des Raters:</p>
<div
class="observer-secret"
style="border-color: rgba(255, 107, 107, 0.3)"
>
<span class="label">Geraten:</span>
<span
class="word"
id="observer-guess-word"
style="color: var(--accent2)"
>—</span
>
</div>
</div>
</div>
</div>
<!-- ════════════════════════════════════════════════════════════
SCREEN 10 – ERGEBNIS
════════════════════════════════════════════════════════════ -->
<div id="screen-result" class="screen">
<div class="bg-orbs">
<span class="orb orb1"></span><span class="orb orb2"></span
><span class="orb orb3"></span>
</div>
<div class="card result-card">
<div id="result-icon" class="result-icon">🎉</div>
<h2 id="result-title" class="result-title">Richtig!</h2>
<p id="result-guess" class="result-guess"></p>
<p id="result-word" class="result-word" style="display: none"></p>
<!-- Moderator / Host-Verdikt für TV-Spieler Modus -->
<div id="mod-verdict-btns" class="mod-verdict hidden">
<button id="btn-verdict-correct" class="btn-correct">
✓ Richtig
</button>
<button id="btn-verdict-wrong" class="btn-wrong">✗ Falsch</button>
</div>
<!-- Host: Steuerung nach Runde -->
<div id="host-next-controls" class="host-controls hidden">
<button id="btn-next-round" class="btn-primary">
▶ Nächste Runde
</button>
<button id="btn-back-lobby" class="btn-secondary">
↩ Zurück zur Lobby
</button>
<button
id="btn-end-game"
class="btn-secondary"
style="
border-color: rgba(255, 107, 107, 0.3);
color: var(--accent2);
"
>
✕ Spiel beenden
</button>
</div>
<p id="waiting-next-msg" class="waiting-msg">Warte auf den Host…</p>
<!-- GitHub & Coffee Links -->
<div class="footer-links">
<a
href="https://github.com/poiscoding/"
target="_blank"
rel="noopener"
class="footer-link"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"
/>
</svg>
GitHub
</a>
<a
href="https://buymeacoffee.com/poiscoding"
target="_blank"
rel="noopener"
class="footer-link coffee"
>
☕ Buy me a coffee
</a>
</div>
</div>
</div>
<!-- Wortlisten + Spiellogik -->
<script src="assets/js/game.js"></script>
</body>
</html>