-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
1027 lines (959 loc) · 37.6 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Talkomatic 2024 - Create and Join Chat Rooms | Online Community Platform with Auto Moderation</title>
<meta name="description" content="Discover Talkomatic 2024, the advanced platform for creating and joining chat rooms with real-time communication and auto moderation. Connect with friends and new communities seamlessly.">
<meta name="keywords" content="Talkomatic 2024, chat rooms, online communication, social platform, join rooms, create rooms, community, real-time chat, auto moderation, online chat">
<meta name="author" content="Talkomatic">
<!-- Open Graph Metadata -->
<meta property="og:title" content="Talkomatic 2024 - Create and Join Chat Rooms">
<meta property="og:description" content="Join Talkomatic 2024 to create and join chat rooms, connect with friends, and discover new communities in real-time with advanced auto moderation.">
<meta property="og:image" content="https://talkomatic.co/images/v2.2.0.0.png">
<meta property="og:url" content="https://www.talkomatic.co">
<meta property="og:type" content="website">
<!-- Twitter Card Metadata -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Talkomatic 2024 - Create and Join Chat Rooms">
<meta name="twitter:description" content="Join Talkomatic 2024 to create and join chat rooms, connect with friends, and discover new communities in real-time with advanced auto moderation.">
<meta name="twitter:image" content="https://talkomatic.co/images/v2.2.0.0.png">
<link rel="canonical" href="https://www.talkomatic.co">
<link rel="icon" type="image/x-icon" href="images/favicon.jpg">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="custom-toastr.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.css" integrity="sha512-6S2HWzVFxruDlZxI3sXOZZ4/eJ8AcxkQH1+JjSe/ONCEqR9L4Ysq5JdT5ipqtzU7WHalNwzwBv+iE51gNHJNqQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/2.1.4/toastr.min.js" integrity="sha512-lbwH47l/tPXJYG9AcFNoJaTMhGvYWhVM9YI43CT+uteTRRaiLCui8snIgyAN8XWgNjNhCqlAUdzZptso6OCoFQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="/socket.io/socket.io.js"></script>
<script src="offensiveWords.js"></script>
<script src="client.js"></script>
<script src="amount.js"></script>
<script src="service-worker.js"></script>
<script src="https://unpkg.com/@popperjs/core@2/dist/umd/popper.min.js"></script>
<script src="https://unpkg.com/tippy.js@6/dist/tippy-bundle.umd.js"></script>
<link rel="manifest" href="manifest.json">
<!-- IOS SUPPORT -->
<link rel="apple-touch-icon" href="images/icons/icon-96x96.png">
<meta name="apple-mobile-web-app-status-bar" content="#616161">
<!-- Structured Data for Rich Snippets -->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "Talkomatic 2024",
"url": "https://www.talkomatic.co",
"description": "Talkomatic 2024 is the original platform for creating and joining chat rooms with advanced auto moderation.",
"author": {
"@type": "Organization",
"name": "Talkomatic"
}
}
</script>
<script>
toastr.options = {
"closeButton": true,
"debug": false,
"newestOnTop": true,
"progressBar": true,
"positionClass": "toast-top-right",
"preventDuplicates": true,
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "5000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut",
"opacity": 1,
"autoDismiss": true
};
</script>
<style>
.social-media {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
margin-top: 10px;
}
.social-media a {
display: flex;
align-items: center;
text-decoration: none;
color: inherit;
margin-top: 5px;
}
.social-media a:hover {
text-decoration: underline;
}
.social-media img {
width: 20px;
height: 20px;
margin-right: 10px;
}
.to p {
color: white;
}
.footer {
padding: 10px 0;
background-color: #FF9800;
color: black;
text-align: center;
width: 100%;
position: sticky;
bottom: 0;
left: 0;
}
.version {
margin-top: auto;
padding: 10px;
font-size: 12px;
color: rgb(221, 221, 221);
font-family: 'Courier New', Courier, monospace;
letter-spacing: 1px;
font-weight: bold;
}
.room-creation {
margin-bottom: 20px;
}
#searchRoomId {
width: 100%;
}
.join-private-link {
display: block;
margin-top: 0px;
color: #FF9800;
text-decoration: none;
font-size: 14px;
}
.join-private-link:hover {
text-decoration: underline;
}
@media (min-width: 768px) {
#searchRoomId {
width: 250px;
}
}
.refreshbtn, .searchbtn, .button-style, .join-room-button {
background-color: #222222;
border-radius: 4px;
padding: 10px 20px;
transition: background-color 0.3s ease;
}
.refreshbtn:hover, .searchbtn:hover, .button-style:hover, .join-room-button:hover {
background-color: #444444;
}
.refreshbtn:active, .searchbtn:active, .button-style:active, .join-room-button:active {
background-color: #666666;
}
.right-column {
display: flex;
flex-direction: column;
flex: 1;
position: relative;
min-height: 0;
}
#roomList {
flex: 1;
overflow-y: auto;
padding-bottom: 50px;
scrollbar-width: thin;
scrollbar-color: #FF9800 white;
}
#roomList::-webkit-scrollbar {
width: 8px;
}
#roomList::-webkit-scrollbar-track {
background: white;
}
#roomList::-webkit-scrollbar-thumb {
background-color: #FF9800;
border-radius: 10px;
}
@media (max-width: 1020px) {
body {
font-size: 16px;
}
.flex {
flex-direction: column;
}
.left-column, .right-column {
width: 100%;
max-height: none;
overflow-y: visible;
}
.header-text {
font-size: 1.5rem;
text-align: center;
margin: 1rem 0;
}
.custom-link {
display: inline-block;
margin: 0.5rem;
}
.full-width-banner {
padding: 0.5rem;
text-align: center;
}
.info-box {
margin: 1rem;
padding: 1rem;
display: flex;
flex-direction: column;
}
.info-item {
margin-bottom: 0.5rem;
}
.input-group {
flex-direction: column;
}
.input-group input {
width: 100%;
margin-bottom: 0.5rem;
}
.button-style {
width: 100%;
margin-top: 0.5rem;
}
#signOutBtn {
margin-top: 1rem;
}
.radio-container {
display: flex;
align-items: center;
margin-bottom: 0.5rem;
}
.radio-icon {
margin-right: 0.5rem;
}
.social-media {
flex-direction: row;
flex-wrap: wrap;
justify-content: space-around;
}
.social-media a {
width: 45%;
margin-bottom: 0.5rem;
}
.right-column-header {
flex-direction: column;
align-items: center;
padding: 1rem;
}
.header-left, .header-right {
width: 100%;
text-align: center;
margin-bottom: 0.5rem;
}
.utility {
flex-direction: column;
padding: 1rem;
}
.search-container {
width: 100%;
}
#searchRoomId,
#searchRoomBtn {
width: 100%;
margin-bottom: 0.5rem;
}
.button-container {
display: flex;
gap: 10px; /* optional for spacing between buttons */
right: 0;
}
#roomList {
padding: 1rem;
}
.footer {
position: static;
margin-top: 2rem;
padding: 1rem;
}
/* Mobile-specific styles for buttons */
.button-container {
width: 100%;
}
#refreshRoomsBtn {
width: 80%;
}
#settingsbtn {
width: 20%;
display: flex;
justify-content: center;
align-items: center;
}
}
/* Additional CSS for desktop view */
@media (min-width: 1021px) {
.utility {
display: flex;
justify-content: space-between;
align-items: center;
}
.search-container {
display: flex;
align-items: center;
flex: 1;
gap: 10px; /* added gap for spacing */
}
.button-container {
display: flex;
align-items: center;
margin-left: auto;
gap: 10px; /* added gap for spacing */
}
#searchRoomId {
width: auto;
}
.refreshbtn,
.refreshbtn img {
display: inline-block;
vertical-align: middle;
}
#settingsbtn {
padding: 10px 20px; /* ensure consistent padding */
}
#settingsbtn img {
width: 20px;
height: 20px;
}
}
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgba(0, 0, 0, 0.6);
}
.modal-content {
background-color: #393937;
margin: auto;
padding: 30px;
border-radius: 8px;
width: 800px;
max-width: 90%;
height: 600px;
max-height: 90%;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
overflow-y: auto;
}
.close {
position: absolute;
top: 15px;
right: 20px;
font-size: 24px;
font-weight: bold;
cursor: pointer;
color: #fff;
}
.tabs {
display: flex;
justify-content: space-around;
margin-bottom: 20px;
overflow-x: auto;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
scrollbar-width: none;
-ms-overflow-style: none;
}
.tabs::-webkit-scrollbar {
display: none;
}
.tab {
padding: 10px 20px;
cursor: pointer;
color: #fff;
transition: background-color 0.3s;
}
.tab.active {
border-bottom: 2px solid #fff;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
h2 {
color: #fff;
}
.color-buttons {
display: flex;
justify-content: center;
flex-wrap: wrap;
margin-bottom: 20px;
margin-top: 30px;
}
.color-button {
width: 40px;
height: 40px;
display: inline-block;
margin: 5px;
cursor: pointer;
}
.preview-textarea {
width: 100%;
height: 120px;
background-color: #000;
color: #fff;
padding: 15px;
resize: none;
border-radius: 4px;
font-size: 16px;
}
@media (max-width: 600px) {
.modal-content {
height: auto;
}
.color-buttons {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 5px;
justify-items: center;
padding: 0 50px;
}
.color-button {
width: 40px;
height: 40px;
}
}
.color-button.active {
border: 2px solid black;
}
.avatar-selection-heading {
text-align: center;
color: #FFFFFF;
margin-bottom: 10px;
}
.avatar-buttons-container {
max-height: 350px;
overflow-y: auto;
padding: 0 50px;
}
.avatar-buttons {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 10px;
margin-top: 10px;
}
.avatar-button {
background: none;
border: 2px solid transparent;
cursor: pointer;
padding: 2px;
transition: border-color 0.3s ease;
}
.avatar-button:hover,
.avatar-button.active {
border-color: #FF9800;
}
.avatar-button img {
width: 100%;
height: auto;
display: block;
}
.avatar-buttons-container::-webkit-scrollbar {
width: 8px;
}
.avatar-buttons-container::-webkit-scrollbar-track {
background: white;
}
.avatar-buttons-container::-webkit-scrollbar-thumb {
background-color: #FF9800;
border-radius: 10px;
}
@media (max-width: 768px) {
.avatar-buttons {
grid-template-columns: repeat(3, 1fr);
}
.avatar-buttons-container {
max-height: 350px;
overflow-y: auto;
padding: 0 30px;
}
.avatar-button {
padding: 1px;
}
}
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background-color: #333;
color: white;
}
.navbar .nav-links {
display: flex;
gap: 15px;
}
.navbar .nav-links a {
color: white;
text-decoration: none;
font-size: 20px;
}
.navbar .nav-links a:hover {
color: #FF9800;
text-decoration: none;
font-size: 20px;
}
.navbar .logout-btn {
background-color: #f44336;
padding: 5px 10px;
border: none;
cursor: pointer;
color: white;
}
@media (min-width: 1021px) {
.navbar-mobile {
display: none;
}
}
@media (max-width: 1021px) {
.navbar {
display: none;
}
.navbar-mobile {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background-color: #333;
color: white;
}
.navbar-mobiler .nav-links {
display: flex;
gap: 15px;
}
.navbar-mobile .nav-links a {
color: white;
text-decoration: none;
font-size: 16px;
}
.navbar-mobile .nav-links a:hover {
color: #FF9800;
text-decoration: none;
font-size: 20px;
}
.navbar-mobile .logout-btn {
background-color: #f44336;
padding: 5px 10px;
border: none;
cursor: pointer;
color: white;
}
}
</style>
</head>
<body>
<div class="flex flex-col md:flex-row">
<!-- Left Column -->
<div class="left-column custom-bg md:w-383 md:max-h-screen overflow-y-auto">
<div class="navbar-mobile">
<div class="nav-links">
<a href="/">Lobby</a>
<a href="coming-soon.html">Profiles</a>
<a href="coming-soon.html">Forum</a>
</div>
<button class="logout-btn" onclick="signOut()">Log Out</button>
</div>
<div class="p-2 flex flex-col items-center">
<div class="header-text mt-1 mb-4">
<span class="custom-orange">Tal<span class="italic-k">k</span>omatic<sup>™</sup></span><span class="custom-white"> Lobby</span>
</div>
<a href="about.html" class="custom-link mt-2 hover:custom-link-hover">About Talkomatic<sup>™</sup></a>
<a href="patch-notes.html" class="custom-link mt-2 hover:custom-link-hover">Patch Notes v2.3.0.0</a>
<a href="faq.html" class="custom-link mt-2 hover:custom-link-hover">FAQ</a>
</div>
<div class="full-width-banner mt=2">
<span class="banner-text">Be Known As...</span>
</div>
<div class="info-box mt-2 p-3 border-orange">
<div class="info-item">
<label for="name">Your name:</label>
<input type="text" id="name" name="name" placeholder="Username" maxlength="10">
</div>
<div class="info-item">
<label for="location">Location:</label>
<input type="text" id="location" name="location" placeholder="Earth" maxlength="10">
</div>
<button class="button-style" onclick="updateUsername()">
Change <img src="icons/interwindarrows.png" alt="Change" class="button-icon">
</button>
</div>
<div class="full-width-banner mt-2">
<span class="banner-text">Create a room...</span>
</div>
<div class="room-creation mt-2">
<input type="text" id="roomName" name="roomName" placeholder="Room name" class="room-name-input" maxlength="20">
<label class="radio-container">
<input type="radio" name="roomType" value="public" checked>
<img src="icons/handshake.png" alt="Public" class="radio-icon">
Public
<span class="radio-checkmark"></span>
</label>
<label class="radio-container">
<input type="radio" name="roomType" value="private">
<img src="icons/private.png" alt="Private" class="radio-icon">
Private
<span class="radio-checkmark"></span>
</label>
<label class="radio-container">
<input type="radio" name="roomType" value="secret">
<img src="icons/key.png" alt="Secret" class="radio-icon">
Secret
<span class="radio-checkmark"></span>
</label>
<a href="rooms.html" class="join-private-link">How to use private rooms</a>
<button id="createRoomBtn" class="join-room-button">
Create Room
<img src="icons/chatbubble.png" alt="Chat" class="button-icon">
</button>
<div class="p-2 text-gray-500 text-sm w-full bottom-left social-color">
<p>Connect with us on our official socials:</p>
<div class="social-media">
<a href="https://www.reddit.com/r/talkomatic/" target="_blank">
<img src="socials/reddit.png" alt="Reddit" class="social-icon"> Reddit
</a>
<a href="https://www.instagram.com/talkomaticofficial/" target="_blank">
<img src="socials/instagram.png" alt="Instagram" class="social-icon"> Instagram
</a>
<a href="https://twitter.com/talkomatic_co" target="_blank">
<img src="socials/x.png" alt="Twitter" class="social-icon"> Twitter/X
</a>
<a href="https://discord.gg/AY7Bk6zgze" target="_blank">
<img src="socials/discord.png" alt="Discord" class="social-icon"> Discord
</a>
</div>
</div>
</div>
</div>
<!-- Right Column -->
<div id="roomListContainer" class="right-column bg-black md:flex-1 md:max-h-screen overflow-y-auto">
<div class="navbar">
<div class="nav-links">
<a href="/">Lobby</a>
<a href="coming-soon.html">Profiles</a>
<a href="coming-soon.html">Forum</a>
</div>
<button class="logout-btn" onclick="signOut()">Log Out</button>
</div>
<div class="right-column-header">
<div class="header-left">
Join a room...
</div>
<div class="header-right">
<div id="roomsCount">room(s) available</div>
<div id="usersCount">user(s) online</div>
</div>
</div>
<!-- Search Bar, Search Button and Refresh Button -->
<div class="flex items-center justify-between p-4 utility">
<div class="search-container">
<input type="text" id="searchRoomId" placeholder="Search by Room ID" class="p-2 border border-gray-400">
<button id="searchRoomBtn" class="p-2 searchbtn text-white">Search</button>
</div>
<div class="button-container">
<button id="refreshRoomsBtn" class="p-2 searchbtn text-white">Refresh Room List</button>
<button id="settingsbtn" class="p-2 refreshbtn text-white">
<img src="icons/settings.png" alt="Settings" style="width: 20px; height: 20px;">
</button>
</div>
</div>
<!-- Your right column content, including settings modal -->
<div id="settingsModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2 class="text-2xl font-bold mb-4">Settings</h2>
<div class="tabs">
<div class="tab active" data-tab="color">Color</div>
<div class="tab" data-tab="avatar">Avatar</div>
<div class="tab" data-tab="theme">Theme</div>
<div class="tab" data-tab="font">Font</div>
<div class="tab" data-tab="settings">User info</div>
</div>
<div class="tab-content active" id="color">
<div class="color-buttons">
<span class="color-button" style="background-color: #FFFFFF;" data-color="white"></span>
<span class="color-button" style="background-color: #FF9800;" data-color="orange"></span>
<span class="color-button" style="background-color: #00FFFF;" data-color="blue"></span>
<span class="color-button" style="background-color: #00FF00;" data-color="green"></span>
<span class="color-button" style="background-color: #FF00FF;" data-color="pink"></span>
<span class="color-button" style="background-color: #FFFF00;" data-color="yellow"></span>
</div>
<textarea class="preview-textarea" readonly>This is what your text color will look like.</textarea>
</div>
<div class="tab-content" id="avatar">
<h3 class="avatar-selection-heading">Select the avatar you would like next to your name:</h3>
<div class="avatar-buttons-container">
<div class="avatar-buttons">
<button class="avatar-button" data-avatar="avatar1"><img src="avatars/1.png" alt="Avatar 1"></button>
<button class="avatar-button" data-avatar="avatar2"><img src="avatars/2.png" alt="Avatar 2"></button>
<button class="avatar-button" data-avatar="avatar3"><img src="avatars/3.png" alt="Avatar 3"></button>
<button class="avatar-button" data-avatar="avatar4"><img src="avatars/4.png" alt="Avatar 4"></button>
<button class="avatar-button" data-avatar="avatar5"><img src="avatars/5.png" alt="Avatar 5"></button>
<button class="avatar-button" data-avatar="avatar6"><img src="avatars/6.png" alt="Avatar 6"></button>
<button class="avatar-button" data-avatar="avatar7"><img src="avatars/7.png" alt="Avatar 7"></button>
<button class="avatar-button" data-avatar="avatar8"><img src="avatars/8.png" alt="Avatar 8"></button>
<button class="avatar-button" data-avatar="avatar9"><img src="avatars/9.png" alt="Avatar 9"></button>
<button class="avatar-button" data-avatar="avatar10"><img src="avatars/10.png" alt="Avatar 10"></button>
<button class="avatar-button" data-avatar="avatar11"><img src="avatars/11.png" alt="Avatar 11"></button>
<button class="avatar-button" data-avatar="avatar12"><img src="avatars/12.png" alt="Avatar 12"></button>
<button class="avatar-button" data-avatar="avatar13"><img src="avatars/13.png" alt="Avatar 13"></button>
<button class="avatar-button" data-avatar="avatar14"><img src="avatars/14.png" alt="Avatar 14"></button>
<button class="avatar-button" data-avatar="avatar15"><img src="avatars/15.png" alt="Avatar 15"></button>
</div>
</div>
</div>
<div class="tab-content to" id="theme">
<p>Coming Soon</p>
</div>
<div class="tab-content to" id="font">
<p>Coming Soon</p>
</div>
<div class="tab-content to" id="settings">
<p>Your userId is: <span id="userIdDisplay"></span></p>
</div>
</div>
</div>
<div id="roomList">
<!-- Rooms will be dynamically added here -->
</div>
<!-- Footer -->
<footer class="footer">
Copyright 2024 Talkomatic.co | Revived by the community
</footer>
</div>
</div>
<script>
function updateUserIdDisplay() {
const userIdDisplay = document.getElementById('userIdDisplay');
const userId = getCookie('userId');
if (userIdDisplay && userId) {
userIdDisplay.textContent = userId;
}
}
// Color map for color selection
const colorMap = {
'white': '#FFFFFF',
'orange': '#FF9800',
'blue': '#00FFFF',
'green': '#00FF00',
'pink': '#FF00FF',
'yellow': '#FFFF00'
};
// Avatar map for avatar selection
const avatarMap = {
'avatar1': 'avatars/1.png',
'avatar2': 'avatars/2.png',
'avatar3': 'avatars/3.png',
'avatar4': 'avatars/4.png',
'avatar5': 'avatars/5.png',
'avatar6': 'avatars/6.png',
'avatar7': 'avatars/7.png',
'avatar8': 'avatars/8.png',
'avatar9': 'avatars/9.png',
'avatar10': 'avatars/10.png',
'avatar11': 'avatars/11.png',
'avatar12': 'avatars/12.png',
'avatar13': 'avatars/13.png',
'avatar14': 'avatars/14.png',
'avatar15': 'avatars/15.png'
};
// Get the modal and buttons
var modal = document.getElementById("settingsModal");
var settingsBtn = document.getElementById("settingsbtn");
var closeModalBtn = document.getElementsByClassName("close")[0];
var tabs = document.getElementsByClassName("tab");
var tabContents = document.getElementsByClassName("tab-content");
var selectedColor = getCookie('userColor') || "#FFFFFF";
var selectedAvatar = getCookie('userAvatar') || "avatar1";
// Open the modal when the settings button is clicked
settingsBtn.onclick = function() {
modal.style.display = "block";
updateUserIdDisplay();
}
// Close the modal when the close button is clicked
closeModalBtn.onclick = function() {
modal.style.display = "none";
}
// Close the modal when the user clicks outside of it
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
// Update active color button
function updateActiveColorButton() {
document.querySelectorAll('.color-button').forEach(button => {
if (button.getAttribute('data-color') === selectedColor) {
button.classList.add('active');
} else {
button.classList.remove('active');
}
});
}
// Update active avatar button
function updateActiveAvatarButton() {
document.querySelectorAll('.avatar-button').forEach(button => {
if (button.getAttribute('data-avatar') === selectedAvatar) {
button.classList.add('active');
} else {
button.classList.remove('active');
}
});
}
// Switch between tabs
Array.from(tabs).forEach(function(tab) {
tab.addEventListener('click', function() {
var tabId = this.getAttribute('data-tab');
Array.from(tabs).forEach(function(tab) {
tab.classList.remove('active');
});
this.classList.add('active');
Array.from(tabContents).forEach(function(content) {
content.classList.remove('active');
});
document.getElementById(tabId).classList.add('active');
});
});
// Color selection
Array.from(document.getElementsByClassName('color-button')).forEach(function(button) {
button.addEventListener('click', function() {
selectedColor = this.getAttribute('data-color');
document.querySelector('.preview-textarea').style.color = colorMap[selectedColor];
setCookie('userColor', selectedColor, 30); // Store the color name in a cookie
toastr.success('Text color changed');
updateActiveColorButton();
});
});
// Avatar selection
Array.from(document.getElementsByClassName('avatar-button')).forEach(function(button) {
button.addEventListener('click', function() {
selectedAvatar = this.getAttribute('data-avatar');
setCookie('userAvatar', selectedAvatar, 30); // Store the avatar in a cookie
updateActiveAvatarButton();
toastr.success('Avatar changed');
});
});
// Initialize color and mod mode on page load
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('.preview-textarea').style.color = selectedColor;
updateActiveColorButton();
updateActiveAvatarButton();
// Check mod mode on page load
if (getCookie('modMode') === 'true') {
toastr.success('Mod mode is already activated');
}
});
// Set a cookie
function setCookie(name, value, days) {
var expires = "";
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
// Get a cookie
function getCookie(name) {
let cookieArray = document.cookie.split(';');
for (let i = 0; i < cookieArray.length; i++) {
let cookiePair = cookieArray[i].split('=');
if (name == cookiePair[0].trim()) {
return decodeURIComponent(cookiePair[1]);
}
}
return null;
}
// Check and activate mod mode
function checkModMode() {
const usernameInput = document.getElementById('name');
const locationInput = document.getElementById('location');
if (usernameInput) {
const code = usernameInput.value;
fetch('/verify-mod-code', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ code })
})
.then(response => response.json())
.then(data => {
if (data.success) {
setCookie('modMode', 'true', 7); // Save mod mode in cookie for 7 days
usernameInput.value = '<';
locationInput.value = 'dev>';
toastr.success('Mod mode activated');
}
})
.catch(error => {
console.error('Error:', error);
toastr.error('An error occurred while verifying the code');
});
}
}
// Event listener for the change button
const changeButton = document.querySelector('.button-style');
if (changeButton) {
changeButton.addEventListener('click', checkModMode);
}
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/service-worker.js').then(registration => {
console.log('ServiceWorker registration successful with scope: ', registration.scope);
// Request permission for push notifications
Notification.requestPermission(status => {
console.log('Notification permission status:', status);
if (status === 'granted') {
subscribeUserToPush(registration);
}
});
}, err => {
console.log('ServiceWorker registration failed: ', err);
});
});
}
function urlBase64ToUint8Array(base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/');