-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhosted.html
More file actions
1150 lines (1013 loc) · 59.6 KB
/
hosted.html
File metadata and controls
1150 lines (1013 loc) · 59.6 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
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title id="page-title">For Someone ❤️</title>
<!-- Google Fonts -->
<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=Dancing+Script:wght@600;700&family=Nunito:wght@300;400;600;700&family=Quicksand:wght@400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--blush-pink: #F8C8DC; --soft-rose: #E75480; --muted-lavender: #C8A2C8;
--warm-plum: #7D4E8D; --creamy-white: #FFF8F2; --light-peach: #FFE5EC;
--text-charcoal: #3A3A3A; --text-cocoa: #5A3E36;
--gradient-romantic: linear-gradient(to bottom, #FFF8F2, #ffe5ec, #fff0f6);
--shadow-soft: 0 10px 25px rgba(125, 78, 141, 0.15);
--font-hand: 'Dancing Script', cursive; --font-body: 'Quicksand', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: var(--creamy-white); color: var(--text-charcoal); font-family: var(--font-body); overflow-x: hidden; line-height: 1.6; }
body.no-scroll { overflow: hidden; height: 100vh; }
/* Utilities */
.flex-center { display: flex; justify-content: center; align-items: center; }
.abs-fill { position: fixed; top: 0; left: 0; width: 100%; height: 100%; }
h1, h2, h3 { font-family: var(--font-hand); color: var(--text-cocoa); }
/* Interest Meter */
#interest-meter {
position: fixed; top: 20px; right: 20px; width: 180px; padding: 15px;
background: white; border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 1px solid var(--blush-pink);
z-index: 5000; font-family: var(--font-body); transition: transform 0.3s;
}
.meter-title { font-size: 0.9rem; font-weight: 700; color: var(--warm-plum); margin-bottom: 8px; text-align: center; transition: color 0.3s; }
.meter-bar { height: 8px; background: #FFE5EC; border-radius: 10px; overflow: hidden; }
.meter-fill { height: 100%; width: 0%; background: linear-gradient(to right, #F8C8DC, #E75480); transition: width 0.6s ease; }
/* Sticker Panel */
#sticker-panel {
position: fixed; right: 20px; top: 50%; transform: translateY(-50%);
display: flex; flex-direction: column; gap: 15px; z-index: 4000;
}
.sticker-btn {
width: 50px; height: 50px; border-radius: 50%;
background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(5px);
border: 1px solid var(--blush-pink); box-shadow: 0 8px 25px rgba(231,84,128,0.2);
font-size: 1.5rem; cursor: pointer;
display: flex; align-items: center; justify-content: center;
transition: transform 0.2s;
}
.sticker-btn:hover { transform: scale(1.15); background: white; }
.floating-sticker {
position: fixed; font-size: 2rem; pointer-events: none; z-index: 4500;
animation: floatUpSticker 2s ease-out forwards;
}
@keyframes floatUpSticker {
0% { transform: translateY(0) rotate(0deg); opacity: 1; }
100% { transform: translateY(-150px) rotate(20deg); opacity: 0; }
}
/* Sparkle Trail */
.sparkle {
position: fixed; width: 6px; height: 6px; background: var(--blush-pink);
border-radius: 50%; pointer-events: none; z-index: 9999;
animation: fadeSparkle 0.6s linear forwards;
}
@keyframes fadeSparkle {
0% { transform: scale(1); opacity: 1; }
100% { transform: scale(2); opacity: 0; }
}
/* Floating Hearts */
.bg-hearts { pointer-events: none; z-index: -1; overflow: hidden; }
.bg-heart { position: absolute; color: var(--blush-pink); opacity: 0.4; animation: floatUp linear infinite; }
@keyframes floatUp {
0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
20%, 80% { opacity: 0.6; }
100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}
/* Layout & Sections */
.container { max-width: 800px; margin: 0 auto; padding: 0 20px; }
section {
padding: 80px 0;
opacity: 0;
transform: translateY(30px) scale(0.98);
transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
will-change: opacity, transform;
}
section.visible {
opacity: 1;
transform: translateY(0) scale(1);
}
/* Parallax Background Support */
#mini-games, #final-decision, #secret-section {
background-size: 100% 120%;
background-repeat: no-repeat;
background-position: center center;
will-change: background-position;
}
/* Breathing Animation */
@keyframes breathing {
0% { transform: scale(1); }
50% { transform: scale(1.005); }
100% { transform: scale(1); }
}
.card, .pickup-card, .game-wrapper, .think-card, .content-wrapper, .quiz-card, .secret-card, .comp-card {
background: white; border-radius: 20px; box-shadow: var(--shadow-soft);
transition: transform 0.3s ease, box-shadow 0.3s ease;
animation: breathing 6s ease-in-out infinite;
}
/* Pause breathing on hover */
.card:hover, .pickup-card:hover, .game-wrapper:hover, .think-card:hover, .content-wrapper:hover, .quiz-card:hover, .secret-card:hover, .comp-card:hover {
animation-play-state: paused;
transform: translateY(-5px) scale(1.02);
box-shadow: 0 15px 35px rgba(125, 78, 141, 0.2);
}
.card { padding: 30px; }
/* Hero */
#hero { min-height: 100vh; flex-direction: column; text-align: center; background: radial-gradient(circle, var(--light-peach) 0%, transparent 70%); display: flex; justify-content: center; align-items: center; }
#hero h1 { font-size: 5rem; color: var(--soft-rose); text-shadow: 2px 2px 0 rgba(255,255,255,0.8); animation: pulse 3s infinite ease-in-out; margin-bottom: 20px; }
#hero p { font-size: 1.5rem; max-width: 600px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
/* Appreciation */
#appreciation .content-wrapper { padding: 40px; border: 2px dashed var(--muted-lavender); position: relative; }
.tape { position: absolute; width: 120px; height: 35px; background: rgba(255,255,255,0.6); top: -15px; left: 50%; transform: translateX(-50%) rotate(-2deg); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
#appreciation p { font-size: 1.2rem; color: var(--text-charcoal); }
/* Open When Section (Envelope Style) */
#open-when { background: linear-gradient(to bottom, #FFF8F2, #fff0f6); }
.open-when-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; margin-top: 30px; }
.open-when-card {
width: 280px; height: 180px; position: relative; background: #fffcf8;
border: 1px solid #eee; border-radius: 5px;
box-shadow: 0 5px 15px rgba(0,0,0,0.08); cursor: pointer;
transition: transform 0.3s;
display: flex; align-items: flex-end; justify-content: center;
perspective: 1000px; z-index: 1;
}
.open-when-card:hover { transform: translateY(-5px); }
/* Envelope Visuals */
.envelope-body {
position: absolute; bottom: 0; left: 0; width: 100%; height: 100%;
background: var(--light-peach);
clip-path: polygon(0 0, 50% 40%, 100% 0, 100% 100%, 0 100%);
z-index: 3; pointer-events: none;
border-radius: 0 0 5px 5px;
}
.envelope-flap {
position: absolute; top: 0; left: 0; width: 100%; height: 50%;
background: #ffd6e0;
clip-path: polygon(0 0, 50% 100%, 100% 0);
transform-origin: top; transition: transform 0.6s ease, z-index 0.6s;
z-index: 4;
}
.envelope-bg {
position: absolute; inset: 0; background: white; border: 1px solid var(--blush-pink); z-index: 1; border-radius: 5px;
}
/* Content logic */
.letter-title {
font-weight: 700; color: var(--warm-plum); font-size: 1rem;
z-index: 5; position: absolute; bottom: 20px; width: 100%; text-align: center;
transition: opacity 0.3s; pointer-events: none;
}
.letter-paper {
position: absolute; bottom: 10px; left: 10px; right: 10px; top: 10px;
background: white; padding: 15px;
font-size: 0.9rem; color: var(--text-charcoal);
box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
transform: translateY(0); z-index: 2;
overflow-y: auto; display: flex; align-items: center; justify-content: center; text-align: center;
opacity: 0;
}
/* Open State */
.open-when-card.active { z-index: 10; }
.open-when-card.active .envelope-flap { transform: rotateX(180deg); z-index: 1; }
.open-when-card.active .letter-title { opacity: 0; }
.open-when-card.active .letter-paper { transform: translateY(-50px); opacity: 1; height: 180px; z-index: 5; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
/* Pickup Lines */
.pickup-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.pickup-card { background: var(--light-peach); padding: 25px; text-align: center; font-size: 1.1rem; border: 1px solid var(--blush-pink); }
.pickup-card:hover { background: var(--blush-pink); transform: scale(1.05) rotate(1deg); }
/* Quiz Section */
#quiz-section { background: var(--creamy-white); }
.quiz-container { max-width: 600px; margin: 0 auto; }
.quiz-card { padding: 30px; margin-bottom: 25px; border: 1px solid var(--light-peach); }
.quiz-question { font-weight: 700; color: var(--text-cocoa); font-size: 1.1rem; margin-bottom: 15px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-option {
padding: 10px; border: 1px solid var(--blush-pink); border-radius: 10px;
text-align: center; cursor: pointer; transition: background 0.2s; font-size: 0.9rem;
}
.quiz-option:hover { background: var(--light-peach); }
.quiz-option.selected { background: var(--soft-rose); color: white; border-color: var(--soft-rose); }
#quiz-result { text-align: center; font-size: 1.5rem; color: var(--soft-rose); margin-top: 30px; display: none; font-family: var(--font-hand); }
/* Compatibility Quiz */
#compatibility-section { background: var(--gradient-romantic); padding: 60px 0; }
.comp-card {
background: rgba(255, 255, 255, 0.95);
border-radius: 24px;
border: 1px solid var(--blush-pink);
box-shadow: 0 8px 25px rgba(125, 78, 141, 0.1);
padding: 40px;
max-width: 700px;
margin: 0 auto;
text-align: center;
}
.comp-option {
background: white; border: 1px solid var(--blush-pink); padding: 15px;
margin-bottom: 10px; border-radius: 15px; cursor: pointer;
transition: all 0.3s; font-size: 1rem; color: var(--text-charcoal);
}
.comp-option:hover { background: var(--light-peach); transform: translateX(5px); }
.comp-option.active { background: var(--soft-rose); color: white; border-color: var(--soft-rose); transform: scale(1.02); }
/* Reasons */
.reasons-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; }
.reason-item { background: white; width: 180px; height: 180px; border-radius: 50%; box-shadow: var(--shadow-soft); border: 4px solid var(--muted-lavender); transition: transform 0.4s; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.reason-item:hover { transform: translateY(-10px) scale(1.1); border-color: var(--soft-rose); }
.reason-icon { font-size: 2.5rem; margin-bottom: 10px; }
.reason-text { font-weight: 600; color: var(--warm-plum); }
/* Confession */
.letter { background: #fffcf8; padding: 50px; max-width: 700px; margin: 0 auto; box-shadow: 0 0 20px rgba(0,0,0,0.05); font-family: 'Nunito', sans-serif; font-size: 1.15rem; transform: rotate(-1deg); position: relative; }
.letter::before { content: ''; position: absolute; inset: 0; border: 1px solid var(--blush-pink); transform: translate(10px, 10px); z-index: -1; }
.signature { font-family: var(--font-hand); font-size: 2rem; margin-top: 30px; text-align: right; }
/* Mini Games */
#mini-games { background: var(--gradient-romantic); padding: 60px 0; }
.game-wrapper { padding: 30px; margin-bottom: 50px; text-align: center; position: relative; overflow: hidden; }
/* Memory */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; max-width: 400px; margin: 0 auto; perspective: 1000px; }
.memory-card { aspect-ratio: 1; cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform 0.6s; }
.memory-card.flip { transform: rotateY(180deg); }
.memory-card .face { position: absolute; inset: 0; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.memory-card .front { background: linear-gradient(135deg, var(--light-peach), var(--blush-pink)); font-size: 1.5rem; color: white; }
.memory-card .back { background: white; transform: rotateY(180deg); font-size: 2rem; border: 2px solid var(--blush-pink); }
/* Catcher */
.catcher-container { height: 350px; background: linear-gradient(to top, #fff5f8, #e8f5e9); border-radius: 15px; position: relative; overflow: hidden; cursor: none; border: 2px solid var(--muted-lavender); }
.catcher-player { width: 40px; height: 40px; background: rgba(231, 84, 128, 0.3); border: 2px solid var(--soft-rose); border-radius: 50%; position: absolute; transform: translate(-50%, -50%); pointer-events: none; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 15px var(--blush-pink); }
.catcher-heart { position: absolute; font-size: 1.5rem; animation: floatUpGame 4s linear forwards; }
@keyframes floatUpGame { to { transform: translateY(-380px); opacity: 0; } }
/* Overlays & Modals */
.overlay, .game-overlay, #landing-modal, #intro-overlay, #heartbeat-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 10; }
.game-overlay { background: rgba(255,255,255,0.95); }
.overlay, #landing-modal, #intro-overlay, #heartbeat-overlay { position: fixed; z-index: 2000; opacity: 0; pointer-events: none; transition: opacity 0.5s; }
.overlay.active, #landing-modal.visible { opacity: 1; pointer-events: all; }
/* Intro Overlay */
#intro-overlay {
z-index: 4000;
background: linear-gradient(135deg, #fff8f2, #ffe5ec, #f8c8dc);
background-size: 400% 400%;
animation: gradientBG 15s ease infinite;
opacity: 1;
pointer-events: all;
transition: opacity 1s ease-out;
}
@keyframes gradientBG {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
#intro-text {
font-family: var(--font-hand);
font-size: 2.5rem;
color: var(--warm-plum);
text-shadow: 0 0 20px rgba(231, 84, 128, 0.3);
text-align: center;
padding: 20px;
opacity: 0;
transform: scale(0.9);
transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}
@media (min-width: 768px) { #intro-text { font-size: 3.5rem; } }
/* Landing Modal */
#landing-modal { background: rgba(255,255,255,0.3); backdrop-filter: blur(10px); z-index: 3000; transition: opacity 1s; }
.modal-envelope { background: white; padding: 40px 30px; width: 90%; max-width: 500px; border-radius: 10px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.15); border-top: 5px solid var(--soft-rose); transform: scale(0.9); transition: transform 0.4s; }
#landing-modal.visible .modal-envelope { transform: scale(1); }
/* Buttons */
.btn, .game-btn, .modal-btn { border: none; padding: 10px 25px; font-size: 1.2rem; border-radius: 30px; cursor: pointer; font-family: var(--font-body); transition: transform 0.2s; }
.btn:hover, .game-btn:hover, .modal-btn:hover { transform: scale(1.05); }
.game-btn, .modal-btn { background: var(--soft-rose); color: white; }
.button-group { display: flex; gap: 40px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }
.btn-yes { background: var(--soft-rose); color: white; padding: 15px 50px; font-size: 1.5rem; box-shadow: 0 5px 25px rgba(231, 84, 128, 0.4); }
.btn-yes:hover { background: #d63d6b; transform: scale(1.1); }
.btn-think { background: var(--muted-lavender); color: white; padding: 15px 50px; font-size: 1.5rem; box-shadow: 0 5px 25px rgba(200, 162, 200, 0.4); }
.btn-think:hover { background: #b38cb3; transform: scale(1.05); }
/* Heartbeat Overlay */
#heartbeat-overlay { background: rgba(255, 248, 242, 0.95); z-index: 3500; transition: opacity 0.5s; opacity: 0; pointer-events: none; }
#heartbeat-overlay.active { opacity: 1; pointer-events: all; }
.pulsing-heart { font-size: 5rem; color: var(--soft-rose); animation: heartPulse 1.2s infinite; }
@keyframes heartPulse {
0% { transform: scale(1); }
15% { transform: scale(1.3); }
30% { transform: scale(1); }
45% { transform: scale(1.15); }
60% { transform: scale(1); }
100% { transform: scale(1); }
}
.heartbeat-text { margin-top: 20px; font-family: var(--font-hand); font-size: 2rem; color: var(--warm-plum); }
/* Final Decision */
#final-decision { min-height: 90vh; background: var(--gradient-romantic); padding-top: 100px; display: flex; flex-direction: column; align-items: center; position: relative; }
.custom-shape-divider-top { position: absolute; top: 0; width: 100%; overflow: hidden; line-height: 0; }
.custom-shape-divider-top svg { display: block; width: calc(133% + 1.3px); height: 80px; }
.custom-shape-divider-top .shape-fill { fill: #fff0f6; }
#final-decision h2 { font-size: 4rem; color: var(--soft-rose); margin-bottom: 20px; text-align: center; }
/* Secret Message Card */
#secret-section { display: none; padding-bottom: 80px; background: var(--gradient-romantic); width: 100%; }
.secret-card { background: white; border-radius: 20px; padding: 40px; box-shadow: var(--shadow-soft); border: 2px solid var(--blush-pink); text-align: center; position: relative; overflow: hidden; transition: all 0.8s ease; max-width: 600px; margin: 0 auto; transform: scale(0.95); opacity: 0.5; }
.secret-content { font-size: 1.2rem; color: var(--text-cocoa); filter: blur(8px); transition: filter 1.5s ease; opacity: 0.5; }
.lock-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; transition: opacity 1s ease; z-index: 2; }
.lock-icon { font-size: 3rem; margin-bottom: 10px; }
.lock-text { font-family: var(--font-body); font-weight: 600; color: var(--warm-plum); }
.secret-card.unlocked { transform: scale(1); opacity: 1; }
.secret-card.unlocked .secret-content { filter: blur(0); opacity: 1; }
.secret-card.unlocked .lock-overlay { opacity: 0; pointer-events: none; }
/* Success/Think Overlays */
#success-overlay { background: radial-gradient(circle, #fff0f5 0%, #ffe4e1 100%); text-align: center; transition: opacity 0.8s ease; }
#success-overlay.fade-out { opacity: 0; pointer-events: none; }
#success-overlay h2 { font-size: 5rem; color: var(--soft-rose); animation: popIn 0.8s; }
#think-overlay { background: radial-gradient(circle, #f3e5f5 0%, #e1bee7 100%); }
.think-card { padding: 40px; max-width: 600px; border: 2px solid var(--muted-lavender); text-align: center; }
@keyframes popIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (max-width: 600px) {
#hero h1 { font-size: 3.5rem; }
#pickup-lines h2, #reasons h2, #final-decision h2 { font-size: 2.5rem; }
.memory-grid { gap: 8px; }
.button-group { flex-direction: column; gap: 20px; width: 100%; padding: 0 20px; }
.btn-yes, .btn-think { width: 100%; }
.quiz-options { grid-template-columns: 1fr; }
#interest-meter { width: 140px; top: 10px; right: 10px; padding: 10px; }
.meter-title { font-size: 0.8rem; }
#sticker-panel { right: 10px; }
.sticker-btn { width: 40px; height: 40px; font-size: 1.2rem; }
}
</style>
</head>
<body class="no-scroll">
<div class="bg-hearts abs-fill" id="bg-hearts"></div>
<!-- Interest Meter -->
<div id="interest-meter">
<div class="meter-title">Curious 😊</div>
<div class="meter-bar">
<div class="meter-fill"></div>
</div>
</div>
<!-- Sticker Panel -->
<div id="sticker-panel">
<div class="sticker-btn" onclick="spawnSticker('💖')">💖</div>
<div class="sticker-btn" onclick="spawnSticker('✨')">✨</div>
<div class="sticker-btn" onclick="spawnSticker('🥺')">🥺</div>
<div class="sticker-btn" onclick="spawnSticker('🔥')">🔥</div>
</div>
<!-- Soft Cinematic Intro -->
<div id="intro-overlay">
<div id="intro-text"></div>
</div>
<!-- Heartbeat Sync Overlay -->
<div id="heartbeat-overlay">
<div class="pulsing-heart">❤️</div>
<div class="heartbeat-text">My heart’s been doing this for you...</div>
</div>
<!-- Landing Modal -->
<div id="landing-modal">
<div class="modal-envelope">
<div id="modal-initial">
<div style="font-size: 4rem; color: var(--soft-rose); margin-bottom: 20px;">💌</div>
<h2 id="modal-heading" style="font-size: 2rem; margin-bottom: 10px;">For You</h2>
<p>Before you scroll any further... I need to say this properly.</p>
<button class="modal-btn" id="open-letter-btn" style="margin-top: 25px;">Open the Letter ❤️</button>
</div>
<div class="letter-revealed" id="modal-text" style="display:none; animation: fadeIn 0.5s;">
<p id="modal-greeting">Hi there,</p>
<p id="landing-message" style="margin: 15px 0;">I created this little corner just for you...</p>
<p style="font-size: 0.9rem; font-style: italic; color: #888;">(And yes, I rehearsed this whole thing in my head about 17 times.)</p>
<button class="modal-btn" id="close-modal-btn" style="background: var(--muted-lavender); margin-top: 20px;">Okay, let's go ✨</button>
</div>
</div>
</div>
<!-- Main Content -->
<section id="hero" class="visible">
<div class="container">
<h1 id="hero-heading">For You ❤️</h1>
<p>A little corner of the internet, just for you.</p>
</div>
</section>
<section id="appreciation">
<div class="container">
<div class="content-wrapper">
<div class="tape"></div>
<h2 style="text-align: center; margin-bottom: 30px; font-size: 2.5rem;">To My Safe Space</h2>
<p id="appreciation-text" style="white-space: pre-line;">Loading appreciation...</p>
</div>
</div>
</section>
<!-- NEW: Open When Section -->
<section id="open-when" style="display:none;">
<div class="container">
<h2 style="text-align:center; font-size: 3rem; color: var(--warm-plum);">Open When...</h2>
<div class="open-when-grid" id="open-when-container">
<!-- Cards injected via JS -->
</div>
</div>
</section>
<section id="pickup-lines">
<div class="container">
<h2 style="text-align:center; margin-bottom:40px; font-size:3rem; color:var(--warm-plum)">Just to make you smile...</h2>
<div class="pickup-grid">
<div class="pickup-card">"Are you a camera? Because every time I look at you, I smile." 📸</div>
<div class="pickup-card">"Do you have a map? I keep getting lost in our conversations." 🗺️</div>
<div class="pickup-card">"Are you made of copper and tellurium? Because you're Cu-Te." 🧪</div>
<div class="pickup-card">"Is your name Wi-Fi? Because I'm feeling a really strong connection." 📶</div>
<div class="pickup-card">"I'm not a photographer, but I can definitely picture us together." 🖼️</div>
</div>
</div>
</section>
<section id="reasons">
<div class="container">
<h2 style="text-align:center; margin-bottom:40px; font-size:3rem">Why You're Special</h2>
<div class="reasons-container">
<div class="reason-item"><div class="reason-icon">☀️</div><div class="reason-text">Your Smile</div></div>
<div class="reason-item"><div class="reason-icon">💛</div><div class="reason-text">Your Kindness</div></div>
<div class="reason-item"><div class="reason-icon">👂</div><div class="reason-text">Understanding</div></div>
<div class="reason-item"><div class="reason-icon">✨</div><div class="reason-text">Positivity</div></div>
<div class="reason-item"><div class="reason-icon">🫂</div><div class="reason-text">Support</div></div>
</div>
</div>
</section>
<section id="confession">
<div class="container">
<div class="letter">
<h2 style="margin-bottom: 20px;">A Confession</h2>
<p id="confession-greeting">Dear ...</p>
<p id="confession-text" style="white-space: pre-line;">Loading confession...</p>
<div class="signature" id="signature">- ...</div>
</div>
</div>
</section>
<!-- NEW: Love Quiz Section (From Firebase) -->
<section id="quiz-section" style="display:none;">
<div class="container">
<h2 style="text-align:center; font-size: 3rem; color: var(--soft-rose); margin-bottom: 30px;">Just One Little Test...</h2>
<div class="quiz-container" id="quiz-container">
<!-- Quiz Cards injected via JS -->
</div>
<div id="quiz-result">Correct answer was always you. ❤️</div>
</div>
</section>
<section id="mini-games">
<div class="container">
<h2 style="text-align:center; font-size:3rem; color:var(--soft-rose)">Before the Final Question...</h2>
<p style="text-align:center; margin-bottom:50px">Let’s see if destiny agrees. ✨</p>
<div class="game-wrapper" id="memory-game-wrapper">
<h3 style="margin-bottom:20px; font-size:2rem; color:var(--warm-plum)">Memory of Us 💭</h3>
<div class="memory-grid" id="memory-grid"></div>
<div class="game-overlay" id="memory-overlay" style="display: none;">
<div class="game-message">
<span style="font-size: 3rem;">✨</span><br>
Looks like we make a perfect match.
<div style="font-size: 0.9rem; color: #888; margin-top: 10px;">(I promise I didn't rig this.)</div>
</div>
<div style="color: var(--soft-rose); font-weight: bold;">Completed! ❤️</div>
</div>
</div>
<div class="game-wrapper" id="catcher-game-wrapper">
<h3 style="margin-bottom:20px; font-size:2rem; color:var(--warm-plum)">Catch the Feelings 💌</h3>
<div class="catcher-container" id="catcher-area">
<div class="catcher-player" id="catcher-cursor"></div>
</div>
<div class="game-overlay" id="catcher-start-overlay">
<p class="game-message">Collect the hearts! <br>You have 30 seconds.</p>
<button class="game-btn" id="start-catcher-btn">Start Playing</button>
</div>
<div class="game-overlay" id="catcher-result-overlay" style="display: none;">
<div class="game-message" id="catcher-result-msg"></div>
<div style="color: var(--soft-rose); font-weight: bold;">Completed! ❤️</div>
</div>
<div style="position: absolute; top: 10px; right: 20px; font-weight: bold; color: var(--text-cocoa);">
Score: <span id="catcher-score">0</span> | Time: <span id="catcher-timer">30</span>s
</div>
</div>
<div class="final-cue" id="final-cue" style="display:none; text-align:center; margin-top:40px; opacity:0; transition:1s">
<h3 style="color: var(--warm-plum);">Okay… I think you’re ready for the final question. 👇</h3>
</div>
</div>
</section>
<!-- NEW: Compatibility Quiz Section -->
<section id="compatibility-section">
<div class="container">
<h2 style="text-align:center; font-size: 3rem; color: var(--warm-plum); margin-bottom: 20px;">Let’s See If We’re Meant To Be ✨</h2>
<div class="comp-card">
<div id="comp-q1">
<h3 style="margin-bottom:20px; color:var(--text-cocoa);">1. What's your idea of a perfect date? 🍷</h3>
<div class="comp-option" onclick="compSelect(1, 20)">A cozy movie night in 🎥</div>
<div class="comp-option" onclick="compSelect(1, 30)">A spontaneous road trip 🚗</div>
<div class="comp-option" onclick="compSelect(1, 25)">A fancy dinner under the stars ✨</div>
</div>
<div id="comp-q2" style="display:none;">
<h3 style="margin-bottom:20px; color:var(--text-cocoa);">2. How do you handle my bad jokes? 🤡</h3>
<div class="comp-option" onclick="compSelect(2, 25)">Laugh even if they hurt 😂</div>
<div class="comp-option" onclick="compSelect(2, 30)">Roast me right back 🔥</div>
<div class="comp-option" onclick="compSelect(2, 20)">Roll your eyes playfully 🙄</div>
</div>
<div id="comp-q3" style="display:none;">
<h3 style="margin-bottom:20px; color:var(--text-cocoa);">3. What matters most to us? ❤️</h3>
<div class="comp-option" onclick="compSelect(3, 35)">Trust & Honesty 🤝</div>
<div class="comp-option" onclick="compSelect(3, 30)">Fun & Adventure 🎢</div>
<div class="comp-option" onclick="compSelect(3, 35)">Growing Together 🌱</div>
</div>
</div>
</div>
</section>
<section id="final-decision">
<div class="custom-shape-divider-top">
<svg viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z" class="shape-fill"></path></svg>
</div>
<div class="container">
<h2>Will You Be My Valentine?</h2>
<div class="button-group">
<button class="btn btn-yes" id="yes-btn">YES ❤️</button>
<button class="btn btn-think" id="think-btn">Let Me Think 😊</button>
</div>
</div>
</section>
<!-- NEW: Secret Locked Message Section -->
<section id="secret-section">
<div class="container">
<div class="secret-card" id="secret-card">
<div class="lock-overlay">
<div class="lock-icon">🔒</div>
<div class="lock-text">Something special is locked...</div>
</div>
<div class="secret-content" id="secret-content">
If you said yes... I promise I’ll never stop choosing you.
</div>
</div>
</div>
</section>
<div class="overlay" id="success-overlay">
<h2 id="success-title">She Said Yes! 💖</h2>
<p id="success-message">You've made me the happiest person.</p>
<p style="font-size:1.3rem; margin-top:30px; opacity:0.9;">(Okay, I promise I won’t act cool about this. I’m internally screaming. Check your phone, I might be calling you right now! 😉)</p>
<canvas id="confetti-canvas" class="abs-fill"></canvas>
</div>
<div class="overlay" id="think-overlay">
<div class="think-card">
<h2>Take Your Time 🌿</h2>
<p>That’s completely okay. You mean too much to me to rush anything.</p>
<p>Your comfort matters more than my answer.</p>
<p style="margin-top: 20px; font-size: 1rem; color: #888;">(I’ll just pretend to be calm meanwhile. No pressure, seriously.)</p>
</div>
</div>
<script src="https://www.gstatic.com/firebasejs/9.22.2/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.22.2/firebase-database-compat.js"></script>
<script>
const $ = id => document.getElementById(id);
const $$ = sel => document.querySelectorAll(sel);
// --- Progress Meter Logic ---
let progress = 0;
const checkpoints = { modal: false, appreciation: false, openWhen: false, quiz: false, games: false };
let quizOverrideScore = 0;
const updateLove = () => {
let p = 0;
if (checkpoints.modal) p += 20;
if (checkpoints.appreciation) p += 20;
if (checkpoints.openWhen) p += 20;
if (checkpoints.quiz) p += 20;
if (checkpoints.games) p += 20;
// If compatibility quiz is active, use that for text override, but base fill on progress
// However, the prompt asks to update the meter dynamically based on the quiz score.
// Let's blend them: The bar fills with progress, but text reacts to quiz score if present.
if(p > 100) p = 100;
const fill = document.querySelector('.meter-fill');
const title = document.querySelector('.meter-title');
if(fill) fill.style.width = p + '%';
let text = "Curious 😊";
if (quizOverrideScore > 0) {
if (quizOverrideScore >= 90) text = "Soulmates Energy 💞";
else if (quizOverrideScore >= 70) text = "Strong Chemistry ✨";
else if (quizOverrideScore >= 50) text = "Something Special 💗";
else text = "Plot Twist Romance 😉";
} else {
if (p > 80) text = "Fully Interested 😍";
else if (p > 60) text = "Heart Racing 💓";
else if (p > 40) text = "Feeling It ✨";
else if (p > 20) text = "Smiling 💕";
}
if(title) {
title.style.opacity = 0;
setTimeout(() => {
title.textContent = text;
title.style.opacity = 1;
}, 150);
}
};
// --- Cinematic Multi-Step Intro ---
const introText = $('intro-text');
const introOverlay = $('intro-overlay');
const modal = $('landing-modal');
const messages = ["Hey...", "I made something for you.", "Just wait a second..."];
let msgIdx = 0;
function playIntro() {
if (msgIdx < messages.length) {
// Fade out old (if any, though initially opacity is 0 in CSS, we handle it here)
introText.style.opacity = 0;
introText.style.transform = "scale(0.9)";
setTimeout(() => {
// Change text and fade in new
introText.textContent = messages[msgIdx];
introText.style.opacity = 1;
introText.style.transform = "scale(1)";
msgIdx++;
// Duration to stay on screen before fading out next
setTimeout(playIntro, 2500);
}, 1000); // Wait for fade out transition (1s)
} else {
// Done sequence
setTimeout(() => {
introOverlay.style.opacity = 0;
setTimeout(() => {
introOverlay.style.display = 'none';
modal.classList.add('visible');
document.body.classList.add('no-scroll');
}, 1000);
}, 500);
}
}
playIntro();
// --- Sticker Logic ---
function spawnSticker(emoji) {
const s = document.createElement('div');
s.className = 'floating-sticker';
s.innerText = emoji;
// Randomize start X slightly around the button press if possible,
// but fixed panel makes it easier to just spawn near bottom right.
const panel = $('sticker-panel');
const rect = panel.getBoundingClientRect();
// Randomize position slightly to left of panel
const randomX = Math.random() * 50 + 20;
s.style.right = (rect.width + randomX) + 'px';
s.style.top = (Math.random() * (window.innerHeight - 200) + 100) + 'px';
document.body.appendChild(s);
// Limit stickers
const stickers = document.querySelectorAll('.floating-sticker');
if(stickers.length > 15) stickers[0].remove();
setTimeout(() => s.remove(), 2000);
}
// --- Compatibility Quiz Logic ---
let compScore = 0;
function compSelect(qNum, points) {
compScore += points;
// Highlight selected
const currentDiv = document.getElementById('comp-q' + qNum);
// Hide current, show next
setTimeout(() => {
currentDiv.style.display = 'none';
const next = document.getElementById('comp-q' + (qNum + 1));
if(next) {
next.style.display = 'block';
next.style.animation = 'fadeIn 0.5s';
} else {
// Finished
quizOverrideScore = compScore; // Trigger meter text override
updateLove();
const card = document.querySelector('.comp-card');
card.innerHTML = `<h3 style="font-size:2rem; color:var(--soft-rose);">Score: ${compScore}% ❤️</h3><p>I knew we were a match.</p>`;
}
}, 300);
// Simulate immediate meter reaction
quizOverrideScore = compScore;
updateLove();
}
// --- Hearts ---
for(let i=0; i<15; i++) {
let h = document.createElement('div');
h.className = 'bg-heart'; h.innerHTML = '❤';
h.style.left = Math.random()*100+'vw';
h.style.fontSize = (Math.random()*2+1)+'rem';
h.style.animationDuration = (Math.random()*10+10)+'s';
h.style.animationDelay = (Math.random()*5)+'s';
$('bg-hearts').appendChild(h);
}
// --- Modal & Scroll ---
$('open-letter-btn').onclick = () => { $('modal-initial').style.display = 'none'; $('modal-text').style.display = 'block'; playMusicWithFade();};
$('close-modal-btn').onclick = () => {
$('landing-modal').classList.remove('visible');
document.body.classList.remove('no-scroll');
checkpoints.modal = true; updateLove();
};
const obs = new IntersectionObserver(e => e.forEach(en => {
if (en.isIntersecting) {
en.target.classList.add('visible');
if(en.target.id === 'appreciation' && !checkpoints.appreciation) {
checkpoints.appreciation = true; updateLove();
}
}
}), {threshold:0.15});
$$('section').forEach(s => s.id !== 'hero' && obs.observe(s));
// --- Heartbeat Logic (Web Audio API) ---
function playHeartbeat() {
const ctx = new (window.AudioContext || window.webkitAudioContext)();
const now = ctx.currentTime;
const masterGain = ctx.createGain();
masterGain.connect(ctx.destination);
masterGain.gain.setValueAtTime(0.8, now); // 🔊 Increase volume (0.3 → 0.8)
function thud(time, freq, duration) {
const osc = ctx.createOscillator();
const gain = ctx.createGain();
osc.type = "sine";
osc.frequency.setValueAtTime(freq, time);
osc.frequency.exponentialRampToValueAtTime(freq * 0.6, time + duration);
gain.gain.setValueAtTime(1, time);
gain.gain.exponentialRampToValueAtTime(0.01, time + duration);
osc.connect(gain);
gain.connect(masterGain);
osc.start(time);
osc.stop(time + duration);
}
const pairCount = 4; // number of heart pairs
const pairInterval = 1.1; // gap between pairs
const shortGap = 0.15; // gap inside pair (between lub & dub)
for (let i = 0; i < pairCount; i++) {
const baseTime = now + i * pairInterval;
// LUB (longer)
thud(baseTime, 65, 0.18);
// DUB (slightly shorter, 50ms less)
thud(baseTime + shortGap, 55, 0.13);
}
// Close audio context after playback
setTimeout(() => ctx.close(), pairCount * pairInterval * 1000 + 500);
}
// --- Games ---
let gamesDone = 0;
const markDone = () => {
gamesDone++;
if (gamesDone >= 2) {
checkpoints.games = true; updateLove();
// Heartbeat sync moment
setTimeout(() => {
const hbOverlay = $('heartbeat-overlay');
hbOverlay.classList.add('active');
document.body.classList.add('no-scroll');
playHeartbeat();
setTimeout(() => {
hbOverlay.classList.remove('active');
document.body.classList.remove('no-scroll');
$('final-cue').style.display = 'block';
setTimeout(() => $('final-cue').style.opacity = 1, 100);
}, 4000);
}, 500);
}
};
// Memory
const icons = ['💛', '🌸', '✨', '🫂', '🌙', '☕', '❤️', '🌻'];
const cards = [...icons, ...icons].sort(() => 0.5 - Math.random());
let mGrid = $('memory-grid'), flipped = [], mPairs = 0;
cards.forEach(icon => {
let c = document.createElement('div');
c.className = 'memory-card';
c.innerHTML = `<div class="face front">?</div><div class="face back">${icon}</div>`;
c.onclick = () => {
if(flipped.length < 2 && !c.classList.contains('flip') && !flipped.includes(c)) {
c.classList.add('flip');
flipped.push(c);
if(flipped.length === 2) {
let [a, b] = flipped;
if(a.innerHTML === b.innerHTML) {
flipped = []; if(++mPairs === 8) setTimeout(() => { $('memory-overlay').style.display='flex'; markDone(); }, 500);
} else {
setTimeout(() => { a.classList.remove('flip'); b.classList.remove('flip'); flipped = []; }, 1000);
}
}
}
};
mGrid.appendChild(c);
});
// Catcher
const cArea = $('catcher-area'), cCursor = $('catcher-cursor');
let cScore = 0, cTime = 30, cActive = false, cInt, sInt;
const moveC = (x, y) => {
if(!cActive) return;
let r = cArea.getBoundingClientRect();
cCursor.style.left = Math.max(0, Math.min(x - r.left, r.width)) + 'px';
cCursor.style.top = Math.max(0, Math.min(y - r.top, r.height)) + 'px';
$$('.catcher-heart').forEach(h => {
let hr = h.getBoundingClientRect(), d = Math.hypot((x - r.left) - (hr.left - r.left + hr.width/2), (y - r.top) - (hr.top - r.top + hr.height/2));
if(d < 40) { h.remove(); $('catcher-score').innerText = ++cScore; }
});
};
cArea.onmousemove = e => moveC(e.clientX, e.clientY);
cArea.ontouchmove = e => { e.preventDefault(); moveC(e.touches[0].clientX, e.touches[0].clientY); };
$('start-catcher-btn').onclick = () => {
$('catcher-start-overlay').style.display = 'none'; cActive = true;
sInt = setInterval(() => {
let h = document.createElement('div'); h.className='catcher-heart'; h.innerHTML='❤️';
h.style.left = Math.random()*90+'%'; h.style.top='100%';
cArea.appendChild(h); setTimeout(() => h.remove(), 4000);
}, 600);
cInt = setInterval(() => {
$('catcher-timer').innerText = --cTime;
if(cTime <= 0) {
clearInterval(cInt); clearInterval(sInt); cActive = false;
$$('.catcher-heart').forEach(h => h.remove());
let msg = "";
if (cScore > 20) msg = "Okay… clearly the chemistry is strong. ⚡";
else if (cScore > 10) msg = "Not bad. We’re getting there. 😉";
else msg = "That’s fine. I’ll try harder. 🥺";
$('catcher-result-msg').innerText = msg;
$('catcher-result-overlay').style.display = 'flex'; markDone();
}
}, 1000);
};
// --- Interaction ---
$('think-btn').onclick = () => { $('think-overlay').classList.add('active'); document.body.classList.add('no-scroll'); };
$('yes-btn').onclick = () => {
$('success-overlay').classList.add('active');
document.body.classList.add('no-scroll');
startConfetti();
// Allow scrolling after 3 seconds
setTimeout(() => {
$('success-overlay').classList.add('fade-out');
document.body.classList.remove('no-scroll');
// Unlock secret message
const secretCard = $('secret-card');
if(secretCard) {
secretCard.classList.add('unlocked');
setTimeout(() => {
secretCard.scrollIntoView({behavior: 'smooth', block: 'center'});
}, 1000);
}
}, 3000);
};
// --- Confetti ---
const cvs = $('confetti-canvas'), ctx = cvs.getContext('2d'), parts = [];
const resize = () => { cvs.width = window.innerWidth; cvs.height = window.innerHeight; };
window.onresize = resize; resize();
const startConfetti = () => {
const cols = ['#F8C8DC', '#E75480', '#C8A2C8'];
const loop = () => {
ctx.clearRect(0,0,cvs.width,cvs.height);
if(parts.length < 150) parts.push({x: Math.random()*cvs.width, y: -10, s: Math.random()*8+4, c: cols[Math.floor(Math.random()*3)], dx: Math.random()*2-1, dy: Math.random()*3+2, r: Math.random()*360});
parts.forEach((p, i) => {
p.y += p.dy; p.x += Math.sin(p.y*0.01) + p.dx; p.r += 2;
ctx.save(); ctx.translate(p.x, p.y); ctx.rotate(p.r * Math.PI/180);
ctx.fillStyle = p.c; ctx.fillRect(-p.s/2, -p.s/2, p.s, p.s);
ctx.restore();
if(p.y > cvs.height) parts[i] = {x: Math.random()*cvs.width, y: -10, s: p.s, c: p.c, dx: p.dx, dy: p.dy, r: p.r};
});
requestAnimationFrame(loop);
};
loop();
};
// --- Sparkle Trail ---
let lastSparkle = 0;
document.addEventListener('mousemove', (e) => {
const now = Date.now();
if (now - lastSparkle < 50) return;
lastSparkle = now;
if (document.querySelectorAll('.sparkle').length > 20) return;
const s = document.createElement('div');
s.className = 'sparkle';
s.style.left = e.clientX + 'px';
s.style.top = e.clientY + 'px';
document.body.appendChild(s);
setTimeout(() => s.remove(), 600);
});
// --- Parallax Effect ---
const parallaxSections = document.querySelectorAll('#mini-games, #final-decision, #secret-section');
let ticking = false;
function updateParallax() {
// Disable on mobile/touch
if (window.innerWidth < 768 || window.matchMedia('(pointer: coarse)').matches) {
return;
}
const scrollY = window.scrollY;
const windowHeight = window.innerHeight;
parallaxSections.forEach(sec => {
const rect = sec.getBoundingClientRect();
const center = windowHeight / 2;
const secCenter = rect.top + (rect.height / 2);
// Calculate distance from center of viewport
const dist = secCenter - center;
// Only animate if somewhat visible
if (rect.top < windowHeight && rect.bottom > 0) {
// Subtle movement (max 40px)
const speed = 0.05;
const offset = dist * speed * -1; // Invert for depth