-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path2022.html
1221 lines (1109 loc) · 78.2 KB
/
2022.html
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
<!--
Hey, Pit players! This is the un-obfuscated source code for brookeafk.com.
Please feel free to ask me questions at Brooke#0843 or @BrookeAFK on Twitter.
-->
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>
<!-- why did i have jquery here? surely it wasn't for anything important. -->
<link rel="apple-touch-icon" sizes="180x180" href="favicon_icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon_icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon_icons/favicon-16x16.png">
<link rel="manifest" href="favicon_icons/site.webmanifest">
<link rel="shortcut icon" type="image/x-icon" href="favicon_icons/favicon.ico">
<link href="font/webfontkit-20220210-002804/stylesheet.css" type="text/css" rel="stylesheet">
<title>Hypixel Pit Events Tracker</title>
<script src="emergency.js?v=28"></script>
<script src="control.js?v=28"></script>
<meta name="theme-color" content="#ffbbff">
<meta name="description" content="This program allows you to view the upcoming events in the Hypixel Pit in real time.">
</head>
<body style="font-family: minecraftregular" background-color="black" class="unselectable">
<div id="current-event" style="position: absolute; top: 35px; font-size: 25px; width: 475px; word-wrap: break-word; left: 35%; vertical-align: middle; padding: 1px;" class="flashtext unselectable" align="center">Current events will<br>show up here.</div>
<div class="img-with-text" display=""><img id="logo" src="3457688aa57c4d71ab9d22b04f9160db.png" alt="hi!" draggable="false" width=50px, height=auto, style="float:left"><p style="padding: 15px; padding-left: 60px; padding-top: 8px" id="brookeafk-com">brookeafk.com</p><span style="position:relative; left:60px; top:-40px;" id="settings" onclick="SettingsMenu()" class="hand_cursor">View Settings</span>
</div>
<div style="background: #314; padding: 5px; width: 120px; height: 32px; position: absolute; left: 300px; top: 24px; border-radius: 25px; display:flex; align-items: center; vertical-align:center; justify-content: center;
" id="day-night-border"><div id="day-night" style="font-size: 22px; vertical-align: middle; display: table-cell;" align="center">00:00 </div><svg id="day-svg" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#FFFFFF"><path d="M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg></div>
<div id="settings-section" style="display: none; position: relative; bottom: 40px;">
<p style="font-size:15px"><span>Theme: </span><span id="settings-theme-dark" onclick='ChangeTheme("dark")'>Dark</span><span> / </span><span id="settings-theme-light" onclick='ChangeTheme("light")'>Light</span></p>
<p style="font-size:15px"><span>Palette: </span><span id="settings-palette-0" onclick='ChangePalette(0)'>Theme 0</span> / <span id="settings-palette-1" onclick='ChangePalette(1)'>Theme 1</span> / <span id="settings-palette-2" onclick='ChangePalette(2)'>Theme 2</span> / <span id="settings-palette-3" onclick='ChangePalette(3)'>Theme 3</span></p>
<p style="font-size:15px"><span id="tut-notif" style="color: #ffff80">Pre-event notifications</span><span>: </span><span id="settings-audio"><span id="audio-300" onclick='SetAudio(300);' class="hand_cursor">5m</span><span> / </span><span id="audio-180" onclick='SetAudio(180);' class="hand_cursor">3m</span><span> / </span><span id="audio-60" onclick='SetAudio(60);' class="hand_cursor">1m</span><span> / </span><span id="audio-0" onclick='SetAudio(-10);' class="hand_cursor">Never</span></span></p>
<p id="anotif" style="font-size:15px"><span>- Audio notifications: </span><span id="desktop-notifs"><span id="audio-on" onclick='ANotif(1);' class="hand_cursor">On</span><span> / </span><span id="audio-off" onclick='ANotif(0);' class="hand_cursor">Off</span></span></p>
<p id="dnotif" style="font-size:15px"><span>- Desktop notifications (partially non-functional): </span><span id="desktop-notifs"><span id="desktop-on" onclick='DNotif(1);' class="hand_cursor">On</span><span> / </span><span id="desktop-off" onclick='DNotif(0);' class="hand_cursor">Off</span></span></p>
<p style="font-size:15px"><span id="alert-nobells" style="color: #ff7777; display: none">You're not being reminded for any events!<br>Click the bells in the top-right corner to receive notifications.</span></p>
<p style="font-size:15px"><span id="alert-notypes" style="color: #ff7777; display: none">Make sure to turn either "Audio notifications"<br>or "Desktop notifications" on to receive alerts.</span></p>
<p style="font-size:15px"><span>Timestamps: </span><span id="settings-ts-tod" onclick='ToggleTimestamps("tod");' class="hand_cursor">Time of Day</span><span> / </span><span id="settings-ts-tue" onclick='ToggleTimestamps("tue");' class="hand_cursor">Time Until Event</span> / <span id="settings-ts-dnc" onclick='ToggleTimestamps("dnc");' class="hand_cursor">Day-Night</span></p>
<p style="font-size:15px"><span id="settings-flashing">Flashing text: </span><span id="settings-flash"><span id="settings-flash-60" onclick='EventFlash(60);' class="hand_cursor">60s</span><span> / </span><span id="settings-flash-30" onclick='EventFlash(30);' class="hand_cursor">30s</span><span> / </span><span id="settings-flash-10" onclick='EventFlash(10);' class="hand_cursor">10s</span><span> / </span><span id="settings-flash-0" onclick='EventFlash(-10);' class="hand_cursor">Never</span></span></p>
<p style="font-size:15px"><span>Font: </span><span id="settings-font-minecraft" class="hand_cursor" onclick='ChangeFont("minecraftregular")'>Minecraft</span><span> / </span><span id="settings-font-sans-serif" class="hand_cursor" onclick='ChangeFont("sans-serif")'>Sans-Serif</span></p>
<p style="font-size:15px"><span id="alert-noevents" style="color: #ff7777; display: none">You don't have any events selected!<br>Click the event names in the top-right corner to make some visible.</span></p>
<p style="font-size:15px"><span>Version: </span><a href="https://brookeafk.com" style="color: #808080">Modern</a> <span> / </span> 2022</p>
<div id="notifications-major" style="display: block; position: absolute; top: -50px; right: 200px; text-align: right; font-size: 15px; color: #FFFFFF;">
<div><span id="visible-Pizza" onclick='VisibilityToggle("Pizza")' class="hand_cursor">Pizza</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Pizza" onclick='NotifToggle("Pizza")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Raffle" onclick='VisibilityToggle("Raffle")' class="hand_cursor">Raffle</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Raffle" onclick='NotifToggle("Raffle")'class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Squads" onclick='VisibilityToggle("Squads")' class="hand_cursor">Squads</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Squads" onclick='NotifToggle("Squads")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Blockhead" onclick='VisibilityToggle("Blockhead")' class="hand_cursor">Blockhead</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Blockhead" onclick='NotifToggle("Blockhead")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Spire" onclick='VisibilityToggle("Spire")' class="hand_cursor">Spire</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Spire" onclick='NotifToggle("Spire")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Robbery" onclick='VisibilityToggle("Robbery")' class="hand_cursor">Robbery</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Robbery" onclick='NotifToggle("Robbery")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-TeamDeathmatch" onclick='VisibilityToggle("Team Deathmatch")' class="hand_cursor">Team Deathmatch</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-TeamDeathmatch" onclick='NotifToggle("Team Deathmatch")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-RagePit" onclick='VisibilityToggle("Rage Pit")' class="hand_cursor">Rage Pit</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-RagePit" onclick='NotifToggle("Rage Pit")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Beast" onclick='VisibilityToggle("Beast")' class="hand_cursor">Beast</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Beast" onclick='NotifToggle("Beast")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<br><div id="test-audio" style="color: #ffffff;" onclick='TestAudio()' class="hand_cursor">Preview Audio</div><br><div id="select-all" style="color: #ffffff;" onclick='SelectOnly("everything")' class="hand_cursor">Select All</div>
</div>
<div id="notifications-minor" style="display: block; position: absolute; top: -50px; right: 50px; text-align: right; font-size: 15px; color: #FFFFFF;">
<div><span id="visible-DragonEgg" onclick='VisibilityToggle("Dragon Egg")' class="hand_cursor">Dragon Egg</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-DragonEgg" onclick='NotifToggle("Dragon Egg")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-KOTH" onclick='VisibilityToggle("KOTH")' class="hand_cursor">KOTH</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-KOTH" onclick='NotifToggle("KOTH")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-KOTL" onclick='VisibilityToggle("KOTL")' class="hand_cursor">KOTL</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-KOTL" onclick='NotifToggle("KOTL")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-2xRewards" onclick='VisibilityToggle("2x Rewards")' class="hand_cursor">2x Rewards</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-2xRewards" onclick='NotifToggle("2x Rewards")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-CarePackage" onclick='VisibilityToggle("Care Package")' class="hand_cursor">Care Package</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-CarePackage" onclick='NotifToggle("Care Package")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Auction" onclick='VisibilityToggle("Auction")' class="hand_cursor">Auction</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Auction" onclick='NotifToggle("Auction")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-QuickMaths" onclick='VisibilityToggle("Quick Maths")' class="hand_cursor">Quick Maths</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-QuickMaths" onclick='NotifToggle("Quick Maths")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-GiantCake" onclick='VisibilityToggle("Giant Cake")' class="hand_cursor">Giant Cake</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-GiantCake" onclick='NotifToggle("Giant Cake")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<div><span id="visible-Allbounty" onclick='VisibilityToggle("All bounty")' class="hand_cursor">All bounty</span><svg xmlns="http://www.w3.org/2000/svg" height="12px" viewBox="0 0 24 24" width="24px" fill="#ffffff" id="notif-Allbounty" onclick='NotifToggle("All bounty")' class="hand_cursor"><path d="M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"/></svg></div>
<br><div id="select-major" style="color: #ffffff;" onclick='SelectOnly("major")' class="hand_cursor">Majors Only</div>
<div id="select-minor" style="color: #ffffff;" onclick='SelectOnly("minor")' class="hand_cursor">Minors Only</div>
<div id="select-none" style="color: #ff7777;" onclick='SelectOnly("nothing")' class="hand_cursor">Deselect All</div>
<br><div id="save" style="color: #8888ff;" onclick='SaveSettings()' class="hand_cursor">Save Settings</div>
</div>
</div>
<div id="newversionbanner" style="background: linear-gradient(90deg, #db0af0 0%, #ad127a 100%); padding: 15px; position: relative; top: -20px; z-index: 5; font-size: 20px" id="newsite">A new version of brookeafk.com is available! Would you like to switch to it?<br><span style="padding: 7px; background-color: #55555544; border-radius: 8px;" onclick="stayVersion()">Stay</span> <span style="padding: 7px; background-color: #36dc36bb; border-radius: 8px; cursor: pointer;" onclick="switchVersion()">Switch</span> </div>
<div id="stayhere" style="font-size: 25px; background: linear-gradient(90deg, #968f96 0%, #91878d 100%); padding: 15px; display: none">To automatically connect to this version of the site, please visit <b style="color: #423d3f">brookeafk.com/2022</b> in the future.<br><span style="padding: 7px; background-color: #36dc36bb; border-radius: 8px; cursor: pointer;" onclick="close2nd()">Close</span></div>
<!-- i give up on this <div style="background: linear-gradient(90deg, rgb(240, 79, 10) 0%, rgb(173, 18, 18) 100%); padding: 15px; position: relative; top: -20px; z-index: 5; font-size: 20px" id="stopchanging">Welcome back to the old version! If you'd like to use this version, <b>please directly visit brookeafk.com/2022 to connect to it</b>.<br>brookeafk.com is the new site, brookeafk.com/2022 is the old one.<br>The automatic redirect is buggy and may stop being supported at any time! Please stop using it.<br><span style="padding: 7px; background-color: #55555544; border-radius: 8px;">Got it</span> <span style="padding: 7px; background-color: #36dc36bb; border-radius: 8px; cursor: pointer;" onclick="switchToNewVersion()">Switch to new version</span> </div> -->
<span id="events"></span>
<p style="position:relative; left: 10px;" id="madewithlove">Made with love and tears by <a href="https://twitter.com/BrookeAFK" target="_blank" rel="noopener">BrookeAFK</a><span id="mcpqndq"> with help from <a href="https://pitpanda.rocks" target="_blank" rel="noopener">McPqndq</a></span></p>
<p id="version" style="position: relative; left: 10px;"></p>
<p id="special_thanks"><span style="position: relative; left: 10px;"></span></p>
<script>
var HiddenEventCount = 0;
var EventsToLoad = 1;
var version_number = `v0.6.7`
var wiki_ad = `| <a href="https://brookeafk.com" rel="noopener noreferrer"><span style="color: #ae55c3">Check out the <span style="color: #da85a7">new version of brookeafk.com</span></a>!</span>`
var counter = 4;
var settingsOpened = false;
var NormalText = "#000000";
var EventFlashSec = 60;
var NotifTimer = -10;
var DoesStuffExist = false;
var HasStuffLoaded = false;
var Palette = 0;
var SettingsSelectedEvents = 262143;
var SettingsNotifyEvents = 0;
var SettingsDesktopNotifs = 0;
var SettingsAudioNotifs = 0;
var CorrectFont = "minecraftregular";
var CorrectBold = "minecraftregular; font-weight: bold";
var CorrectBoldStyleless = "minecraftbold";
var RealWeight = 400;
var offset = 0;
document.body.style.fontFamily = CorrectFont;
document.getElementById('version').innerHTML = (version_number + " " + wiki_ad);
var time1 = 0; // time since last desktop notif
var theme = "dark";
var showEventToD = true; //Time of Day
var showEventTuE = true; //Time until Event
var showEventDNC = true; //Day-night cycle
var VisibleEvents = ["Quick Maths","Dragon Egg","2x Rewards","Care Package","KOTL","KOTH","Auction","Giant Cake","All bounty","Squads","Beast","Pizza","Rage Pit","Spire","Robbery","Blockhead","Raffle","Team Deathmatch"];
var AudioEvents = [];
var praise_quotes = [`You're crazy.`,"So good brooke.","Cool but seek help please","Brookeafk.com so good","she's insane in the head","brooke your so smart in my opnion","brooke is such a good pit player","your site is incredible","this is actually amazing wtf","brooke is awesome","great site, I get to see every event I love happen while I'm at school!","omg brooke i am so big fan of u hi","ty for ur amazing website ❤","best pit website","the site looks good.","brooke is poger","i lvoe bgorokecrazfft.com",`i find your website really useful, specially when i have the game closed`,"Your website is quite useful actually","wow this is such a good website i love brookeafk.","brooke is so talented","The storm in my heart clears when I open the brookeafk website","this game is hard","the site looks very cool btw","Brooke is one of the smartest, kindest, most talented people I have ever met. She is not holding me at gunpoint to say this.",]
var praise_names = ["Andrew","Ellie","oSnapL","1Mad","Emma","catweapon","Twen","C4PS","vnmm","Vermasium","Stampy_fan2","swux","TheSKYeagle","julikabum","McPqndq","clouby","Brano","Ticha","Working","SAVANN4H","IDAKOI","faelicia","saraacat","litphoenix","adjective"]
var praise_urls = ["http://deviantart.com/hextant","https://twitter.com/ellwixd","https://twitter.com/oSnapLLL","https://youtu.be/dQw4w9WgXcQ","https://twitter.com/cutekitty271","https://namemc.com/profile/354aa68a43694ba29ff23c705dfc11e6","https://twitter.com/KinderFissa","https://twitter.com/c4pshypixel","https://vnmm.dev/","https://namemc.com/profile/9f65cdd1-81d7-49f3-8d41-fef76a7a8768","https://hypixel.net/members/probot.1901786/","https://www.tiktok.com/@swuxify_","https://twitter.com/leskyeagle","https://twitter.com/julikabum_0","https://pitpanda.rocks","https://brookeafk.com","https://twitter.com/branodon","https://pitpanda.rocks/players/18fe5844ce244d11ad3435c96435900f","https://twitter.com/WorkingMC","https://namemc.com/profile/343c717bb51d4dc3a9341d0908ee02e7","https://discord.gg/rebel","https://namemc.com/profile/9a259d6e408742819a2f901a91db9111","https://twitter.com/saracatxd","https://hypixel.net/members/litphoenix.533148/","https://adjectiven0un.github.io/holeinthewall/"]
//jojo was here
var AllSettings = ['visible','notifs','palette','timestamps','theme','flashing','reminder','desktop','audio','font']
var event_sound = new Audio("event_arriving.mp3");
event_sound.volume = 0.2;
var ok_ids = []
var WithoutVar = ""
var events = ["Quick Maths","Dragon Egg","2x Rewards","Care Package","KOTL","KOTH","Auction","Giant Cake","All bounty","Squads","Beast","Pizza","Rage Pit","Spire","Robbery","Blockhead","Raffle","Team Deathmatch"]
var eventsNoSpaces = ["QuickMaths","DragonEgg","2xRewards","CarePackage","KOTL","KOTH","Auction","GiantCake","Allbounty","Squads","Beast","Pizza","RagePit","Spire","Robbery","Blockhead","Raffle","TeamDeathmatch"]
var ShortformEvents = ["MATH","EGG","2X","CARE","KOTL","KOTH","AUC","CAKE","AB","SQU","BST","PZA","RP","SPR","ROB","BH","RFL","TDM"]
var trueEventColours = ["#FF55FF","#AA00AA","#00AA00","#FFAA00","#55FF55","#55FFFF","#FFFF55","#FF55FF","#FFAA00","#55FFFF","#55FF55","#FF5555","#FF5555","#AA00AA","#FFAA00","#5555FF","#FFAA00","#AA00AA"]
var VisibilityLength = [15,90,240,30,180,240,30,120,15,480,480,480,420,480,420,480,480,480]
var IsItACountdown = [`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">QUICK MATHS!</span> <span style="color: #AAAAAA;">First 5 players to answer gain</span> <span style="color: #55ffff;">+250XP</span> <span style="color: #ffaa00;">+500g</span>`,`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span><br><span style="color: #aa00aa; font-family: ` + CorrectBold + `;">DRAGON EGG</span><span style="color: #aaaaaa;"> in </span><span style="color: #ffff55; font-family: ` + CorrectBold + `;">Pit Area</span>`,"yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span><br><span style="color: #ffaa00; font-family: ` + CorrectBold + `;">CARE PACKAGE</span><span style="color: #aaaaaa;"> in </span><span style="color: #ffff55; font-family: ` + CorrectBold + `;">Pit Area</span>`,"yes","yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span> <span style="color: #ffaa00; font-family: ` + CorrectBold + `;">AUCTION!</span><br><span style="color: #AAAAAA; font-family:` + CorrectFont + `">Check auctioneer or chat!</span>`,"yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span><br><span style="color: #ffAA00; font-family: ` + CorrectBold + `;"> EVERYONE GETS A BOUNTY!</span>`,"yes","yes","yes","yes","yes","yes","yes","yes","yes"]
var DemolitionTime = 15;
var TimeOfEventStart = 0;
var eventsES = ["Matemáticas Rápidas","Huevo de Dragón","2x Recompensas","Paquete Auxiliar","RDLE","RDLC","Subasta","Tarta Gigante","Recompensa","Escuadrones","Bestia","Pizza","Furia Pit","Chapitel","Robo","Blockhead","Raffle","Deathmatch por Equipos"]
var IsItACountdownES = [`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">¡MATEMÁTICAS RÁPIDAS!</span> <span style="color: #AAAAAA;">Los 5 primeros jugadores que respondan recibirán</span> <span style="color: #55ffff;">+250XP</span> <span style="color: #ffaa00;">+500g</span>`,`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">¡EVENTO MENOR!</span><br><span style="color: #aa00aa; font-family: ` + CorrectBold + `;">HUEVO DE DRAGÓN</span><span style="color: #aaaaaa;"> en </span><span style="color: #ffff55; font-family: ` + CorrectBold + `;">Zona de Pit</span>`,"yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">¡EVENTO MENOR!</span><br><span style="color: #ffaa00; font-family: ` + CorrectBold + `;">PAQUETE AUXILIAR</span><span style="color: #aaaaaa;"> en </span><span style="color: #ffff55; font-family: ` + CorrectBold + `;">Zona de Pit</span>`,"yes","yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">¡EVENTO MENOR!</span> <span style="color: #ffaa00; font-family: ` + CorrectBold + `;">SUBASTA!</span><br><span style="color: #AAAAAA; font-family:` + CorrectFont + `">Compruebe el subastador o el chat!</span>`,"yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">¡EVENTO MENOR!</span><br><span style="color: #ffAA00; font-family: ` + CorrectBold + `;"> ¡TODOS RECIBEN UNA RECOMPENSA!</span>`,"yes","yes","yes","yes","yes","yes","yes","yes","yes"]
var all_text = ["MINOR EVENT!","MAJOR EVENT!","Starting in ","Ending in "]
//events that I know work: all bounty, dragon egg, 2x rewards, uh .,
if(document.body.clientWidth < 800) {
document.getElementById("brookeafk-com").innerText = "mobile website"
document.getElementById("settings-ts-dnc").innerText = "Day-Night"
document.getElementById("settings-ts-tue").innerText = "Until Event"
document.getElementById("settings-flashing").innerText = "Flash: "
console.log("Damn, that's a tiny screen. Better accomodate.")
document.getElementById("current-event").setAttribute("id","replacement")
document.getElementById("brookeafk-com").setAttribute("id","current-event")
document.getElementById("replacement").setAttribute("id","brookeafk-com")
document.getElementById("current-event").innerHTML = "brookeafk.com (mobile)"
document.getElementById("brookeafk-com").innerHTML = ""
document.getElementById("current-event").style.width = "200px"
WithoutVar = "brookeafk.com"
}
function doEverything(unusedVariable) { // this is a "do later" problem!
return 0;
}
if(localStorage.getItem("gotit2022") == "true") document.getElementById("newversionbanner").style.display = "none";
if(document.referrer == "https://brookeafk.com/") document.getElementById("stayhere").style.display = "";
function switchVersion() {
localStorage.setItem("hide-redesign-banner", "true");
window.location = "./";
}
function stayVersion() {
document.getElementById("newversionbanner").style.display = "none";
localStorage.setItem("gotit2022", "true");
document.getElementById("stayhere").style.display = "";
}
function close2nd() {
document.getElementById("stayhere").style.display = "none";
}
document.getElementById('settings').style.color = NormalText;
function MakeFunTimestamps(convertible) {
let currentTime = (Date.now() + offset);
if (convertible - currentTime <= 0) {
convertible = "Passed!"
}
if (convertible - currentTime <= 60000) {
convertible = (((Math.floor(((convertible - currentTime)*100))/100000).toFixed(2)) + "s");
} else if (convertible - currentTime <= 3600000) {
convertible = ((Math.floor(((convertible - currentTime))/60000) + "m" + (Math.floor(((convertible - currentTime))/1000) % 60) + "s"));
} else if (convertible - currentTime > 1) {
convertible = ((Math.floor(((convertible - currentTime))/3600000) + "h" + (Math.floor(((convertible - currentTime))/60000) % 60) + "m"));
}
return convertible;
}
function EventFlash(seconds) {
window.EventFlashSec = seconds;
if(DoesStuffExist == true) {
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
document.getElementById('event_'+ String(i)).classList.remove("blinktext-light");
document.getElementById('event_'+ String(i)).classList.remove("blinktext-dark");
}}
if(seconds == 60) {
document.getElementById('settings-flash-60').style.color = NormalText;
document.getElementById('settings-flash-30').style.color = "#888888";
document.getElementById('settings-flash-10').style.color = "#888888";
document.getElementById('settings-flash-0').style.color = "#888888";
}
if(seconds == 30) {
document.getElementById('settings-flash-30').style.color = NormalText;
document.getElementById('settings-flash-60').style.color = "#888888";
document.getElementById('settings-flash-10').style.color = "#888888";
document.getElementById('settings-flash-0').style.color = "#888888";
}
if(seconds == 10) {
document.getElementById('settings-flash-10').style.color = NormalText;
document.getElementById('settings-flash-30').style.color = "#888888";
document.getElementById('settings-flash-60').style.color = "#888888";
document.getElementById('settings-flash-0').style.color = "#888888";
}
if(seconds == -10) {
document.getElementById('settings-flash-0').style.color = NormalText;
document.getElementById('settings-flash-30').style.color = "#888888";
document.getElementById('settings-flash-10').style.color = "#888888";
document.getElementById('settings-flash-60').style.color = "#888888";
}
}
function ChangeFont(font) {
if(font == "minecraftregular") {
document.getElementById('settings-font-minecraft').style.color = NormalText;
document.getElementById('settings-font-sans-serif').style.color = "#888888";
CorrectFont = "minecraftregular";
CorrectBold = "minecraftbold";
CorrectBoldStyleless = "minecraftbold";
RealWeight = 400;
}
if(font == "sans-serif") {
document.getElementById('settings-font-sans-serif').style.color = NormalText;
document.getElementById('settings-font-minecraft').style.color = "#888888";
CorrectFont = "sans-serif";
CorrectBold = "sans-serif; font-weight: bold";
CorrectBoldStyleless = "sans-serif";
RealWeight = 700;
}
document.body.style.fontFamily = CorrectFont;
IsItACountdown = [`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">QUICK MATHS!</span> <span style="color: #AAAAAA;">First 5 players to answer gain</span> <span style="color: #55ffff;">+250XP</span> <span style="color: #ffaa00;">+500g</span>`,`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span><br><span style="color: #aa00aa; font-family: ` + CorrectBold + `;">DRAGON EGG</span><span style="color: #aaaaaa;"> in </span><span style="color: #ffff55; font-family: ` + CorrectBold + `;">Pit Area</span>`,"yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span><br><span style="color: #ffaa00; font-family: ` + CorrectBold + `;">CARE PACKAGE</span><span style="color: #aaaaaa;"> in </span><span style="color: #ffff55; font-family: ` + CorrectBold + `;">Pit Area</span>`,"yes","yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span> <span style="color: #ffaa00; font-family: ` + CorrectBold + `;">AUCTION!</span><br><span style="color: #AAAAAA; font-family:` + CorrectFont + `">Check auctioneer or chat!</span>`,"yes",`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">MINOR EVENT!</span><br><span style="color: #ffAA00; font-family: ` + CorrectBold + `;"> EVERYONE GETS A BOUNTY!</span>`,"yes","yes","yes","yes","yes","yes","yes","yes","yes"]
}
function DayNightCycle() { //OPTIMIZE THIS please add variable that's like "when the day is dark please do not call the svg again please"
//I will not >:)
let CurrentTime = Date.now() + offset;
let DayTime = ((CurrentTime + 10000) % 2160000)/1000; //10-second offset
if(DayTime < 1440) {
//console.log("The day ends in " + (1440 - DayTime) + " seconds.")
document.getElementById("day-night").innerHTML = (AboutMe((1440 - DayTime)*1000) + " ");
if(theme == "light") {
document.getElementById("day-night-border").style.background = "#EDD368";
} else if (theme == "dark") {
document.getElementById("day-night-border").style.background = "rgb(67, 61, 35)";
}
document.getElementById('day-svg').innerHTML = `<path d="M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0 c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2 c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1 C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06 c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41 l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41 c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36 c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/>`
} else {
//console.log("The night ends in " + (2160 - DayTime) + " seconds.")
document.getElementById("day-night").innerHTML = (AboutMe((2160 - DayTime)*1000) + " ");
if(theme == "light") {
document.getElementById("day-night-border").style.background = "#25AACF";
} else if (theme == "dark") {
document.getElementById("day-night-border").style.background = "rgb(35, 35, 67)";
}
document.getElementById('day-svg').innerHTML = `<path d="M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36c-0.98,1.37-2.58,2.26-4.4,2.26 c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/>`
}
}
function SetAudio(seconds) {
window.NotifTimer = seconds;
console.log("Notification timer set to " + NotifTimer + " seconds.")
document.getElementById('anotif').style.display = "block"
document.getElementById('dnotif').style.display = "block"
if(seconds > 0) {
for(var i = 0; i < 18; i++) {
if(DoesStuffExist == true) {
document.getElementById('notif-' + eventsNoSpaces[i]).style.display = "inline";
}}
if(window.AudioEvents.length == 0 && HasStuffLoaded == true) {
console.log(window.AudioEvents + " audioevents")
document.getElementById('alert-nobells').style.display = "block";
}
if(SettingsDesktopNotifs == 0 && SettingsAudioNotifs == 0) {
document.getElementById('alert-notypes').style.display = "block"
}
}
if(seconds == 300) {
document.getElementById('audio-300').style.color = NormalText;
document.getElementById('audio-180').style.color = "#888888";
document.getElementById('audio-60').style.color = "#888888";
document.getElementById('audio-0').style.color = "#888888";
}
if(seconds == 180) {
document.getElementById('audio-180').style.color = NormalText;
document.getElementById('audio-300').style.color = "#888888";
document.getElementById('audio-60').style.color = "#888888";
document.getElementById('audio-0').style.color = "#888888";
}
if(seconds == 60) {
document.getElementById('audio-60').style.color = NormalText;
document.getElementById('audio-180').style.color = "#888888";
document.getElementById('audio-300').style.color = "#888888";
document.getElementById('audio-0').style.color = "#888888";
}
if(seconds <= 0) {
document.getElementById('audio-0').style.color = NormalText;
document.getElementById('audio-180').style.color = "#888888";
document.getElementById('audio-60').style.color = "#888888";
document.getElementById('audio-300').style.color = "#888888";
document.getElementById('anotif').style.display = "none"
document.getElementById('dnotif').style.display = "none"
document.getElementById('alert-nobells').style.display = "none";
document.getElementById('alert-notypes').style.display = "none";
for(var i = 0; i < 18; i++) {
if(DoesStuffExist == true) {
document.getElementById('notif-' + eventsNoSpaces[i]).style.display = "none";
}}
}
}
function ANotif(tog) {
window.SettingsAudioNotifs = tog;
console.log("Audio notifications setting: " + tog);
if(tog == 1) {
document.getElementById('audio-on').style.color = NormalText;
document.getElementById('audio-off').style.color = "#888888";
document.getElementById('alert-notypes').style.display = 'none';
}
if(tog == 0) {
document.getElementById('audio-off').style.color = NormalText;
document.getElementById('audio-on').style.color = "#888888";
if(SettingsDesktopNotifs == 0 && NotifTimer > 0) {
document.getElementById('alert-notypes').style.display = 'block';
}
}
}
function DNotif(tog) { //Short for "Desktop Notification" and "toggle"
window.SettingsDesktopNotifs = tog;
console.log("Desktop notifications setting: " + tog);
if(tog == 1) {
document.getElementById('desktop-on').style.color = NormalText;
document.getElementById('desktop-off').style.color = "#888888";
document.getElementById('alert-notypes').style.display = 'none';
if (!("Notification" in window)) {
document.getElementById('desktop-on').innerHTML = "Your browser doesn't support this!"
}
else if (Notification.permission === "denied") {
document.getElementById('desktop-on').innerHTML = "Notifications denied :("
window.SettingsDesktopNotifs = 0;
tog = 0;
}
else if (Notification.permission === "granted") {
console.log("Notifications were already enabled!")
}
else if (Notification.permission !== "denied") {
document.getElementById('desktop-on').innerHTML = "Accept notifications!"
Notification.requestPermission().then(function (permission) {
if (permission === "granted") {
console.log("Notifications enabled!")
document.getElementById('desktop-on').innerHTML = "On"
}
else {
document.getElementById('desktop-on').innerHTML = "Notifications denied :("
window.SettingsDesktopNotifs = 0;
tog = 0;
}
});
}
}
if(tog == 0) {
document.getElementById('desktop-off').style.color = NormalText;
document.getElementById('desktop-on').style.color = "#888888";
if(SettingsAudioNotifs == 0 && NotifTimer > 0) {
document.getElementById('alert-notypes').style.display = 'block';
}
}
}
function TestAudio() {
event_sound.play();
event_sound.currentTime = 0;
}
function ChangeTheme(themecolour) {
window.theme = themecolour;
console.log ("Changed theme to " + window.theme);
if(themecolour == "light") {
NormalText = "#000000";
document.getElementById('settings-theme-dark').style.color = "#888888";
document.getElementById('settings-theme-light').style.color = NormalText;
document.body.style.background = "#FFFFFF";
document.querySelectorAll('p').forEach(e => e.style.color = "black");
document.getElementById('settings-theme-dark').classList.add("hand_cursor");
document.getElementById('settings-theme-light').classList.remove("hand_cursor");
document.getElementById('settings-palette-0').innerHTML = ("Default");
document.getElementById('settings-palette-1').innerHTML = ("Sunset");
document.getElementById('settings-palette-2').innerHTML = ("Beachside");
document.getElementById('settings-palette-3').innerHTML = ("Bubblegum");
document.getElementById('tut-notif').style.color = "#BD8E02"
} else if (window.theme == "dark") {
NormalText = "#FFFFFF";
document.getElementById('settings-theme-light').style.color = "#888888";
document.getElementById('settings-theme-dark').style.color = NormalText;
document.body.style.background = "#222222";
document.querySelectorAll('p').forEach(e => e.style.color = "white");
document.getElementById('settings-theme-dark').classList.remove("hand_cursor");
document.getElementById('settings-theme-light').classList.add("hand_cursor");
document.getElementById('settings-palette-0').innerHTML = ("Default");
document.getElementById('settings-palette-1').innerHTML = ("Sunrise");
document.getElementById('settings-palette-2').innerHTML = ("Ocean");
document.getElementById('settings-palette-3').innerHTML = ("Business");
document.getElementById('tut-notif').style.color = "#FFFF80"
}
document.getElementById('day-svg').style.fill = NormalText;
document.getElementById('settings').style.color = "#888888";
if (DoesStuffExist == true) {
ChangeFont(window.font)
EventFlash(window.EventFlashSec);
SetAudio(window.NotifTimer);
DNotif(window.SettingsDesktopNotifs);
ANotif(window.SettingsAudioNotifs);
console.log("Stuff exists. Updating event flashes and audio.");
}
for(var i = 1; i <= window.eventsNoSpaces.length; i++) {
if(AudioEvents.includes(events[i - 1])) { //if the event is audible...
document.getElementById('notif-'+ eventsNoSpaces[i - 1]).style.fill = NormalText;
} else {
document.getElementById('notif-'+ eventsNoSpaces[i - 1]).style.fill = "#888888";
}
}
for(var i = 1; i <= window.eventsNoSpaces.length; i++) {
if(VisibleEvents.includes(events[i - 1])) { //if the event is visible...
document.getElementById('visible-'+ eventsNoSpaces[i - 1]).style.color = NormalText;
} else {
document.getElementById('visible-'+ eventsNoSpaces[i - 1]).style.color = "#888888";
}
}
if(themecolour == "light") {
[...document.querySelectorAll('*')]
.filter(el => getComputedStyle(el).color === 'rgb(255, 255, 255)')
.forEach(el => el.style.color = '#000000')
}
if(themecolour == "dark") {
[...document.querySelectorAll('*')]
.filter(el => getComputedStyle(el).color === 'rgb(0, 0, 0)')
.forEach(el => el.style.color = '#ffffff')
}
}
ChangeTheme(theme); //It's called here to load the events in as black to begin with. I don't want to give people seizures.
function ToggleTimestamps(timestamps) {
if (timestamps == "tod") {
if(window.showEventToD == true) {
document.getElementById('settings-ts-tod').style.color = "#888888";
window.showEventToD = false;
} else {
document.getElementById('settings-ts-tod').style.color = NormalText;
window.showEventToD = true;
}
}
if (timestamps == "tue") {
if(window.showEventTuE == true) {
document.getElementById('settings-ts-tue').style.color = "#888888";
window.showEventTuE = false;
} else {
document.getElementById('settings-ts-tue').style.color = NormalText;
window.showEventTuE = true;
}
}
if (timestamps == "dnc") {
if(window.showEventDNC == true) {
document.getElementById('settings-ts-dnc').style.color = "#888888";
window.showEventDNC = false;
document.getElementById("day-night-border").style.display = "none";
} else {
document.getElementById('settings-ts-dnc').style.color = NormalText;
window.showEventDNC = true;
document.getElementById("day-night-border").style.display = "flex";
}
}
}
function ChangePalette(changeThePalette) {
Palette = changeThePalette;
document.getElementById('settings-palette-0').style.color = "#888888";
document.getElementById('settings-palette-1').style.color = "#888888";
document.getElementById('settings-palette-2').style.color = "#888888";
document.getElementById('settings-palette-3').style.color = "#888888";
if(Palette > -100) {
document.getElementById('settings-palette-' + Palette).style.color = NormalText;
}
}
function SelectOnly(event_type) {
if(event_type == "minor") {
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
if (window.data[i]['type'] == "major") {
document.getElementById('event_' + String(i)).style.display = "none";
console.log("Major event hidden.");
}
if (window.data[i]['type'] == "minor") {
document.getElementById('event_' + String(i)).style.display = "block";
console.log("Minor event made visible.");
}
window.VisibleEvents = ["Quick Maths","Dragon Egg","2x Rewards","Care Package","KOTL","KOTH","Auction","Giant Cake","All bounty"];
SettingsSelectedEvents = 511;
document.getElementById('alert-noevents').style.display = "none";
}
} else if(event_type == "major") {
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
if (window.data[i]['type'] == "minor") {
document.getElementById('event_' + String(i)).style.display = "none";
console.log("Minor event hidden.");
}
if (window.data[i]['type'] == "major") {
document.getElementById('event_' + String(i)).style.display = "block";
console.log("Major event made visible.");
}
window.VisibleEvents = ["Squads","Beast","Pizza","Rage Pit","Spire","Robbery","Blockhead","Raffle","Team Deathmatch"];
SettingsSelectedEvents = 261632;
}
document.getElementById('alert-noevents').style.display = "none";
} else if(event_type == "nothing") {
window.VisibleEvents = [];
window.AudioEvents = [];
SettingsSelectedEvents = 0;
SettingsNotifyEvents = 0;
document.getElementById('alert-noevents').style.display = "block"
if(NotifTimer > 0) {
document.getElementById('alert-nobells').style.display = "block";
}
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
document.getElementById('event_' + String(i)).style.display = "none";
}
} else if(event_type == "everything") {
window.VisibleEvents = ["Quick Maths","Dragon Egg","2x Rewards","Care Package","KOTL","KOTH","Auction","Giant Cake","All bounty","Squads","Beast","Pizza","Rage Pit","Spire","Robbery","Blockhead","Raffle","Team Deathmatch"]
SettingsSelectedEvents = 262143;
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
document.getElementById('event_' + String(i)).style.display = "block";
}
document.getElementById('alert-noevents').style.display = "none";
}
ChangeTheme(theme);
console.log(SettingsSelectedEvents);
}
function GeneratePraise() {
const randomElement = [Math.floor(Math.random() * (praise_quotes.length + 3)) - 3]; //adds very slight bias to quote #0
console.log(randomElement);
if(randomElement <= -1) {
randomElement[0] = 0;
}
return (`"` + praise_quotes[randomElement] + `" -<a href="` + praise_urls[randomElement] + `" target="_blank">` + praise_names[randomElement] + `</a>`);
}
function TimeOfDay(s) {
var offset = (new Date().getTimezoneOffset())*-60000;
return new Date(s + offset).toISOString().slice(-13, -8);
}
var lightColours0 = ["#D9D2E9","#E9D2E1","#D2E9DD","#E9E2D2","#D2E9D2","#D2E9E8","#E9DDD2","#E9D2D2","#E9E3D2","#8EBAEC","#8EEC94","#ECB38E","#EC8E8E","#EC8EEC","#ECE98E","#9191EC","#ECBD8E","#BA8EEC"]
var darkColours0 = ["#45234f","#4f234d","#234f2c","#4f3023","#394f23","#234f48","#6e5032","#35234f","#4f4d23","#206dc5","#20c541","#c59f20","#c52320","#c520c3","#c5c320","#2323c5","#c0c020","#7320c5"]
var lightColours2 = ["#FFAEBC","#E29CB4","#B4F8C8","#E4D4B4","#F1CBB0","#A0E7E5","#F4F4CC","#C5E3F2","#FBE7C6","#14C2DD","#C7F954","#FCC27C","#FF6F61","#64ABD1","#FDD55E","#5CB7D4","#EEB968","#81599F",]
var darkColours2 = ["#003A61","#194475","#2E4180","#323275","#0E2F82","#305B8C","#315F82","#196B82","#02636E","#0ACF87","#2CB8AE","#219CD1","#438BDE","#1B96DE","#2BB5BA","#25AACF","#2D82D6","#4BD6B8",]
var darkColours1 = ["#4F2561","#3D2C5C","#782C91","#8C3A81","#70287D","#504178","#402459","#AB1B7D","#661563","#DE8F10","#FA9E0A","#DB7821","#D19D49","#E84E3C","#E6C853","#ED7C2B","#CF8D32","#E3DD30",]
var lightColours1 = ["#F7E497","#E3DC7B","#D9C755","#EBC86A","#F7C997","#EDD368","#F2B583","#EDD09D","#EB8773","#AB419B","#C2619E","#D93FB7","#B83DB3","#E038A3","#C71C60","#D45BA1","#E84179","#E344E0",]
//var darkColours3 = ["#321433","#33142b","#143321","#332314","#1e3314","#143333","#332a14","#261433","#2f3314","#206dc5","#20c541","#c59f20","#c52320","#c520c3","#c5c320","#2323c5","#c0c020","#7320c5"]
var lightColours3 = ["#FE9FBF","#F2C4CD","#ffaed7","#F2A2C0","#FF9DBB","#FF92B9","#ECAFB7","#FFC6DA","#FEA8C5","#D98FC5","#BF5AA4","#E68DCF","#E08FCA","#E884CC","#C15BA7","#E78CD1","#DC87BE","#CF6EB1"]
var darkColours3 = ["#222222","#222222","#222222","#222222","#222222","#222222","#222222","#222222","#222222",'#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229',]
var darkColours4 = ["#222222","#222222","#222222","#222222","#222222","#222222","#222222","#222222","#222222",'#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229','#2A2229',]
var darkColoursVermasium = ["#8095BF","#606BA6","#8095BF","#606BA6","#8095BF","#606BA6","#8095BF","#606BA6","#8095BF","#394066","#394066","#394066","#394066","#394066","#394066","#394066","#394066","#394066"]
var darkColoursIDAKOI = ["#1B2440","#BF372A","#453561","#65213C","#19213C","#29314C","#101628","#101D2F","#601F39","#D98943","#E9879E","#C54129","#E6C302","#C54129","#C5A510","#D2A829","#B4971E","#D68941"]
var darkColoursadjective_n0un = ["#808080","#808080","#808080","#808080","#808080","#808080","#808080","#808080","#808080","#55F","#55F","#55F","#55F","#55F","#55F","#55F","#55F","#55F"]
var darkColoursswuxx = ["#61123e","#000000","#61123e","#000000","#61123e","#61123e","#61123e","#61123e","#61123e","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#000000","#000000"]
var darkColoursMaleffect = ["#45234f","#4f234d","#234f2c","#4f3023","#394f23","#234f48","#6e5032","#35234f","#4f4d23","#206dc5","#20c541","#c59f20","#c52320","#c520c3","#c5c320","#2323c5","#c0c020","#7320c5"]
if( typeof emergency === 'undefined'){ // if the connection to control.js failed
console.log("Wah!")
emergency = false; // this is essentially the "emergency" for the emergency variable. Ridiculous.
}
var pp_url = ""
console.log(emergency)
if(emergency == false) {
pp_url = ('https://raw.githubusercontent.com/BrookeAFK/brookeafk-api/main/events.js'); //stands for "Pit Panda"
console.log("no emergency here!")
}
data_backup = MakeAPIAndHTML();
getPitPanda();
console.log("The data's been called!");
setInterval(getPitPanda,40);
async function MakeAPIAndHTML() { //Calls the API exactly once (thanks McPqndq for pointing out that i do not have to call apis more than once)
if(emergency == true) {
document.getElementById('version').innerHTML = (version_number + "e " + wiki_ad);
document.getElementById('mcpqndq').style.display = "none"; // i'm evil
window.data = await window.emergency_data;
/*if(Object.keys(data).length == 0) {
console.log("oh no")
emergency = false;
}*/
}
if(emergency == false) {
const response = await fetch(pp_url);
window.data = await response.json();
}
window.data_backup = window.data;
window.EventsToLoad = Object.keys(window.data).length
console.log("Loading events: " + window.EventsToLoad);
console.log("API Called.")
for(var i = 0; i < window.EventsToLoad; i += 1) { //Make HTML elements
var div = document.createElement("div");
console.log("I made an element.");
div.id = ("event_" + i);
div.innerHTML = ("[loading event]");
div.style.padding = "15px";
div.style.backgroundColor = "#222222";
div.style.textAlign = "left";
div.style.fontSize = "1.5em"
div.style.lineHeight = "100%"
document.getElementById('events').appendChild(div);
}
document.getElementById('special_thanks').innerHTML = `<span style="position:relative; left: 10px;">` + GeneratePraise() + `</span>`
ChangeTheme(theme); //just again to make sure
//console.log("Seems like your screen's " + document.body.clientWidth + " pixels wide.");
DoesStuffExist = true;
URLToSettings()
}
function AudioChecker() {
let currentTime = (Date.now() + offset);
if(DoesStuffExist == true) {
for(var i = window.HiddenEventCount; i <= window.HiddenEventCount + 3 && i < EventsToLoad; i++) { //thanks Clipi-12!
if (window.AudioEvents.includes(window.data[i]['event']) && window.data[i]['timestamp'] - currentTime <= (NotifTimer * 1000 + 1000) && window.data[i]['timestamp'] - currentTime >= (NotifTimer * 1000 - 1000)) {
if(SettingsAudioNotifs == 1) {
event_sound.play();
}
if(SettingsDesktopNotifs == 1) {
if(Date.now() + offset > time1 + 10000) { //if it's been more than 10 seconds since the last notification
if (NotifTimer == 60) {
var minute_s = "minute"
} else {
var minute_s = "minutes"
}
var notification = new Notification("", {body: "Hey— " + window.data[i]['event'] + " is starting in " + NotifTimer/60 + " " + minute_s +"!", icon: "3457688aa57c4d71ab9d22b04f9160db.png"});
time1 = Date.now() + offset
}
}
}
}}
}
function RapidFirst(transformation) { //this plops the stuff in the actual html page
if (DoesStuffExist == true) {
HasStuffLoaded = true; //looks like the stuff has loaded
for(var i = window.HiddenEventCount; i <= window.HiddenEventCount && i < EventsToLoad; i++) {
if (showEventToD == true && showEventTuE == true) {
document.getElementById('event_' + String(i)).innerHTML = (`<span style="font-family: ` + CorrectFont + `">` + MakeFunTimestamps(transformation[i].timestamp) + `: </span><span> ` + transformation[i].event + `</span><span style="font-family: ` + CorrectFont + `"> (` + TimeOfDay(transformation[i].timestamp) + ") </span>");
} else if (showEventToD == false && showEventTuE == true) {
document.getElementById('event_' + String(i)).innerHTML = (`<span style="font-family: ` + CorrectFont + `">` + MakeFunTimestamps(transformation[i].timestamp) + `: </span><span> ` + transformation[i].event + `</span><span style="font-family: ` + CorrectFont + `"> </span>`);
} else if (showEventToD == true && showEventTuE == false) {
document.getElementById('event_' + String(i)).innerHTML = (`<span style="font-family: ` + CorrectFont + `">` + TimeOfDay(transformation[i].timestamp) + `: </span><span> ` + transformation[i].event + `</span><span style="font-family: ` + CorrectFont + `"> </span>`);
} else if (showEventToD == false && showEventTuE == false) {
document.getElementById('event_' + String(i)).innerHTML = (`<span style="font-family: ` + CorrectFont + `">` + transformation[i].event + `</span>`);
}
if(MakeFunTimestamps(transformation[i].timestamp) == "Passed!" && !!document.getElementById('event_' + String(i)) == true) {
//document.getElementById('event_' + String(i)).remove();
for(var j = 0; j <= i; j++) {
document.getElementById('event_' + String(j)).style.display = "none"; //This should get rid of some bugs with events not hiding.
}
window.HiddenEventCount = window.HiddenEventCount + 1;
DemolitionTime = (window.data[HiddenEventCount - 1]['timestamp'] + (VisibilityLength[events.indexOf(window.data[HiddenEventCount - 1]['event'])]) * 1000)
console.log(DemolitionTime);
TimeOfEventStart = Date.now() + offset;
console.log(TimeOfEventStart);
document.getElementById("current-event").style.display = "block";
document.getElementById('special_thanks').innerHTML = `<span style="position:relative; left: 10px;">` + GeneratePraise() + `</span>`
}
}}
}
function UpdateEverything(transformation) { //this plops the stuff in the actual html page
for(var i = window.HiddenEventCount + 1; i < EventsToLoad; i++) {
if (showEventToD == true && showEventTuE == true) {
document.getElementById('event_' + String(i)).innerHTML = (`<span style="font-family: ` + CorrectFont + `">` + MakeFunTimestamps(transformation[i].timestamp) + `: </span><span> ` + transformation[i].event + `</span><span style="font-family: ` + CorrectFont + `"> (` + TimeOfDay(transformation[i].timestamp) + ") </span>");
} else if (showEventToD == false && showEventTuE == true) {
document.getElementById('event_' + String(i)).innerHTML = (`<span style="font-family: ` + CorrectFont + `">` + MakeFunTimestamps(transformation[i].timestamp) + `: </span><span> ` + transformation[i].event + `</span><span style="font-family: ` + CorrectFont + `"> </span>`);
} else if (showEventToD == true && showEventTuE == false) {
document.getElementById('event_' + String(i)).innerHTML = (`<span style="font-family: ` + CorrectFont + `">` + TimeOfDay(transformation[i].timestamp) + `: </span><span> ` + transformation[i].event + `</span><span style="font-family: ` + CorrectFont + `"> </span>`);
} else if (showEventToD == false && showEventTuE == false) {
document.getElementById('event_' + String(i)).innerHTML = (`<span>` + transformation[i].event + `</span>`);
}
if(MakeFunTimestamps(transformation[i].timestamp) == "Passed!" && !!document.getElementById('event_' + String(i)) == true) { //in an ideal world this should NEVER be called but js can be weird as hell sometimes
//document.getElementById('event_' + String(i)).remove();
document.getElementById('event_' + String(i)).style.display = "none";
window.HiddenEventCount = window.HiddenEventCount + 1;
console.log("hey if you see this please let Brooke know as this should Not happen lol");
}
}
}
function VisibilityToggle(toggle) {
if (window.VisibleEvents.includes(toggle)) {
SettingsSelectedEvents = (SettingsSelectedEvents - Math.pow(2, window.events.indexOf(toggle)));
const index = window.VisibleEvents.indexOf(toggle);
if (index > -1) {
window.VisibleEvents.splice(index, 1);
document.getElementById('visible-' + toggle.replace(/\s/g, '')).style.color = "#888888";
}
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
if (window.data[i]["event"].includes(toggle)) {
document.getElementById('event_' + String(i)).style.display = "none";
}
if(VisibleEvents.length == 0) {
document.getElementById('alert-noevents').style.display = "block";
}
}
} else {
window.VisibleEvents.push(toggle);
document.getElementById('visible-' + toggle.replace(/\s/g, '')).style.color = NormalText;
SettingsSelectedEvents = (SettingsSelectedEvents + Math.pow(2, window.events.indexOf(toggle)));
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
if (window.data[i]["event"].includes(toggle)) {
document.getElementById('event_' + String(i)).style.display = "block";
}
}
document.getElementById('alert-noevents').style.display = "none";
}
console.log("List of events that are visible:")
console.log(window.VisibleEvents);
}
function URLToSettings() {
let here = new URL(window.location.href);
if(here.searchParams.get('offset') !== null) {
offset = here.searchParams.get('offset') * 60000
}
if(here.searchParams.get('reminder') == null || here.searchParams.get('flashing') == null || here.searchParams.get('palette') == null || here.searchParams.get('theme') == null || here.searchParams.get('timestamps') == null || here.searchParams.get('visible') == null || here.searchParams.get('notifs') == null || here.searchParams.get('desktop') == null || here.searchParams.get('font') == null) {
console.log("No settings :fear:")
ChangeFont('minecraftregular');
ChangePalette(0);
EventFlash(60); //setting everything up!
SetAudio(-10);
DNotif(0);
ANotif(0);
} else {
CorrectFont = here.searchParams.get('font');
console.log("CORRECT FONT VALUE: " + CorrectFont);
if (CorrectFont == '0') {
CorrectFont = 'minecraftregular'
} else {
CorrectFont = 'sans-serif'
}
NotifTimer = here.searchParams.get('reminder');
EventFlashSec = here.searchParams.get('flashing');
Palette = here.searchParams.get('palette')
theme = here.searchParams.get('theme');
showEventToD = here.searchParams.get('timestamps').charAt(0); //first character of "timestamps" in URL
showEventTuE = here.searchParams.get('timestamps').charAt(1);
showEventDNC = here.searchParams.get('timestamps').charAt(2);
if (showEventDNC == false) {
document.getElementById("day-night-border").style.display = "none";
}
SettingsSelectedEvents = parseInt(here.searchParams.get('visible'));
SettingsNotifyEvents = parseInt(here.searchParams.get('notifs'));
SettingsDesktopNotifs = parseInt(here.searchParams.get('desktop'));
SettingsAudioNotifs = parseInt(here.searchParams.get('audio'))
ChangeFont(CorrectFont)
ChangePalette(Palette);
SetAudio(parseInt(NotifTimer)); //this does not work //then WHY did you add it??
EventFlash(window.EventFlashSec);
if(window.showEventToD == 0) {
document.getElementById('settings-ts-tod').style.color = "#888888";
} else {
document.getElementById('settings-ts-tod').style.color = NormalText;
}
if(window.showEventTuE == 0) {
document.getElementById('settings-ts-tue').style.color = "#888888";
} else {
document.getElementById('settings-ts-tue').style.color = NormalText;
}
if(window.showEventDNC == 0) {
document.getElementById('settings-ts-dnc').style.color = "#888888";
} else {
document.getElementById('settings-ts-dnc').style.color = NormalText;
}
VisibleEvents = [];
AudioEvents = [];
var leadingZeroes = (num, places) => String(num).padStart(places, '0')
var number = here.searchParams.get('visible');
if(number == "0") {
document.getElementById('alert-noevents').style.display = "block";
}
var BinaryEvents = (leadingZeroes(parseInt(number).toString(2),events.length));
console.log(BinaryEvents)
for(i = 0; i < events.length; i++) {
if(BinaryEvents.charAt(i) == "1") {
VisibleEvents.push(events[(events.length - 1) - i]);
}
}
console.log(VisibleEvents);
for(var i = 0; i < VisibleEvents.length; i++) {
for(var j = window.HiddenEventCount; j < EventsToLoad; j++) {
if (window.data[j]["event"].includes(VisibleEvents[i]) && !ok_ids.includes(j)) {
document.getElementById('event_' + String(j)).style.display = "block";
ok_ids.push(j);
console.log(ok_ids)
console.log("saved " + window.data[j]["event"])
}
}}
for(var j = window.HiddenEventCount; j < EventsToLoad; j++) {
if (!ok_ids.includes(j)) {
document.getElementById('event_' + String(j)).style.display = "none";
console.log("hid " + window.data[j]["event"])
}
}
var leadingZeroes = (num, places) => String(num).padStart(places, '0')
var number = here.searchParams.get('notifs');
var BinaryEvents = (leadingZeroes(parseInt(number).toString(2),events.length));
console.log(BinaryEvents)
for(i = 0; i < events.length; i++) {
if(BinaryEvents.charAt(i) == "1") {
AudioEvents.push(events[(events.length - 1) - i]);
}
}
console.log(AudioEvents);
if(window.AudioEvents.length == 0 && DoesStuffExist == true) {
console.log(window.AudioEvents + " audioevents")
document.getElementById('alert-nobells').style.display = "block";
}
const queryString = window.location.search; //no clue what this does but i'm really scared to remove it
ChangeTheme(theme);
HasStuffLoaded = true;
}
}
function NotifToggle(toggle) {
if (window.AudioEvents.includes(toggle)) {
SettingsNotifyEvents = (SettingsNotifyEvents - Math.pow(2, window.events.indexOf(toggle)));
const index = window.AudioEvents.indexOf(toggle);
if (index > -1) {
window.AudioEvents.splice(index, 1);
document.getElementById('notif-' + toggle.replace(/\s/g, '')).style.fill = "#888888";
}
if(window.AudioEvents.length == 0 && NotifTimer > 0) {
document.getElementById('alert-nobells').style.display = "block";
}
} else {
window.AudioEvents.push(toggle);
document.getElementById('alert-nobells').style.display = "none";
document.getElementById('notif-' + toggle.replace(/\s/g, '')).style.fill = NormalText;
SettingsNotifyEvents = (SettingsNotifyEvents + Math.pow(2, window.events.indexOf(toggle)));
for(var i = window.HiddenEventCount; i < EventsToLoad; i++) {
}
}
console.log("List of events that a sound will play for:")
console.log(window.AudioEvents);
}
function AboutMe(variable) {
var date = new Date(null);
date.setSeconds(variable / 1000);
var endpoint = date.toISOString().substr(14, 5);
return(endpoint);
}
function CurrentEvent() {
let currentTime = Date.now() + offset;
if (HiddenEventCount > 0 && DemolitionTime - currentTime >= 0) {
var result = AboutMe(DemolitionTime - currentTime);
console.log(result);
let recentEventData = window.data[HiddenEventCount - 1];
let correctColourCode =
trueEventColours[events.indexOf(recentEventData["event"])];
if (recentEventData["type"] == "major") {
if (IsItACountdown[events.indexOf(recentEventData["event"])] == "yes") {
console.log(DemolitionTime - currentTime);
console.log(TimeOfEventStart)
//console.log(((VisibilityLength[events.indexOf(window.data[HiddenEventCount - 1]['event'])]) * 1000) /* should return like "480000" (8m) in most cases */ - 180000)
if (currentTime >= 180000 + TimeOfEventStart) {
document.getElementById("current-event").innerHTML =
`<span style="color: #aa00aa; font-family: ` + CorrectBold + `;">` + all_text[1] + `</span> <span style="color:` +
correctColourCode +
`; font-family: ` + CorrectBold + `;">` +
window.data[HiddenEventCount - 1]["event"].toUpperCase() +
`!</span><br><span style="color: #aaaaaa;">` + all_text[3] + `<span style="color: #55ff55;">` +
AboutMe(DemolitionTime - currentTime) +
`</span></span>`;
} else {
document.getElementById("current-event").innerHTML =
`<span style="color: #aa00aa; font-family: ` + CorrectBold + `;">` + all_text[1] + `</span> <span style="color:` +
correctColourCode +
`; font-family: ` + CorrectBold + `;">` +
window.data[HiddenEventCount - 1]["event"].toUpperCase() +
`!</span><br><span style="color: #aaaaaa;">` + all_text[2] + `<span style="color: #55ff55;">` +
AboutMe(TimeOfEventStart + 180000 - currentTime) +
`</span></span>`;
console.log("major + countdown");
}
} else {
document.getElementById("current-event").innerHTML =
IsItACountdown[events.indexOf(recentEventData["event"])];
console.log("bro??");
}
} else if (recentEventData["type"] == "minor") {
if (IsItACountdown[events.indexOf(recentEventData["event"])] == "yes") {
document.getElementById("current-event").innerHTML =
`<span style="color: #ff55ff; font-family: ` + CorrectBold + `;">` + all_text[0] + `</span> <span style="color:` +
correctColourCode +
`; font-family: ` + CorrectBold + `;">` +
window.data[HiddenEventCount - 1]["event"].toUpperCase() +
`!</span><br><span style="color: #aaaaaa;">` + all_text[3] + `<span style="color: #55ff55;">` +
result +
`</span></span>`;
console.log("minor + countdown");
} else {
document.getElementById("current-event").innerHTML =
IsItACountdown[events.indexOf(recentEventData["event"])];
console.log("minor, no countdown");
}
}
} else if (HiddenEventCount > 0 && DemolitionTime - currentTime <= 0) {
//document.getElementById("current-event").style.display = "none";
document.getElementById("current-event").innerHTML = WithoutVar;
}
}
function SettingsMenu() {
if(settingsOpened == false) {
document.getElementById('settings').style.color = "#888888";
settingsOpened = true;
document.getElementById('settings-section').style.display = "block";
console.log("Settings opened.");
} else if(settingsOpened == true) {
document.getElementById('settings').style.color = NormalText;
settingsOpened = false;
console.log("Settings closed.");
document.getElementById('settings-section').style.display = "none";
}
let here = new URL(window.location.href);
console.log(here.searchParams.get('reminder'))
}
function SaveSettings() {
let here = new URL(window.location.href);
for(i = 0; i < AllSettings.length; i++) {
here.searchParams.delete(AllSettings[i]);