-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
341 lines (309 loc) · 9.82 KB
/
Copy pathindex.html
File metadata and controls
341 lines (309 loc) · 9.82 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
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="theme-color" content="#ff4d8d">
<title>Finde die 7 Unterschiede</title>
<style>
:root {
--bg: #0e0b1f;
--bg-2: #1a1338;
--ink: #f6f3ff;
--muted: #b3a8d6;
--accent: #ff4d8d;
--accent-2: #ffd166;
--good: #5eead4;
--shadow: 0 10px 30px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
background: radial-gradient(1200px 800px at 10% -10%, #2a1d5a 0%, transparent 60%),
radial-gradient(900px 700px at 110% 10%, #4a1a47 0%, transparent 55%),
var(--bg);
color: var(--ink);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
min-height: 100dvh;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
body {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px 16px 32px;
gap: 18px;
touch-action: manipulation;
}
header {
text-align: center;
max-width: 720px;
}
h1 {
margin: 4px 0 6px;
font-size: clamp(22px, 5vw, 34px);
letter-spacing: .3px;
}
.subtitle {
margin: 0;
color: var(--muted);
font-size: 14px;
}
.counter {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 14px;
background: rgba(255,255,255,.06);
border: 1px solid rgba(255,255,255,.10);
border-radius: 999px;
font-variant-numeric: tabular-nums;
font-weight: 600;
box-shadow: var(--shadow);
}
.counter .dot {
width: 8px; height: 8px; border-radius: 50%;
background: var(--accent);
box-shadow: 0 0 12px var(--accent);
}
.puzzle {
display: flex;
flex-direction: row;
gap: 10px;
width: 100%;
max-width: 980px;
}
@media (min-width: 768px) {
.puzzle { gap: 14px; }
}
.frame {
position: relative;
flex: 1 1 0;
min-width: 0;
aspect-ratio: 3 / 4;
background: var(--bg-2);
border-radius: 18px;
overflow: hidden;
box-shadow: var(--shadow);
border: 1px solid rgba(255,255,255,.08);
isolation: isolate;
cursor: crosshair;
}
.frame img {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
user-select: none;
-webkit-user-drag: none;
pointer-events: none;
}
.frame .label {
position: absolute;
top: 10px; left: 10px;
padding: 4px 10px;
font-size: 12px;
font-weight: 600;
background: rgba(0,0,0,.55);
backdrop-filter: blur(6px);
border-radius: 999px;
letter-spacing: .4px;
}
.nope {
position: absolute;
transform: translate(-50%, -50%) scale(.9);
padding: 6px 12px;
font-weight: 800;
font-size: 14px;
color: #fff;
background: var(--accent);
border-radius: 999px;
box-shadow: 0 8px 18px rgba(255,77,141,.5);
pointer-events: none;
animation: nopePop 850ms cubic-bezier(.2,.8,.2,1) forwards;
z-index: 5;
white-space: nowrap;
}
@keyframes nopePop {
0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
60% { opacity: 1; transform: translate(-50%, -70%) scale(1); }
100% { opacity: 0; transform: translate(-50%, -120%) scale(.95); }
}
.giveup {
appearance: none;
border: 0;
padding: 14px 22px;
min-height: 48px;
font-size: 16px;
font-weight: 700;
color: #1a0f2e;
background: linear-gradient(135deg, var(--accent-2), #ffb84d);
border-radius: 14px;
box-shadow: var(--shadow);
cursor: pointer;
transition: transform .15s ease, filter .15s ease;
}
.giveup:hover { filter: brightness(1.05); }
.giveup:active { transform: translateY(1px); }
.hint {
color: var(--muted);
font-size: 12px;
text-align: center;
margin: 0;
}
/* Reveal overlay */
.reveal {
position: fixed; inset: 0;
display: none;
align-items: center;
justify-content: center;
background: radial-gradient(1000px 700px at 50% 30%, rgba(255,77,141,.35), transparent 60%),
rgba(8,5,20,.92);
backdrop-filter: blur(8px);
z-index: 10;
padding: 24px;
text-align: center;
opacity: 0;
transition: opacity .35s ease;
}
.reveal.on { display: flex; opacity: 1; }
.reveal-card {
max-width: 560px;
padding: 28px 22px;
background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
border: 1px solid rgba(255,255,255,.14);
border-radius: 22px;
box-shadow: 0 30px 60px rgba(0,0,0,.5);
transform: translateY(10px) scale(.96);
animation: revealIn .6s cubic-bezier(.2,.8,.2,1) forwards .1s;
}
@keyframes revealIn {
to { transform: translateY(0) scale(1); }
}
.reveal h2 {
margin: 0 0 8px;
font-size: clamp(28px, 7vw, 48px);
background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--good));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
.reveal p {
margin: 4px 0;
color: var(--ink);
font-size: clamp(15px, 3.5vw, 18px);
}
.reveal .tiny { color: var(--muted); font-size: 13px; margin-top: 14px; }
/* Confetti */
.confetti {
position: fixed; inset: 0;
pointer-events: none;
overflow: hidden;
z-index: 9;
}
.confetti i {
position: absolute;
top: -10vh;
width: 8px; height: 14px;
opacity: .9;
border-radius: 2px;
animation: fall linear forwards;
}
@keyframes fall {
0% { transform: translate3d(0, 0, 0) rotate(0deg); }
100% { transform: translate3d(var(--dx, 0px), 120vh, 0) rotate(720deg); }
}
</style>
</head>
<body>
<header>
<div class="counter" aria-live="polite">
<span class="dot"></span>
<span><span id="found">0</span> / 7 gefunden</span>
</div>
<h1>Finde die 7 Unterschiede</h1>
<p class="subtitle">Zwei Bilder. Sieben fiese Unterschiede. Tippe, um sie zu finden.</p>
</header>
<section class="puzzle" id="puzzle" aria-label="Finde die Unterschiede">
<div class="frame" data-side="left">
<span class="label">Das Original</span>
<img src="assets/colleague.jpg" alt="Foto des Geburtstagskollegen">
</div>
<div class="frame" data-side="right">
<span class="label">Die Zeichentrickfigur</span>
<img src="assets/cartoon.jpg" alt="Zeichentrick-Doppelgänger">
</div>
</section>
<button class="giveup" id="giveup" type="button">Ich gebe auf 🏳️</button>
<p class="hint">Tipp: Schau <em>ganz genau</em> hin.</p>
<div class="confetti" id="confetti" aria-hidden="true"></div>
<div class="reveal" id="reveal" role="dialog" aria-modal="true" aria-labelledby="reveal-title">
<div class="reveal-card">
<h2 id="reveal-title">🎉 Alles Gute zum Geburtstag! 🎉</h2>
<p><strong>Es gab 0 Unterschiede.</strong></p>
<p>Du siehst Frozone tatsächlich zum Verwechseln ähnlich. Einzigartig. ✨</p>
<p class="tiny">Hab einen großartigen Tag — von Pau.</p>
</div>
</div>
<script>
// Namen hier eintragen, um die Überschrift zu personalisieren
const NAME = "Achim";
const puzzle = document.getElementById('puzzle');
const foundEl = document.getElementById('found');
const giveup = document.getElementById('giveup');
const reveal = document.getElementById('reveal');
const confetti = document.getElementById('confetti');
const revealTitle = document.getElementById('reveal-title');
if (NAME) revealTitle.textContent = `🎉 Alles Gute zum Geburtstag, ${NAME}! 🎉`;
let taps = 0;
let revealed = false;
const NOPE_MESSAGES = ["Nö!", "Falsch!", "Weitersuchen…", "Hmm, nein.", "Knapp daneben!", "Nochmal!"];
puzzle.addEventListener('click', (e) => {
if (revealed) return;
const frame = e.target.closest('.frame');
if (!frame) return;
const rect = frame.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
const bubble = document.createElement('span');
bubble.className = 'nope';
bubble.style.left = x + 'px';
bubble.style.top = y + 'px';
bubble.textContent = NOPE_MESSAGES[Math.floor(Math.random() * NOPE_MESSAGES.length)];
frame.appendChild(bubble);
setTimeout(() => bubble.remove(), 900);
taps++;
if (taps >= 7) doReveal();
});
giveup.addEventListener('click', doReveal);
function doReveal() {
if (revealed) return;
revealed = true;
spawnConfetti(80);
reveal.classList.add('on');
}
function spawnConfetti(n) {
const colors = ['#ff4d8d', '#ffd166', '#5eead4', '#a78bfa', '#60a5fa', '#f472b6'];
const frag = document.createDocumentFragment();
for (let i = 0; i < n; i++) {
const piece = document.createElement('i');
const left = Math.random() * 100;
const dx = (Math.random() - 0.5) * 200;
const dur = 3 + Math.random() * 3;
const delay = Math.random() * 1.5;
piece.style.left = left + 'vw';
piece.style.setProperty('--dx', dx + 'px');
piece.style.background = colors[i % colors.length];
piece.style.animationDuration = dur + 's';
piece.style.animationDelay = delay + 's';
piece.style.transform = `rotate(${Math.random() * 360}deg)`;
frag.appendChild(piece);
}
confetti.appendChild(frag);
}
</script>
</body>
</html>