-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.html
More file actions
888 lines (779 loc) · 34.3 KB
/
test.html
File metadata and controls
888 lines (779 loc) · 34.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>4SP - HOME</title>
<link rel="stylesheet" href="css/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<script src="/panic-key.js"></script>
<script src="/url-changer.js"></script>
<style>
/* This inline style ensures the links are hidden by default before JS loads */
.logged-in-link, .logged-out-link {
display: none;
}
/* --- STICKY FOOTER & BODY STYLES --- */
html, body {
height: 100%;
}
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
main {
flex-grow: 1;
}
/* A class to prevent scrolling when an overlay is active */
body.no-scroll {
overflow: hidden;
}
/* --- DEVELOPMENT DISCLAIMER STYLES --- */
#development-disclaimer-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.75);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
z-index: 10000; /* Highest z-index to be on top of everything */
display: none; /* Hidden by default; shown by JS */
justify-content: center;
align-items: center;
font-family: 'SecondaryFont', sans-serif;
padding: 15px;
box-sizing: border-box;
}
.disclaimer-box {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.18);
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
/* CHANGE: Reduced padding for the box to 20px */
padding: 20px;
text-align: center;
max-width: 580px;
color: #fff;
}
#disclaimer-title {
margin-top: 0;
margin-bottom: 35px;
font-size: 2.2em;
text-transform: uppercase;
font-family: 'PrimaryFont', sans-serif;
color: #fff;
position: relative;
transform-style: preserve-3d;
perspective: 800px;
text-shadow: 0 1px 0 #ccc,
0 2px 0 #c9c9c9,
0 3px 0 #bbb,
0 4px 0 #b9b9b9,
0 5px 0 #aaa,
0 6px 1px rgba(0,0,0,.1),
0 0 5px rgba(0,0,0,.1),
0 1px 3px rgba(0,0,0,.3),
0 3px 5px rgba(0,0,0,.2),
0 5px 10px rgba(0,0,0,.25),
0 10px 10px rgba(0,0,0,.2),
0 20px 20px rgba(0,0,0,.15);
}
.disclaimer-box p {
font-size: 1.1em;
/* Less line spacing for paragraphs for better density */
line-height: 1.3;
margin-bottom: 15px;
text-align: left;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.disclaimer-button-group {
display: flex;
justify-content: center;
align-items: center;
gap: 15px;
margin-top: 20px;
flex-wrap: wrap; /* Allows buttons to stack on smaller screens */
}
#disclaimer-continue-btn, #disclaimer-form-btn {
/* CHANGE: Unified padding for both buttons */
padding: 14px 28px;
border: none;
border-radius: 12px;
color: #fff;
font-family: 'PrimaryFont', sans-serif;
font-weight: 700;
text-transform: uppercase;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
font-size: 1em; /* Unified font size */
text-decoration: none; /* For the <a> tag */
display: inline-block; /* For the <a> tag */
}
#disclaimer-continue-btn {
background-color: #7b2ff7;
}
#disclaimer-continue-btn:hover {
background-color: #6720BD;
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
/* UPDATED STYLES for Complete Form Button */
#disclaimer-form-btn {
/* CHANGE: Bluish color */
background-color: #007bff;
}
#disclaimer-form-btn:hover {
background-color: #0056b3; /* Darker bluish hover */
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
/* --- MOBILE ASPECT RATIO WARNING STYLES --- */
#mobile-warning-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
z-index: 9999;
display: none;
justify-content: center;
align-items: center;
font-family: 'PrimaryFont', sans-serif;
padding: 15px;
box-sizing: border-box;
}
.warning-box {
background-color: #ffffff;
padding: 30px 40px;
border-radius: 10px;
text-align: center;
max-width: 450px;
box-shadow: 0 5px 25px rgba(0,0,0,0.25);
color: #333;
}
.warning-box h2 {
margin-top: 0;
font-size: 1.8em;
text-transform: uppercase;
}
.warning-box p {
font-size: 1.05em;
line-height: 1.6;
margin-bottom: 25px;
}
#continue-btn {
padding: 12px 25px;
border: none;
border-radius: 8px;
background-color: #6720BD;
color: #fff;
font-family: 'PrimaryFont', sans-serif;
font-weight: 700;
text-transform: uppercase;
cursor: pointer;
transition: background-color 0.3s ease;
}
#continue-btn:hover {
background-color: #4b138f;
}
/* --- STYLES FOR VERSION HISTORY, WHAT'S NEW, & FOOTER --- */
.timeline-section, .whats-new-section {
padding: 80px 0;
text-align: center;
}
.whats-new-section {
padding: 60px 0;
}
.timeline-section {
border-top: 1px solid #eee;
}
.whats-new-section {
border-top: 1px solid #eee;
}
.timeline-section h2, .whats-new-section h2 {
font-size: 2.8em;
margin-bottom: 20px;
color: #333;
text-transform: uppercase;
font-family: 'PrimaryFont', sans-serif;
font-weight: 700;
}
.whats-new-content {
max-width: 950px;
margin: 40px auto 0 auto;
text-align: left;
}
.whats-new-content p {
font-size: 1.05em;
font-style: italic;
line-height: 1.6;
color: #555;
}
footer {
background-color: #f8f8f8;
color: #777;
text-align: center;
padding: 20px 0;
border-top: 1px solid #eee;
}
/* --- STYLES FOR VERSION HISTORY TIMELINE --- */
.timeline-container {
position: relative;
width: 100%;
margin: 60px 0;
}
.timeline-wrapper {
display: flex;
justify-content: space-around;
align-items: center;
position: relative;
}
.timeline-wrapper::before {
content: '';
position: absolute;
top: 50%;
left: 12%;
right: 12%;
height: 2px;
background-color: #e0e0e0;
transform: translateY(-50%);
z-index: 1;
}
.timeline-item {
text-align: center;
position: relative;
z-index: 2;
cursor: pointer;
}
.timeline-item .timeline-circle {
display: block;
width: 30px;
height: 30px;
border-radius: 50%;
margin: 0 auto 15px auto;
transition: transform 0.3s ease, box-shadow 0.3s ease;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.timeline-item:hover .timeline-circle {
transform: scale(1.2);
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.timeline-item:nth-child(1) .timeline-circle { background-image: linear-gradient(45deg, #434343 0%, #000000 100%); }
.timeline-item:nth-child(2) .timeline-circle { background-image: linear-gradient(45deg, #87CEEB 0%, #4285F4 100%); }
.timeline-item:nth-child(3) .timeline-circle { background-image: linear-gradient(45deg, #FEE140 0%, #FA709A 100%); }
.timeline-item:nth-child(4) .timeline-circle { background-image: linear-gradient(45deg, #8820bd 0%, #6720BD 100%); }
.timeline-item-content h3, .timeline-item-content p {
margin: 0;
padding: 0;
}
.timeline-item-content h3 {
font-size: 1.1em;
margin-bottom: 4px;
padding-top: 10px;
}
.timeline-item-content p {
font-size: 0.9em;
color: #666;
}
/* --- MODAL STYLES FOR TIMELINE --- */
.modal-backdrop {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
z-index: 1000;
opacity: 0;
transition: opacity 0.4s ease;
}
.version-modal {
display: none;
position: absolute;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
z-index: 1001;
overflow: hidden;
}
.version-modal.has-gradient-bg {
color: #fff;
}
.modal-inner-content {
opacity: 0;
height: 100%;
overflow-y: auto;
box-sizing: border-box;
padding: 25px 30px;
}
.modal-backdrop.show {
display: block;
opacity: 1;
}
.version-modal.visible {
display: block;
}
.modal-inner-content .close-btn {
position: absolute;
top: 10px;
right: 15px;
font-size: 2em;
color: #aaa;
background: none;
border: none;
cursor: pointer;
}
.version-modal.has-gradient-bg .modal-inner-content .close-btn {
color: #eee;
}
.modal-inner-content .close-btn:hover {
color: #333;
}
.version-modal.has-gradient-bg .modal-inner-content .close-btn:hover {
color: #fff;
}
.modal-inner-content h3 {
font-family: 'PrimaryFont', sans-serif;
text-transform: uppercase;
margin-top: 0;
margin-bottom: 20px;
}
.modal-inner-content p {
font-style: normal;
font-size: 1em;
line-height: 1.6;
margin-bottom: 10px;
}
#modalDescription {
font-size: 0.9em;
font-style: italic;
}
#modalStartDate,
#modalCreationDate {
font-family: 'PrimaryFont', sans-serif;
font-weight: 700;
}
.modal-inner-content p strong {
color: #333;
}
.version-modal.has-gradient-bg .modal-inner-content p strong {
color: #fff;
}
.modal-redirect-btn {
display: inline-block;
padding: 10px 20px;
border-radius: 8px;
background-color: #6720BD;
color: #fff;
text-decoration: none;
font-weight: bold;
margin-top: 20px;
float: right;
transition: background-color 0.3s ease;
font-family: 'PrimaryFont', sans-serif;
font-weight: 700;
text-transform: uppercase;
}
.modal-redirect-btn:hover {
background-color: #4b138f;
}
</style>
<script src="https://www.gstatic.com/firebasejs/9.6.10/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.6.10/firebase-auth-compat.js"></script>
<script src="firebase-config.js"></script>
<script src="../panic-key.js"></script>
</head>
<body>
<div id="development-disclaimer-overlay">
<div class="disclaimer-box">
<h2 id="disclaimer-title">A Note on Future Development</h2>
<p><strong>hello humans</strong> i am currently starting development on <strong>Version 5 of 4SP</strong>, also known as <strong>Project Zirconium</strong>.</p>
<p>As a result, this current version (v4) will remain online but will no longer be actively updated or accept new requests. The decision to move forward comes from the current design being cluttered, difficult to maintain, and plagued with various bugs that some cool update will solve.</p>
<p>For long-time users, think of this update as being similar in scale to the transition from Version 2 to Version 3, but this will be a much more meticulous and comprehensive overhaul that will naturally take longer to complete. Thank you for your understanding and continued support!</p>
<div class="disclaimer-button-group">
<button id="disclaimer-continue-btn">I Understand</button>
<a href="https://forms.gle/BrWamQPsv2wDLAL58" target="_blank" rel="noopener noreferrer" id="disclaimer-form-btn">Complete Form</a>
</div>
</div>
</div>
<main>
<section class="hero-section dark-bg">
<div class="container">
<h1>4SIMPLEPROBLEMS</h1>
</div>
</section>
<header class="main-header light-bg">
<div class="container">
<div class="logo">
<img src="images/logo-dark.png" alt="4SP Logo">
</div>
<nav class="main-nav">
<ul id="mainNavLinks">
<li class="dropdown" id="more-dropdown">
<a class="dropbtn">MORE</a>
</li>
<li class="logged-in-link"><a href="logged-in/dashboard.html">DASHBOARD</a></li>
</ul>
</nav>
<div class="auth-buttons" id="authButtons">
</div>
</div>
</header>
<section class="news-bar light-bg">
<div class="container">
<p>Fast. Secure. Yours.</p>
</div>
</section>
<section class="hp-infra-section light-bg">
<div class="container">
<h2>Over 150 users, and counting.</h2>
<p>Engage in uneducational games, modify your experience, and escape reality.</p>
</div>
</section>
<section class="info-sections light-bg">
<div class="container">
<div class="info-item left-image">
<div class="info-content"><h3>ABOUT US</h3><p>We are the perfect website to have fun during boring school hours, disrupt everyone that hates these sounds, and to play some games when you have your work done, or don't. I don't care fr.</p></div>
</div>
<div class="info-item right-image">
<div class="info-content"><h3>SOUNDBOARD</h3><p>Unleash a barrage of sounds to playfully annoy your teachers. Perfect for those moments when you need a little mischief. your teachers will actually become "😡" right to your face.</p></div>
</div>
<div class="info-item left-image">
<div class="info-content"><h3>OTHER STUFF</h3><p>We have a lot of other features implemented, like an entirely redesigned requests page, playlists page, and other stuff that i felt like adding bc i have free will</p></div>
</div>
<div class="info-item right-image">
<div class="info-content"><h3>THIS WEBSITE'S GOALS</h3><p>The goals for this website is to make the best, most fun experience for students that don't care about their academic grade, or who just don't care at all. I hate ads, and I love seeing the number of users go up. Alright?</p></div>
</div>
<div class="info-item left-image">
<div class="info-content"><h3>A NOTE ON PROXIES</h3><p>As a personal project without any income, I unfortunately cannot continue to manage and support the proxy servers. The costs and effort required are significant, especially while also working to support new features and fulfill all of your requests. The proxy services have been archived for now. I sincerely apologize for this inconvenience.</p></div>
</div>
</div>
</section>
<section class="timeline-section light-bg">
<div class="container">
<h2>VERSION HISTORY</h2>
<div class="timeline-container">
<div class="timeline-wrapper">
<div class="timeline-item" onclick="showVersionDetails('v1', event)">
<div class="timeline-circle"></div>
<div class="timeline-item-content">
<h3>Version 1</h3>
<p>March 13th, 2025</p>
</div>
</div>
<div class="timeline-item" onclick="showVersionDetails('v2', event)">
<div class="timeline-circle"></div>
<div class="timeline-item-content">
<h3>Version 2</h3>
<p>April 11th, 2025</p>
</div>
</div>
<div class="timeline-item" onclick="showVersionDetails('v3', event)">
<div class="timeline-circle"></div>
<div class="timeline-item-content">
<h3>Version 3</h3>
<p>May 14th, 2025</p>
</div>
</div>
<div class="timeline-item" onclick="showVersionDetails('v4', event)">
<div class="timeline-circle"></div>
<div class="timeline-item-content">
<h3>Version 4</h3>
<p>August 23rd, 2025</p>
</div>
</div>
</div>
</div>
</div>
</section>
<section class="whats-new-section light-bg">
<div class="container">
<h2>WHAT'S NEW</h2>
<div class="whats-new-content">
<p>
V4 is a massive overhaul focused on security and fun. Accounts are more secure than ever, and we're now verified with Google, so the official logo and title appear when you sign in instead of a generic Firebase URL. The new 'Games' section is packed with curated sites modified for 4SP like StrongdogXP and GN-Math, alongside standalone classics like the original DOOM and Eaglercraft. This is all on top of the redesigned dashboard, enhanced soundboard, and more secure account options. Have fun ig
</p>
</div>
</div>
</section>
</main>
<footer>
<div class="container">
<p>© 2025 4SP. All rights reserved.</p>
</div>
</footer>
<div id="mobile-warning-overlay">
<div class="warning-box">
<h2>Desktop Recommended</h2>
<p>This website is best viewed on a desktop or in landscape mode. Some features may not work as expected on a mobile device.</p>
<button id="continue-btn">Continue Anyway</button>
</div>
</div>
<div id="versionModalBackdrop" class="modal-backdrop"></div>
<div id="versionModal" class="version-modal">
<div id="modalInnerContent" class="modal-inner-content">
<button id="closeModalBtn" class="close-btn">×</button>
<h3 id="modalTitle"></h3>
<p id="modalStartDate"></p>
<p id="modalCreationDate"></p>
<p id="modalDescription"></p>
<a id="modalRedirectBtn" href="#" target="_blank" rel="noopener noreferrer" class="modal-redirect-btn">Visit Version</a>
</div>
</div>
<div class="dropdown-content" id="more-menu-content">
<div class="dropdown-header">MORE</div>
<hr class="dropdown-divider">
<a href="the-story.html">THE STORY</a>
<a href="legal.html">LEGAL</a>
<a href="https://buymeacoffee.com/4simpleproblems" target="_blank" rel="noopener noreferrer">DONATE</a>
</div>
<script>
// --- TIMELINE MODAL SCRIPT ---
const versionDetails = {
v1: {
title: 'Version 1 Details',
startDate: '<strong>Started:</strong> March 8th, 2025',
creationDate: '<strong>Released:</strong> March 13th, 2025',
description: 'This was the initial launch of 4SP. It was a simple page with a basic soundboard and requests page. The foundation of 4SP was laid here.',
url: 'https://4simpleproblems.github.io/v1'
},
v2: {
title: 'Version 2 Details',
startDate: '<strong>Started:</strong> March 21th, 2025',
creationDate: '<strong>Released:</strong> April 11th, 2025',
description: 'Version 2 introduced many more pages, like experimental music, games, etc. The design was updated to be pill shaped, rounded and user-friendly.',
url: 'https://4simpleproblems.github.io/v2'
},
v3: {
title: 'Version 3 Details',
startDate: '<strong>Started:</strong> May 7th, 2025',
creationDate: '<strong>Released:</strong> May 14th, 2025',
description: 'This version focused on expanding the features, adding playlists, which was in beta, and improving the overall performance. The website had a redesign of a white, unrounded theme.',
url: 'https://4simpleproblems.github.io/v3'
},
v4: {
title: 'Version 4 Details',
startDate: '<strong>Started:</strong> May 26th, 2025',
creationDate: '<strong>Released:</strong> August 23rd, 2025',
description: 'The current version. A complete overhaul with a focus on security, fun, and new content like the Games section. The UI was completely redesigned.',
url: '#'
}
};
const modal = document.getElementById('versionModal');
const backdrop = document.getElementById('versionModalBackdrop');
const closeModalBtn = document.getElementById('closeModalBtn');
let activeCircle = null;
let activeModal = false;
function showVersionDetails(versionKey, event) {
if (activeModal) return;
activeModal = true;
const details = versionDetails[versionKey];
activeCircle = event.currentTarget.querySelector('.timeline-circle');
if (!details || !activeCircle) {
activeModal = false;
return;
}
const initialRect = activeCircle.getBoundingClientRect();
const circleStyle = window.getComputedStyle(activeCircle);
const bgImage = circleStyle.backgroundImage;
document.getElementById('modalTitle').innerText = details.title;
document.getElementById('modalStartDate').innerHTML = details.startDate;
document.getElementById('modalCreationDate').innerHTML = details.creationDate;
document.getElementById('modalDescription').innerText = details.description;
const redirectBtn = document.getElementById('modalRedirectBtn');
redirectBtn.href = details.url;
redirectBtn.style.display = details.url === '#' ? 'none' : 'inline-block';
modal.style.transition = 'none';
const initialTop = initialRect.top + window.scrollY;
const initialLeft = initialRect.left + window.scrollX;
modal.style.top = `${initialTop}px`;
modal.style.left = `${initialLeft}px`;
modal.style.width = `${initialRect.width}px`;
modal.style.height = `${initialRect.height}px`;
modal.style.borderRadius = '15px';
modal.style.backgroundImage = bgImage;
modal.classList.add('has-gradient-bg');
const innerContent = modal.querySelector('.modal-inner-content');
innerContent.style.opacity = 0;
modal.classList.add('visible');
backdrop.classList.add('show');
requestAnimationFrame(() => {
modal.style.transition = 'width 0.4s ease, height 0.4s ease, left 0.4s ease';
const finalWidth = 280;
const finalHeight = 256;
modal.style.width = `${finalWidth}px`;
modal.style.height = `${finalHeight}px`;
if (versionKey === 'v4') {
modal.style.left = `${initialLeft - finalWidth + initialRect.width}px`;
}
setTimeout(() => {
innerContent.style.transition = 'opacity 0.3s ease';
innerContent.style.opacity = 1;
}, 300);
});
}
function hideVersionDetails() {
if (!activeModal || !activeCircle) return;
const innerContent = modal.querySelector('.modal-inner-content');
innerContent.style.transition = 'opacity 0.1s ease';
innerContent.style.opacity = 0;
setTimeout(() => {
modal.style.transition = 'width 0.4s ease, height 0.4s ease, top 0.4s ease, left 0.4s ease, border-radius 0.4s ease';
const currentRect = activeCircle.getBoundingClientRect();
const finalTop = currentRect.top + window.scrollY;
const finalLeft = currentRect.left + window.scrollX;
modal.style.top = `${finalTop}px`;
modal.style.left = `${finalLeft}px`;
modal.style.width = `${currentRect.width}px`;
modal.style.height = `${currentRect.height}px`;
modal.style.borderRadius = '15px';
backdrop.classList.remove('show');
}, 100);
setTimeout(() => {
modal.classList.remove('visible');
modal.style.backgroundImage = '';
modal.classList.remove('has-gradient-bg');
activeCircle = null;
activeModal = false;
}, 500);
}
closeModalBtn.addEventListener('click', hideVersionDetails);
backdrop.addEventListener('click', hideVersionDetails);
// --- One-Time Force Logout Script ---
(function() {
const forceLogoutKey = 'forceLogoutCompleted_v1';
if (!localStorage.getItem(forceLogoutKey)) {
console.log('Performing one-time force logout to ensure data consistency...');
const unsubscribe = firebase.auth().onAuthStateChanged(user => {
unsubscribe();
if (user) {
firebase.auth().signOut().then(() => {
localStorage.setItem(forceLogoutKey, 'true');
window.location.reload();
}).catch(error => {
console.error('Force logout failed, but setting flag to prevent loop:', error);
localStorage.setItem(forceLogoutKey, 'true');
window.location.reload();
});
} else {
localStorage.setItem(forceLogoutKey, 'true');
}
});
}
})();
// Firebase Authentication Logic
const authButtonsDiv = document.getElementById('authButtons');
const loggedInLinks = document.querySelectorAll('.logged-in-link');
const loggedOutLinks = document.querySelectorAll('.logged-out-link');
function logout() {
firebase.auth().signOut().catch(error => console.error('Error logging out:', error));
}
firebase.auth().onAuthStateChanged(user => {
authButtonsDiv.innerHTML = '';
if (user) {
authButtonsDiv.innerHTML = `<a href="#" class="btn btn-logout" onclick="logout()">LOGOUT</a>`;
loggedInLinks.forEach(link => link.style.display = 'inline-block');
loggedOutLinks.forEach(link => link.style.display = 'none');
} else {
authButtonsDiv.innerHTML = `<a href="login.html" class="btn btn-login">LOGIN</a> <a href="signup.html" class="btn btn-signup">SIGN UP</a>`;
loggedInLinks.forEach(link => link.style.display = 'none');
loggedOutLinks.forEach(link => link.style.display = 'inline-block');
}
});
// Dropdown Menu & Other Page Logic
document.addEventListener('DOMContentLoaded', () => {
// --- ONE-TIME DEVELOPMENT DISCLAIMER LOGIC (UPDATED) ---
const disclaimerOverlay = document.getElementById('development-disclaimer-overlay');
const disclaimerContinueBtn = document.getElementById('disclaimer-continue-btn');
const disclaimerTitle = document.getElementById('disclaimer-title');
const disclaimerDismissedKey = 'zirconiumDisclaimerDismissed';
let animationFrameId;
// --- Title Animation Logic (Corrected to tilt, not move) ---
let angle = 0;
const maxTilt = 15; // The maximum tilt angle in degrees
const speed = 0.02; // How fast it tilts
function animateTitle() {
angle += speed;
// Use sine and cosine to create a circular tilting motion
const rotX = Math.sin(angle) * maxTilt;
const rotY = Math.cos(angle) * maxTilt;
if(disclaimerTitle) {
// Apply perspective for 3D and the X/Y rotations. No translation.
disclaimerTitle.style.transform = `perspective(800px) rotateX(${rotX}deg) rotateY(${rotY}deg)`;
}
animationFrameId = requestAnimationFrame(animateTitle);
}
function stopAnimation() {
if (animationFrameId) {
cancelAnimationFrame(animationFrameId);
}
}
// Check if the disclaimer has been dismissed before
if (!localStorage.getItem(disclaimerDismissedKey)) {
disclaimerOverlay.style.display = 'flex';
document.body.classList.add('no-scroll');
animateTitle(); // Start the animation
}
// Add event listener to the continue button
if (disclaimerContinueBtn) {
disclaimerContinueBtn.addEventListener('click', () => {
disclaimerOverlay.style.display = 'none';
document.body.classList.remove('no-scroll');
localStorage.setItem(disclaimerDismissedKey, 'true');
stopAnimation();
});
}
// --- DROPDOWN MENU LOGIC ---
const dropdownTrigger = document.getElementById('more-dropdown');
const dropdownContent = document.getElementById('more-menu-content');
if (dropdownTrigger && dropdownContent) {
let hideTimeout;
const showMenu = () => {
clearTimeout(hideTimeout);
const rect = dropdownTrigger.getBoundingClientRect();
dropdownContent.style.top = `${window.scrollY + rect.bottom + 10}px`;
dropdownContent.style.left = `${rect.left}px`;
dropdownContent.classList.add('show');
};
const hideMenu = () => {
hideTimeout = setTimeout(() => {
dropdownContent.classList.remove('show');
}, 200);
};
dropdownTrigger.addEventListener('mouseenter', showMenu);
dropdownTrigger.addEventListener('mouseleave', hideMenu);
dropdownContent.addEventListener('mouseenter', () => clearTimeout(hideTimeout));
dropdownContent.addEventListener('mouseleave', hideMenu);
}
// --- ASPECT RATIO WARNING LOGIC ---
const overlay = document.getElementById('mobile-warning-overlay');
const continueBtn = document.getElementById('continue-btn');
function checkAspectRatio() {
const aspectRatio = window.innerWidth / window.innerHeight;
if (aspectRatio <= 1) {
overlay.style.display = 'flex';
document.body.classList.add('no-scroll');
}
}
function hideOverlay() {
overlay.style.display = 'none';
document.body.classList.remove('no-scroll');
}
checkAspectRatio();
if (continueBtn) {
continueBtn.addEventListener('click', hideOverlay);
}
});
</script>
</body>
</html>