-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSPACEIE CHATT
1490 lines (1319 loc) ยท 42.5 KB
/
SPACEIE CHATT
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
<html><head><base href=""><style>
@font-face {
font-family: 'LDFComicSans';
src: url('/Ldfcomicsans-jj7l.ttf') format('truetype');
}
body {
margin: 0;
padding: 0;
font-family: 'LDFComicSans', 'Arial Rounded MT Bold', Arial, sans-serif;
background: linear-gradient(135deg, #1a0b2e, #2a1b3e);
color: #fff;
height: 100vh;
display: flex;
flex-direction: column;
}
.chat-container {
display: flex;
height: 100vh;
}
.users-panel {
width: 250px;
background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/images.jfif');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
padding: 20px;
border-right: 2px solid rgba(255, 255, 255, 0.1);
}
.users-panel h2,
.users-panel h3 {
color: #fff;
text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
.user-list {
list-style: none;
padding: 0;
}
.user-item {
display: flex;
align-items: center;
justify-content: space-between;
margin: 10px 0;
padding: 10px;
border-radius: 15px;
background: rgba(0, 0, 0, 0.6);
transition: 0.3s;
backdrop-filter: blur(5px);
}
.user-info {
display: flex;
align-items: center;
}
.user-info-text {
display: flex;
flex-direction: column;
margin-left: 10px;
}
.ban-button, .unban-button, .make-admin-button, .remove-admin-button {
background: #ff4444;
border: none;
border-radius: 5px;
padding: 5px 10px;
color: white;
cursor: pointer;
margin-left: 10px;
display: none;
}
.make-admin-button {
background: #4CAF50;
}
.remove-admin-button {
background: #f44336;
}
.unban-button {
background: #44ff44;
}
.ban-button:hover {
background: #ff0000;
}
.unban-button:hover {
background: #00ff00;
}
.make-admin-button:hover {
background: #2E7D32;
}
.remove-admin-button:hover {
background: #c62828;
}
.banned {
opacity: 0.5;
position: relative;
}
.banned::after {
content: '๐ซ BANNED';
position: absolute;
right: 10px;
color: #ff4444;
font-size: 0.8em;
}
.chat-area {
flex-grow: 1;
display: flex;
flex-direction: column;
padding: 20px;
background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/images.jfif');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
.messages {
flex-grow: 1;
overflow-y: auto;
margin-bottom: 20px;
padding: 20px;
}
.message {
display: flex;
align-items: start;
margin-bottom: 20px;
animation: slideIn 0.3s ease-out;
}
.rooms-list {
margin-top: 20px;
border-top: 2px solid rgba(255, 255, 255, 0.1);
padding-top: 20px;
}
.room-item {
display: flex;
align-items: center;
margin: 10px 0;
padding: 10px;
border-radius: 15px;
background: rgba(0, 0, 0, 0.6);
cursor: pointer;
transition: 0.3s;
backdrop-filter: blur(5px);
}
.room-item.active {
background: #8f6ed5;
}
.room-item:hover {
background: rgba(143, 110, 213, 0.5);
}
.room-icon {
width: 24px;
height: 24px;
margin-right: 10px;
}
@keyframes slideIn {
from {
transform: translateY(20px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.message-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
margin-right: 15px;
border: 2px solid #8f6ed5;
}
.message-content {
background: rgba(0, 0, 0, 0.7);
padding: 15px;
border-radius: 20px;
max-width: 70%;
backdrop-filter: blur(5px);
}
.message-header {
display: flex;
align-items: center;
margin-bottom: 5px;
}
.message-username {
color: #8f6ed5;
font-weight: bold;
margin-right: 10px;
}
.message[data-username="unhingedALIWEN"] .message-username {
background: linear-gradient(45deg, #ff6b6b, #ff3a3a);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-weight: bold;
}
.message-time {
color: rgba(255, 255, 255, 0.5);
font-size: 0.8em;
}
.message-text {
color: #fff;
line-height: 1.4;
}
.input-area {
display: flex;
gap: 10px;
padding: 20px;
background: rgba(0, 0, 0, 0.7);
border-radius: 15px;
backdrop-filter: blur(5px);
}
.message-input {
flex-grow: 1;
background: rgba(255, 255, 255, 0.1);
border: none;
border-radius: 10px;
padding: 15px;
color: #fff;
font-size: 16px;
}
.message-input:focus {
outline: none;
background: rgba(255, 255, 255, 0.15);
}
.send-button {
background: #8f6ed5;
border: none;
border-radius: 10px;
padding: 15px 30px;
color: #fff;
font-weight: bold;
cursor: pointer;
transition: 0.3s;
}
.send-button:hover {
background: #7c5bc9;
transform: scale(1.05);
}
.current-room {
font-size: 1.5em;
margin-bottom: 20px;
color: #8f6ed5;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.developer-badge {
background: linear-gradient(45deg, #ff6b6b, #ff3a3a);
color: white;
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8em;
margin-left: 8px;
margin-right: 8px;
font-weight: bold;
animation: glow 2s infinite alternate;
}
@keyframes glow {
from {
box-shadow: 0 0 5px #ff6b6b, 0 0 10px #ff6b6b;
}
to {
box-shadow: 0 0 10px #ff3a3a, 0 0 20px #ff3a3a;
}
}
.admin-badge {
background: linear-gradient(45deg, #4CAF50, #2E7D32);
color: white;
padding: 2px 8px;
border-radius: 12px;
font-size: 0.8em;
margin-left: 8px;
margin-right: 8px;
font-weight: bold;
animation: adminGlow 2s infinite alternate;
}
@keyframes adminGlow {
from {
box-shadow: 0 0 5px #4CAF50, 0 0 10px #4CAF50;
}
to {
box-shadow: 0 0 10px #2E7D32, 0 0 20px #2E7D32;
}
}
.emoji-picker {
position: relative;
display: inline-block;
}
.emoji-button {
background: #8f6ed5;
border: none;
border-radius: 10px;
padding: 15px;
color: #fff;
cursor: pointer;
transition: 0.3s;
}
.emoji-panel {
display: none;
position: absolute;
bottom: 100%;
left: 0;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 10px;
padding: 10px;
margin-bottom: 10px;
z-index: 1000;
}
.emoji-panel.active {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 5px;
}
.custom-emoji {
width: 40px;
height: 40px;
cursor: pointer;
transition: transform 0.2s;
border-radius: 5px;
}
.custom-emoji:hover {
transform: scale(1.2);
background: rgba(255, 255, 255, 0.1);
}
.message-text img.emoji {
width: 24px;
height: 24px;
vertical-align: middle;
margin: 0 2px;
}
.typing-indicator {
color: rgba(255, 255, 255, 0.7);
font-style: italic;
padding: 5px 15px;
font-size: 0.9em;
animation: fadeInOut 1s infinite;
}
@keyframes fadeInOut {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}
.games-button {
background: #8f6ed5;
border: none;
border-radius: 15px;
padding: 15px 30px;
color: #fff;
font-weight: bold;
cursor: pointer;
transition: 0.3s;
margin: 20px auto;
display: none; /* Hidden by default, shown only in games room */
text-decoration: none;
text-align: center;
}
.games-button:hover {
background: #7c5bc9;
transform: scale(1.05);
box-shadow: 0 0 15px rgba(143, 110, 213, 0.5);
}
.minigames-popup {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, 0.9);
backdrop-filter: blur(10px);
padding: 20px;
border-radius: 15px;
z-index: 1000;
width: 80%;
max-width: 600px;
}
.minigames-popup.active {
display: block;
animation: popIn 0.3s ease-out;
}
.minigames-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-top: 20px;
}
.minigame-card {
background: rgba(143, 110, 213, 0.2);
border-radius: 10px;
padding: 15px;
text-align: center;
cursor: pointer;
transition: 0.3s;
}
.minigame-card:hover {
background: rgba(143, 110, 213, 0.4);
transform: scale(1.05);
}
.close-popup {
position: absolute;
top: 10px;
right: 10px;
background: none;
border: none;
color: #fff;
font-size: 24px;
cursor: pointer;
}
@keyframes popIn {
from {
transform: translate(-50%, -50%) scale(0.8);
opacity: 0;
}
to {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
}
.game-container {
display: none;
width: 100%;
height: 400px;
margin-top: 20px;
}
.game-container.active {
display: block;
}
.welcome-popup {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: rgba(0, 0, 0, 0.9);
backdrop-filter: blur(10px);
padding: 30px;
border-radius: 15px;
z-index: 1000;
text-align: center;
animation: welcomePopIn 0.5s ease-out;
box-shadow: 0 0 20px rgba(143, 110, 213, 0.3);
}
.welcome-popup h2 {
color: #8f6ed5;
margin-bottom: 20px;
}
.welcome-popup p {
color: #fff;
margin-bottom: 20px;
line-height: 1.5;
}
.welcome-close {
background: #8f6ed5;
border: none;
border-radius: 10px;
padding: 10px 20px;
color: #fff;
cursor: pointer;
transition: 0.3s;
font-family: inherit;
}
.welcome-close:hover {
background: #7c5bc9;
transform: scale(1.05);
}
@keyframes welcomePopIn {
from {
opacity: 0;
transform: translate(-50%, -50%) scale(0.8);
}
to {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
}
/* Add to existing styles */
.reply-button {
background: none;
border: none;
color: #8f6ed5;
cursor: pointer;
padding: 5px;
font-size: 0.8em;
opacity: 0.7;
transition: 0.3s;
}
.reply-button:hover {
opacity: 1;
transform: scale(1.1);
}
.reply-container {
background: rgba(143, 110, 213, 0.1);
padding: 10px;
margin-bottom: 10px;
}
/* Add this CSS to hide the file input */
.file-input {
display: none;
}
/* Add this CSS to style the upload button nicely */
.upload-button {
background: #8f6ed5;
border: none;
border-radius: 10px;
padding: 15px;
color: #fff;
cursor: pointer;
transition: 0.3s;
}
.upload-button:hover {
background: #7c5bc9;
transform: scale(1.05);
}
.upload-button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* Add to existing CSS */
.soundbar-button {
background: #8f6ed5;
border: none;
border-radius: 10px;
padding: 15px;
color: #fff;
cursor: pointer;
transition: 0.3s;
}
.soundbar-panel {
display: none;
position: absolute;
bottom: 100%;
left: 0;
background: rgba(0, 0, 0, 0.9);
backdrop-filter: blur(10px);
border-radius: 10px;
padding: 15px;
margin-bottom: 10px;
z-index: 1000;
width: 300px;
}
.soundbar-panel.active {
display: block;
}
.sound-item {
display: flex;
align-items: center;
gap: 10px;
padding: 8px;
border-radius: 8px;
background: rgba(143, 110, 213, 0.2);
margin-bottom: 8px;
cursor: pointer;
transition: 0.3s;
}
.sound-item:hover {
background: rgba(143, 110, 213, 0.4);
}
.sound-item.playing {
background: rgba(143, 110, 213, 0.6);
}
.sound-item-title {
flex-grow: 1;
color: #fff;
font-size: 0.9em;
}
.mute-button {
background: #8f6ed5;
border: none;
border-radius: 10px;
padding: 10px 15px;
color: #fff;
cursor: pointer;
transition: 0.3s;
margin: 10px 0;
width: 100%;
font-weight: bold;
}
.mute-button:hover {
background: #7c5bc9;
transform: scale(1.02);
}
.mute-button.muted {
background: #ff4444;
animation: pulseRed 2s infinite;
}
.mute-button.muted:hover {
background: #ff0000;
}
@keyframes pulseRed {
0% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4); }
70% { box-shadow: 0 0 0 10px rgba(255, 68, 68, 0); }
100% { box-shadow: 0 0 0 0 rgba(255, 68, 68, 0); }
}
/* Add CSS for the cosmic tokens button */
.cosmic-tokens-button {
background: linear-gradient(45deg, #8f6ed5, #b392e9);
border: none;
border-radius: 10px; /* Reduced from 15px */
padding: 8px 15px; /* Reduced from 15px 30px */
color: #fff;
font-weight: bold;
text-decoration: none;
display: inline-block;
margin: 5px 10px; /* Reduced from 10px 20px */
cursor: pointer;
transition: 0.3s;
animation: tokenGlow 2s infinite alternate;
text-align: center;
font-size: 0.9em; /* Added to make text smaller */
}
</style></head><body>
<div class="chat-container">
<div class="users-panel">
<h2>SPACEIE CHATT :p</h2>
<button id="muteChatButton" class="mute-button">
๐ Chat Sounds On
</button>
<ul class="user-list" id="userList">
</ul>
<div class="rooms-list">
<h3>Chatrooms</h3>
<div class="room-item active" data-room="general">
<span class="room-icon">๐</span>
General Space
</div>
<div class="room-item" data-room="aliens">
<span class="room-icon">๐ฝ</span>
Alien Lounge
</div>
<div class="room-item" data-room="cosmos">
<span class="room-icon">๐</span>
Cosmos Club
</div>
<div class="room-item" data-room="asteroids">
<span class="room-icon">โ๏ธ</span>
Asteroid Bar
</div>
<div class="room-item" data-room="games">
<span class="room-icon">๐ฎ</span>
Game Zone
</div>
</div>
</div>
<div class="chat-area">
<h3 class="current-room" id="currentRoom">๐ General Space</h3>
<a href="https://websim.ai/@Doxlie/free-cosmic-tokens" class="cosmic-tokens-button" target="_blank">
๐ Get Free Cosmic Tokens ๐
</a>
<a href="https://websim.com/games" class="games-button">
๐ฎ Browse Games ๐ฎ
</a>
<div id="typingIndicator" class="typing-indicator"></div>
<div class="messages" id="messages">
</div>
<div class="input-area">
<div class="soundbar-picker">
<button class="soundbar-button">๐</button>
<div class="soundbar-panel">
<div class="sound-item" data-sound="/undertale-meow.mp3">
<span class="sound-item-title">Meow</span>
<span>๐ฑ</span>
</div>
<div class="sound-item" data-sound="/tuco-get-out_GUkoo8V.mp3">
<span class="sound-item-title">Tuco: Get Out!</span>
<span>๐ </span>
</div>
<div class="sound-item" data-sound="/gunshoot.mp3">
<span class="sound-item-title">Gunshot</span>
<span>๐ซ</span>
</div>
<div class="sound-item" data-sound="/hl2-stalker-scream.mp3">
<span class="sound-item-title">Stalker Scream</span>
<span>๐ฑ</span>
</div>
<div class="sound-item" data-sound="/letsgogambling.ogg">
<span class="sound-item-title">Lets Go Gambling</span>
<span>๐ฐ</span>
</div>
</div>
</div>
<div class="emoji-picker">
<button class="emoji-button">๐</button>
<div class="emoji-panel">
<img src="/NOO.png" class="custom-emoji" data-emoji="noo" title="NOO">
<img src="/huhu.jfif" class="custom-emoji" data-emoji="huhu" title="Huhu">
<img src="/ayobruh.png" class="custom-emoji" data-emoji="ayobruh" title="Ayo bruh">
<img src="/ilavau.png" class="custom-emoji" data-emoji="ilavau" title="I lava u">
<img src="/gnarp.jfif" class="custom-emoji" data-emoji="gnarp" title="Gnarp">
<img src="/download.png" class="custom-emoji" data-emoji="teletubby" title="Teletubby">
<img src="/emoji.jfif" class="custom-emoji" data-emoji="purplehood" title="Purple Hood">
</div>
</div>
<input type="file" id="fileInput" class="file-input" accept="image/png, image/jpeg, image/gif, image/webp">
<button class="upload-button" id="uploadButton">๐ท</button>
<input type="text" class="message-input" id="messageInput" placeholder="Send a message to the galaxy...">
<button class="send-button" id="sendButton">Send ๐</button>
</div>
</div>
</div>
<audio id="messageSound" src="/undertale-meow.mp3"></audio>
<script>
const roomEmojis = {
'general': '๐',
'aliens': '๐ฝ',
'cosmos': '๐',
'asteroids': 'โ๏ธ',
'games': '๐ฎ'
};
const room = new WebsimSocket();
const messages = document.getElementById('messages');
const messageInput = document.getElementById('messageInput');
const sendButton = document.getElementById('sendButton');
const userList = document.getElementById('userList');
const currentRoomTitle = document.getElementById('currentRoom');
let currentRoom = 'general';
let bannedUsers = new Set();
let adminUsers = new Set(['unhingedALIWEN']); // Initialize with the developer
let lastMessageTime = 0;
const COOLDOWN_DURATION = 3000; // 3 seconds in milliseconds
let typingTimeout;
const TYPING_TIMEOUT = 2000; // How long to wait before removing typing status
let typingUsers = new Set(); // Ensure typingUsers is initialized as a Set
let lastSoundTime = 0;
const SOUND_COOLDOWN = 10000; // 10 seconds in milliseconds
let isChatMuted = false; // Added to manage chat sound muting
let isSoundsMuted = false; // Added to manage all sounds muting
const muteChatButton = document.getElementById('muteChatButton'); // Mute button reference
muteChatButton.addEventListener('click', () => {
isSoundsMuted = !isSoundsMuted;
if (isSoundsMuted) {
muteChatButton.textContent = '๐ All Sounds Off';
muteChatButton.classList.add('muted');
} else {
muteChatButton.textContent = '๐ All Sounds On';
muteChatButton.classList.remove('muted');
}
});
// Function to check for ASCII art
function containsAsciiArt(text) {
const asciiPatterns = [
/(\|{2,})/, // Multiple vertical bars
/(-{3,})/, // Multiple hyphens
/(_){3,}/, // Multiple underscores
/([\/\\]{3,})/, // Multiple slashes or backslashes
/([.]{4,})/, // Multiple periods
/([*]{3,})/, // Multiple asterisks
/([=]{3,})/, // Multiple equals signs
/([~]{3,})/, // Multiple tildes
/([`]{3,})/, // Multiple backticks
/(โ|โ|โ|โ){3,}/, // Block characters
/([+]{3,})/, // Multiple plus signs
/([<>]{3,})/ // Multiple angle brackets
];
return asciiPatterns.some(pattern => pattern.test(text));
}
// Function to check for glitch text
function containsGlitchText(text) {
const glitchPattern = /[\u0300-\u036f\u0483-\u0489\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]{2,}/;
const unusualUnicodePattern = /[\u200b-\u200f\u2028-\u202f\u2060-\u206f]/;
return glitchPattern.test(text) || unusualUnicodePattern.test(text);
}
// Room switching
document.querySelectorAll('.room-item').forEach(roomElement => {
roomElement.addEventListener('click', () => {
document.querySelector('.room-item.active').classList.remove('active');
roomElement.classList.add('active');
currentRoom = roomElement.dataset.room;
currentRoomTitle.textContent = `${roomEmojis[currentRoom]} ${roomElement.textContent.trim()}`;
messages.innerHTML = '';
room.send({
type: 'chat-message',
room: currentRoom,
username: 'System',
avatarUrl: 'https://api.dicebear.com/6.x/bottts/svg?seed=system',
text: `Welcome to ${roomElement.textContent.trim()}! ๐`,
timestamp: Date.now()
});
const gamesButton = document.querySelector('.games-button');
if (currentRoom === 'games') {
gamesButton.style.display = 'block';
room.send({
type: 'chat-message',
room: currentRoom,
username: 'System',
avatarUrl: 'https://api.dicebear.com/6.x/bottts/svg?seed=system',
text: `Welcome to the Game Zone! Click the button above to browse and play games! ๐ฎ`,
timestamp: Date.now()
});
} else {
gamesButton.style.display = 'none';
}
});
});
room.onPeersChanged = (peers) => {
userList.innerHTML = '';
Object.entries(peers).forEach(([clientId, {avatarUrl, username}]) => {
const li = document.createElement('li');
li.className = 'user-item';
if (bannedUsers.has(username)) {
li.classList.add('banned');
}
const isDeveloper = username === 'unhingedALIWEN';
const isAdmin = adminUsers.has(username);
const developerBadge = isDeveloper ? '<span class="developer-badge">๐จโ๐ป Developer</span>' : '';
const adminBadge = isAdmin && !isDeveloper ? '<span class="admin-badge">๐ Admin</span>' : '';
const userInfo = document.createElement('div');
userInfo.className = 'user-info';
userInfo.innerHTML = `
<img src="${avatarUrl}" alt="${username}" class="user-avatar">
<div class="user-info-text">
<span class="user-name ${isDeveloper ? 'developer-name' : ''}">${username}</span>
${developerBadge}
${adminBadge}
</div>
`;
const banButton = document.createElement('button');
banButton.className = 'ban-button';
banButton.textContent = '๐ซ Ban';
const unbanButton = document.createElement('button');
unbanButton.className = 'unban-button';
unbanButton.textContent = 'โ
Unban';
const makeAdminButton = document.createElement('button');
makeAdminButton.className = 'make-admin-button';
makeAdminButton.textContent = '๐ Make Admin';
const removeAdminButton = document.createElement('button');
removeAdminButton.className = 'remove-admin-button';
removeAdminButton.textContent = 'โ Remove Admin';
if (room.party.client.username === 'unhingedALIWEN' && !isDeveloper) {
if (isAdmin) {
removeAdminButton.style.display = 'block';
makeAdminButton.style.display = 'none';
} else {
makeAdminButton.style.display = 'block';
removeAdminButton.style.display = 'none';
}
}
if (adminUsers.has(room.party.client.username) || room.party.client.username === 'unhingedALIWEN') {
if (bannedUsers.has(username)) {
unbanButton.style.display = 'block';
banButton.style.display = 'none';
} else {
banButton.style.display = 'block';
unbanButton.style.display = 'none';
}
}
banButton.onclick = (e) => {
e.preventDefault();
if (adminUsers.has(room.party.client.username) || room.party.client.username === 'unhingedALIWEN') {
// Send the ban event
room.send({
type: 'ban-user',
targetUsername: username
});
// Send system message about the ban
room.send({
type: 'chat-message',
room: currentRoom,
username: 'System',
avatarUrl: 'https://api.dicebear.com/6.x/bottts/svg?seed=system',
text: `${username} has been banned by ${room.party.client.username}`,
timestamp: Date.now()
});
}
};
unbanButton.onclick = (e) => {
e.preventDefault();
if (adminUsers.has(room.party.client.username) || room.party.client.username === 'unhingedALIWEN') {
// Send the unban event
room.send({
type: 'unban-user',
targetUsername: username
});
// Send system message about the unban
room.send({
type: 'chat-message',
room: currentRoom,
username: 'System',
avatarUrl: 'https://api.dicebear.com/6.x/bottts/svg?seed=system',
text: `${username} has been unbanned by ${room.party.client.username}`,
timestamp: Date.now()
});
}
};
makeAdminButton.onclick = (e) => {
e.preventDefault(); // Prevent any default behavior
if (room.party.client.username === 'unhingedALIWEN') {
// Send the make-admin event
room.send({
type: 'make-admin',
targetUsername: username
});
}
};
removeAdminButton.onclick = (e) => {
e.preventDefault(); // Prevent any default behavior
if (room.party.client.username === 'unhingedALIWEN') {
// Send the remove-admin event
room.send({