forked from rplacelive/game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2476 lines (2321 loc) · 134 KB
/
index.html
File metadata and controls
2476 lines (2321 loc) · 134 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en" ontouchstart="if (maincontent.contains(event.target)) event.preventDefault()" ontouchend="event.preventDefault()">
<head>
<meta charset="UTF-8">
<script>
if(!('subtle' in (window.crypto||{})))location.protocol='https:'
const DEFAULT_SERVER = "wss://server.rplace.tk:443"
const DEFAULT_BOARD = "https:\/\/raw.githubusercontent.com/rplacetk/canvas1/main/place"
const CHAT_COLOURS = ["lightblue", "navy", "green", "purple", "grey", "brown", "orangered", "gold"]
const VERIFIED_APP_HASH = "90e58b1f2c5fb98f74962806b85c2d7d3f7b18be8abe7a04f21e939868625357"
const UNMUTED_SVG = '<path d="M10.543.5a1.12 1.12 0 00-1.182.117L3.789 4.875h-1.8A1.127 1.127 0 00.868 6v8a1.127 1.127 0 001.125 1.125h1.8l5.572 4.258a1.117 1.117 0 00.681.232 1.128 1.128 0 001.127-1.126V1.511A1.119 1.119 0 0010.543.5zm-.624 17.736l-5.708-4.361H2.118v-7.75h2.093l5.708-4.361zM13 3.375v1.25a5.375 5.375 0 010 10.75v1.25a6.625 6.625 0 000-13.25z"></path><path d="M16.125 10A3.129 3.129 0 0013 6.875v1.25a1.875 1.875 0 010 3.75v1.25A3.129 3.129 0 0016.125 10z"></path>'
const MUTED_SVG = '<path d="M19.442 7.442l-.884-.884L16.5 8.616l-2.058-2.058-.884.884L15.616 9.5l-2.058 2.058.884.884 2.058-2.058 2.058 2.058.884-.884L17.384 9.5l2.058-2.058zM10.543.5a1.12 1.12 0 00-1.182.117L3.789 4.875h-1.8A1.127 1.127 0 00.868 6v8a1.127 1.127 0 001.125 1.125h1.8l5.572 4.258a1.117 1.117 0 00.681.232 1.128 1.128 0 001.127-1.126V1.511A1.119 1.119 0 0010.543.5zm-.624 17.736l-5.708-4.361H2.118v-7.75h2.093l5.708-4.361z"></path>'
const VOTED_SVG = 'M8.44857 0.401443C8.3347 0.273284 8.17146 0.199951 8.00002 0.199951C7.82859 0.199951 7.66534 0.273284 7.55148 0.401443L0.351479 8.50544C0.194568 8.68206 0.155902 8.93431 0.252709 9.14981C0.349516 9.36532 0.563774 9.50395 0.800023 9.50395H4.20002V15C4.20002 15.3313 4.46865 15.6 4.80002 15.6H11.2C11.5314 15.6 11.8 15.3313 11.8 15V9.50395H15.2C15.4363 9.50395 15.6505 9.36532 15.7473 9.14981C15.8441 8.93431 15.8055 8.68206 15.6486 8.50544L8.44857 0.401443Z'
const UNVOTED_SVG = 'm8 .200001c.17143 0 .33468.073332.44854.201491l7.19996 8.103998c.157.17662.1956.42887.0988.64437-.0968.21551-.3111.35414-.5473.35414h-3.4v5.496c0 .3314-.2686.6-.6.6h-6.4c-.33137 0-.6-.2686-.6-.6v-5.496h-3.4c-.236249 0-.450507-.13863-.547314-.35414-.096807-.2155-.058141-.46775.09877-.64437l7.200004-8.103998c.11386-.128159.27711-.201491.44854-.201491zm-5.86433 8.103999h2.66433c.33137 0 .6.26863.6.6v5.496h5.2v-5.496c0-.33137.2686-.6.6-.6h2.6643l-5.8643-6.60063'
const BADGES = [ "badges/based.svg", "badges/trouble_maker.svg", "badges/veteran.svg", "badges/admin.svg", "badges/moderator.svg", "badges/noob.svg", "badges/script_kiddie.svg", "badges/ethical_botter.svg", "badges/gay.svg", "badges/discord_member.svg", "badges/100_pixels_placed", "badges/1000_pixels_placed", "badges/5000_pixels_placed", "badges/2000_pixels_placed", "badges/100000_pixels_placed", "badges/1000000_pixels_placed" ]
const DEFAULT_PALETTE_KEYS = "123456789abcdefghijklmnopqrstuvwxyz"
const TRANSLATIONS = {
en: {
connecting: "Connecting...",
connectingFail: "Could not connect!",
downloadingImage: "Downloading image...",
placeTile: "Place a tile",
donate: "Donate",
chat: "Chat",
liveChat: "Live Chat:",
nicknameToContinue: "Enter a nickname to continue:",
changeChannel: "Change channel:",
captchaPrompt: "Solve this small captcha to help keep rplace.live fun for all...",
webappInstall: "Install rplace.live web app",
connectionProblems: "Connection problems?",
tryClickingHere: "try clicking here",
pleaseBeRespectful: "Please be respectful and try not to spam!",
enterNickname: "Enter nickname...",
enterMessage: "Enter message...",
signInInstead: "Sign in instead",
createNewAccount: "Create a new account",
mention: "Mention",
block: "Block",
changeMyName: "Change my name",
putOnCanvas: "🫧 Put on canvas",
sendInLiveChat: "📨 Send in live chat",
overlayMenu: "Overlay menu",
modalAboutContent: "There is an empty canvas.<br><br>You may place a tile upon it, but you must wait to place another.<br><br>Individually you can create something.<br><br>Together you can create something more.",
overlayMenuDesciption: "Visualise your build with a template image!"
},
fa: {
connecting: "در حال وصل شدن",
connectingFail: "متصل نشد",
downloadingImage: "در حال بارگزاری عکس ها",
placeTile: "نقاشی کردن",
donate: "حمایت",
chat: "چت",
liveChat: "چت زنده",
nicknameToContinue: "لطفا نام خود را برای چت کردن وارد کنید",
changeChannel: "تغییر کانال:",
captchaPrompt: "لطفا روی دکمه حاوی ایموجی که در زیر می بینید کلیک کنید",
webappInstall: "برنامه وب rplace.live را نصب کنید",
connectionProblems: "مشکلات اتصال؟",
tryClickingHere: "برای حل اینجا کلیک کنید",
pleaseBeRespectful: "لطفا محترمانه رفتار کنید و سعی کنید اسپم نکنید!",
enterNickname: "نام مستعار را وارد کنید...",
enterMessage: "پیام را وارد کنید..."
},
tr: {
connecting: "Bağlanıyor...",
connectingFail: "Bağlanamadı!",
downloadingImage: "Resim indiriliyor...",
placeTile: "Bir piksel yerleştir",
donate: "Bağış yap",
chat: "Sohbet",
// liveChat: "Canlı sohbet:", // TOO LONG
nicknameToContinue: "Devam etmek için bir takma ad girin:",
changeChannel: "Kanalı değiştir:",
captchaPrompt: "Lütfen aşağıda gördüğünüz emojiyi içeren butona tıklayın",
webappInstall: "rplace.live web uygulamasını kurun",
connectionProblems: "Bağlantı problemleri?",
tryClickingHere: "buraya tıklamayı dene",
pleaseBeRespectful: "Lütfen saygılı olun ve spam yapmamaya çalışın!",
enterNickname: "Takma ad girin...",
enterMessage: "Mesaj girin...",
signInInstead: "Oturum aç",
createNewAccount: "Hesap oluştur",
mention: "Etiketle",
block: "Engellemek",
changeMyName: "İsimi değiştir",
putOnCanvas: "🫧 Haritanın üstüne yaz",
sendInLiveChat: "📨 Sohbete yaz",
overlayMenu: "Bindirme menüsü",
modalAboutContent: "Boş bir tuval var.<br><br>Üzerine renkli bir piksel koyabilirsiniz ama yenisini yerleştirmek için beklemeniz gerekir.<br><br>Tek başınıza bir şeyler yapabilirsiniz.<br><br>Topluluk ile daha fazlasını yapabilirsiniz.",
overlayMenuDesciption: "Haritanın üzerine bir fotoğraf koyun ve onu çizin!"
},
ro: {
connecting: "Se conectează...",
connectingFail: "Nu s-a putut conecta!",
downloadingImage: "Se descarcă imaginea...",
placeTile: "Pune un pixel",
donate: "Donează",
chat: "Conversații",
//liveChat: "Conversații în direct:", // TOO LONG
nicknameToContinue: "Introdu un nume pentru a continua:",
changeChannel: "Schimbați canalul:",
captchaPrompt: "Dați clic pe butonul care conține emoji-ul pe care îl vedeți mai jos",
webappInstall: "Instalați aplicația web rplace.live",
connectionProblems: "Probleme de conectare?",
tryClickingHere: "incearca sa dai click aici",
pleaseBeRespectful: "Vă rugăm să fiți respectuos și să nu trimiteți spam!",
enterNickname: "Introduceți porecla...",
enterMessage: "Introdu mesajul..."
},
el: {
connecting: "Συνδετικός...",
connectingFail: "Δεν μπορούσε να συνδεθεί!",
downloadingImage: "Λήψη εικόνας...",
placeTile: "τοποθετώ ένα πίξελ",
donate: "δανεισω",
chat: "συζήτηση",
//liveChat: "ζωντανή συζήτηση", // TOO LONG
nicknameToContinue: "Εισαγάγετε ένα ψευδώνυμο για να συνεχίσετε:",
changeChannel: "Αλλαγή καναλιού:",
captchaPrompt: "Κάντε κλικ στο κουμπί που περιέχει το emoji που βλέπετε παρακάτω",
webappInstall: "Εγκαταστήστε την εφαρμογή web rplace.live",
connectionProblems: "Προβλήματα σύνδεσης;",
tryClickingHere: "δοκιμάστε να κάνετε κλικ εδώ",
pleaseBeRespectful: "Παρακαλώ να είστε σεβαστές!",
enterNickname: "Εισαγάγετε ψευδώνυμο...",
enterMessage: "Εισαγάγετε μήνυμα..."
},
es: {
connecting: "Conectando...",
connectingFail: "¡No podía conectar!",
downloadingImage: "Descargando imagen...",
placeTile: "Coloca un pixel",
donate: "Donar",
chat: "Chat",
//liveChat: "Chat en vivo:", // TOO LONG
nicknameToContinue: "Introduce un apodo para continuar:",
changeChannel: "Cambia el canal:",
captchaPrompt: "Haga clic en el botón que contiene el emoji que ve a continuación",
webappInstall: "Instale la aplicación web rplace.live",
connectionProblems: "¿Problemas de conexión?",
tryClickingHere: "intente hacer clic aquí",
pleaseBeRespectful: "Por favor se respetuoso!",
enterNickname: "Introduce el apodo...",
enterMessage: "Introduce el mensaje..."
},
fr: {
connecting: "De liaison...",
connectingFail: "Impossible de se connecter!",
downloadingImage: "Télécharger l'image...",
placeTile: "Place un pixel",
donate: "Faire un don",
chat: "Discuter",
//liveChat: "Chat en direct:", // TOO LONG
nicknameToContinue: "Entrez un surnom pour continuer :",
changeChannel: "Changer de chaîne:",
captchaPrompt: "Veuillez cliquer sur le bouton contenant l'emoji que vous voyez ci-dessous",
webappInstall: "Installez l'application Web rplace.live",
connectionProblems: "Problèmes de connexion?",
tryClickingHere: "résoudre en cliquant ici",
pleaseBeRespectful: "Soyez respectueux et essayez de ne pas spammer !",
enterNickname: "Entrez le pseudo...",
enterMessage: "Saisissez le message..."
},
ru: {
connecting: "Подключение...",
connectingFail: "Не могу подключиться!",
downloadingImage: "Загрузка изображения...",
placeTile: "Поместите пиксель",
donate: "Пожертвовать",
chat: "Чат",
liveChat: "Живой чат:",
nicknameToContinue: "Введите псевдоним:",
changeChannel: "Изменить канал:",
captchaPrompt: "Пожалуйста, решите эту небольшую капчу, чтобы сделать rplace.live приятным для всех...",
webappInstall: "Установите веб-приложение rplace.live",
connectionProblems: "Проблемы с подключением?",
tryClickingHere: "попробуйте нажать здесь",
pleaseBeRespectful: "Пожалуйста, будьте уважительны и старайтесь не спамить!",
enterNickname: "Введите псевдоним...",
enterMessage: "Введите сообщение..."
},
de: {
connecting: "Zugreifen...",
connectingFail: "Konnte keine Verbindung herstellen!",
downloadingImage: "Bild wird heruntergeladen...",
placeTile: "Platziere ein Pixel",
donate: "Spenden",
chat: "Chat",
liveChat: "Live-Chat:",
nicknameToContinue: "Geben Sie einen Spitznamen ein, um fortzufahren:",
changeChannel: "Kanal wechseln:",
captchaPrompt: "Bitte lösen Sie dieses kleine Captcha, damit rplace.live allen Spaß macht...",
webappInstall: "Installieren Sie die Web-App rplace.live",
connectionProblems: "Verbindungsprobleme?",
tryClickingHere: "klicken Sie hier, um zu lösen",
pleaseBeRespectful: "Bitte seien Sie respektvoll, nicht zu spammen!",
enterNickname: "Spitznamen eingeben...",
enterMessage: "Nachricht eingeben..."
},
hi: {
connecting: "कनेक्टिंग ...",
connectingFail: "कनेक्ट नहीं हो सका!",
downloadingImage: "इमेज डाउनलोड हो रही है...",
placeTile: "एक टाइल रखें",
donate: "दान करें",
chat: "चैट",
liveChat: "लाइव चैट:",
nicknameToContinue: "जारी रखने के लिए एक उपनाम दर्ज करें:",
changeChannel: "चैनल बदलें:",
captchaPrompt: "rplace.live को सभी के लिए मज़ेदार बनाए रखने में मदद के लिए कृपया इस छोटे कैप्चा को हल करें...",
webappInstall: "rplace.live वेब ऐप इंस्टॉल करें",
connectionProblems: "कनेक्शन समस्याएं?",
tryClickingHere: "यहाँ क्लिक करने का प्रयास करें",
pleaseBeRespectful: "कृपया सम्मान करें और स्पैम न करने का प्रयास करें!",
enterNickname: "उपनाम दर्ज करें ...",
enterMessage: "संदेश दर्ज करें ..."
},
ar: {
connecting: "جار الاتصال...",
connectingFail: "لقد فشل الاتصال!",
downloadingImage: "جار تحميل الصورة...",
placeTile: "ضع بلاطة",
donate: "تبرع",
chat: "الدردشة",
liveChat: "الدردشة المباشرة:",
nicknameToContinue: "اكتب اسم مستعار للمواصلة:",
changeChannel: "تغيير القناة:",
captchaPrompt: "رجاءا قم بحل هذا اللغز...",
webappInstall: "تحميل الموقع كتطبيق",
connectionProblems: "مشاكل في الاتصال?",
tryClickingHere: "جرب ان تضغط هنا",
pleaseBeRespectful: "رجاءا كن محترما ولا تزعج الاخرين!",
enterNickname: "اكتب اسم مستعار...",
enterMessage: "اكتب الرسالة..."
},
jp: {
connecting: "接続中...",
connectingFail: "接続できませんでした!",
downloadingImage: "画像をダウンロードしています...",
placeTile: "タイルを配置する",
donate: "寄付する",
chat: "チャット",
liveChat: "ライブチャット:",
nicknameToContinue: "続行するにはニックネームを入力してください:",
changeChannel: "チャンネルを変更:",
captchaPrompt: "rplace.live をすべての人が楽しめるように、この小さなキャプチャを解決してください...",
webappInstall: "rplace.live Web アプリをインストール",
connectionProblems: "接続の問題?",
tryClickingHere: "ここをクリックしてみてください",
pleaseBeRespectful: "敬意を払い、スパム行為をしないようにしてください!",
enterNickname: "ニックネームを入力してください...",
enterMessage: "メッセージを入力してください..."
}
}
const AUDIOS = {
invalid: new Audio("./sounds/invalid.mp3"),
highlight: new Audio("./sounds/highlight.mp3"),
selectColour: new Audio("./sounds/select-colour.mp3"),
closePalette: new Audio("./sounds/close-palette.mp3"),
cooldownStart: new Audio("./sounds/cooldown-start.mp3"),
cooldownEnd: new Audio("./sounds/cooldown-end.mp3")
}
const EMOJIS = {
joy: "😂",
cool: "😎",
sunglasses: "😎",
heart: "❤️",
moyai: "🗿",
bruh: "🗿",
turkey: "🇹🇷",
skull: "💀",
amongus: "ඞ",
sus: "ඞ",
iran: "🇮🇷",
uk: "🇬🇧",
usa: "🇺🇸",
america: "🇺🇸",
eyes: "👀",
fire: "🔥",
thumbsup: "👍",
thumbsdown: "👎",
clown: "🤡",
facepalm: "🤦♂️",
ok: "👌",
poop: "💩",
rocket: "🚀",
tada: "🎉",
celebration: "🎉",
moneybag: "💰",
crown: "👑",
muscle: "💪",
beer: "🍺",
pizza: "🍕",
cookie: "🍪",
balloon: "🎈",
gift: "🎁",
star: "⭐️",
love: "😍",
crying: "😢",
angry: "😠",
sleepy: "😴",
nerd: "🤓",
laughing: "😆",
vomiting: "🤮",
unicorn: "🦄",
alien: "👽",
ghost: "👻",
skullcrossbones: "☠️",
explosion: "💥",
}
const EMOJIS_CUSTOM = {
amogus: '<img src="custom_emojis/amogus.png" height="24">',
biaoqing: '<img src="custom_emojis/biaoqing.png" height="24">',
deepfriedh: '<img src="custom_emojis/deepfriedh.png" height="24">',
edp445: '<img src="custom_emojis/edp445.png" height="24">',
fan: '<img src="custom_emojis/fan.png" height="24">',
heavy: '<img src="custom_emojis/heavy.png" height="24">',
herkul: '<img src="custom_emojis/herkul.png" height="24">',
kaanozdil: '<img src="custom_emojis/kaanozdil.png" height="24">',
lowtiergod: '<img src="custom_emojis/lowtiergod.png" height="24">',
manly: '<img src="custom_emojis/manly.png" height="24">',
plsaddred: '<img src="custom_emojis/plsaddred.png" height="24">',
rplace: '<img src="custom_emojis/rplace.png" height="24">',
rplacediscord: '<img src="custom_emojis/rplacediscord.png" height="24">',
sonic: '<img src="custom_emojis/sonic.png" height="24">',
transparent: '<img src="custom_emojis/transparent.png" height="24">',
trollface: '<img src="custom_emojis/trollface.png" height="24">',
// Special 'commands'
help: "<kbd>Chat commands: :vip, :name</kbd>",
name: "<kbd>Change your username</kbd>",
vip: "<kbd>Apply a VIP cooldown code</kbd>"
}
// Flag emojis all sourced from openmoji.org, https://www.langoly.com/most-spoken-languages/
const LANG_INFOS = new Map([
["en", { name: "English", flag: "https://openmoji.org/data/color/svg/1F1EC-1F1E7.svg" }],
["zh", { name: "中文", flag: "https://openmoji.org/data/color/svg/1F1E8-1F1F3.svg" }],
["hi", { name: "हिन्दी", flag: "https://openmoji.org/data/color/svg/1F1EE-1F1F3.svg" }],
["sp", { name: "Español", flag: "https://openmoji.org/data/color/svg/1F1EA-1F1F8.svg" }],
["fr", { name: "Français", flag: "https://openmoji.org/data/color/svg/1F1EB-1F1F7.svg" }],
["ar", { name: "عربي", flag: "https://openmoji.org/data/color/svg/1F1F8-1F1E6.svg", rtl: true }],
["bn", { name: "বাংলা", flag: "https://openmoji.org/data/color/svg/1F1EE-1F1F3.svg" }],
["ru", { name: "pусский", flag: "https://openmoji.org/data/color/svg/1F1F7-1F1FA.svg" }],
["pt", { name: "Português", flag: "https://openmoji.org/data/color/svg/1F1E7-1F1F7.svg" }],
["ur", { name: "اردو", flag: "https://openmoji.org/data/color/svg/1F1F5-1F1F0.svg", rtl: true }],
["de", { name: "Deutsch", flag: "https://openmoji.org/data/color/svg/1F1E9-1F1EA.svg" }],
["jp", { name: "日本語", flag: "https://openmoji.org/data/color/svg/1F1EF-1F1F5.svg" }],
["tr", { name: "Türkçe", flag: "https://openmoji.org/data/color/svg/1F1F9-1F1F7.svg" }],
["vi", { name: "Tiếng Việt", flag: "https://openmoji.org/data/color/svg/1F1FB-1F1F3.svg" }],
["ko", { name: "한국인", flag: "https://openmoji.org/data/color/svg/1F1F0-1F1F7.svg" }],
["it", { name: "Italiana", flag: "https://openmoji.org/data/color/svg/1F1EE-1F1F9.svg" }],
["fa", { name: "فارسی", flag: "https://openmoji.org/data/color/svg/1F1EE-1F1F7.svg", rtl: true }],
["sr", { name: "Српски", flag: "https://openmoji.org/data/color/svg/1F1E6-1F1F1.svg"}],
["az", { name: "Azərbaycan", flag: "https://openmoji.org/data/color/svg/1F1E6-1F1FF.svg", rtl: true }],
])
const THEMES = [
{ css: "rplace-2022.css", pixelselect: "svg/pixel-select-2022.svg" },
{ css: "rplace-2023.css", pixelselect: "svg/pixel-select-2023.svg" },
]
</script>
<script>
// csrfstate not used at the moment, may be later to encode some extra info for client
let params = new URLSearchParams(location.search)
let csrfState = params.get("state"),
redditOauthCode = params.get("code")
boardParam = params.get("board"),
serverParam = params.get("server")
if (boardParam && serverParam) {
if (localStorage.server != serverParam || localStorage.board != boardParam) {
localStorage.server = serverParam
localStorage.board = boardParam
history.pushState(null, '', location.origin)
window.location.reload()
}
}
// Register PWA Service worker
if ('serviceWorker' in navigator)
navigator.serviceWorker.register("./sw.js")
let account = null
const wscapsule = ((send, addEventListener, call) => {
let focused = true
call(addEventListener, window, 'blur', () => focused = false)
call(addEventListener, window, 'focus', () => focused = true)
let authSocket = new WebSocket("wss://server.poemanthology.org/auth")
let ws = new WebSocket((localStorage.server || DEFAULT_SERVER) + (localStorage.vip ? "/" + localStorage.vip : ""))
delete WebSocket
authSocket.binaryType = "arraybuffer"
authSocket.onopen = function() {
// Then we know we have been redirected from a reddit oauth, and will now authenticate with auth server
if (redditOauthCode) {
let cb = encoder.encode("X" + redditOauthCode)
cb[0] = 9 // ClientPackets.RedditCreateAccount
call(send, authSocket, cb)
}
else if (localStorage.refreshToken) {
let ab = encoder.encode("X" + localStorage.refreshToken)
ab[0] = 10 // ClientPackets.RedditAuthenticate
call(send, authSocket, ab)
}
else if (localStorage.accountToken) {
let ab = encoder.encode("X" + localStorage.accountToken)
ab[0] = 5 // ClientPackets.Authenticate
call(send, authSocket, ab)
}
}
authSocket.onmessage = async function({data}) {
data = new DataView(data)
switch (data.getUint8(0)) {
case 0: { // ServerPackets.Fail
console.error(decoder.decode(data.buffer.slice(1)))
break
}
case 1: {
loginPanel.style.display = 'flex'
unauthedPage.style.display = 'none'
profilePage.style.display = 'flex'
account = JSON.parse(decoder.decode(data.buffer.slice(1)))
profileName2.textContent = profileName.textContent = account.Username
// We use discord ID so that we can directly link their discord profile. Thanks https://discord.name/ for the api :).
if (account.DiscordSnowflake) {
let discordUser = await (await fetch("https://discord-lookup-api.herokuapp.com/user/" + account.DiscordSnowflake)).json()
if (discordUser && discordUser.success) {
profileDiscordIcon.src = discordUser.data.avatar || "images/discord.png"
profileDiscord.textContent = discordUser.data.username
profileDiscord.href = "https://discord.com/users/" + account.DiscordSnowflake
}
}
if (account.TwitterHandle) {
profileTwitter.textContent = account.TwitterHandle
profileTwitter.href = "https://twitter.com/" + account.TwitterHandle
}
// We can also scrape their snoo/user icon using reddit. Thanks reddit!
if (account.RedditHandle) {
profileReddit.textContent = account.RedditHandle
profileReddit.href = "https://www.reddit.com/user/" + account.RedditHandle.replaceAll("/u/", "")
let redditUser = await (await fetch("https://www.reddit.com/user/"+ account.RedditHandle +"/about.json")).json()
if (redditUser && !redditUser.error) {
profileRedditIcon.src = redditUser.data.snoovatar_img || redditUser.data.icon_img || "images/reddit.png"
}
}
profilePixels.textContent = account.PixelsPlaced
profileJoin.textContent = new Date(account.JoinDate).toLocaleString()
for (let i of account.Badges) {
let badgeImg = document.createElement("img")
badgeImg.src = BADGES[i]
badgeImg.style.width = '16px'
badgeImg.title = BADGES[i][7].toUpperCase() + BADGES[i].replace("_", "").slice(8, BADGES[i].length - 4)
profileBadges.appendChild(badgeImg)
}
accountTier.textContent = account.AccountTier
accountName.textContent = account.Username
let censoredSection = account.Email.slice(4, account.Email.indexOf("@"))
accountEmail.textContent = account.Email.replace(censoredSection, "*".repeat(censoredSection.length))
break
}
case 5: { // ServerPackets.AccountToken
localStorage.accountToken = decoder.decode(data.buffer.slice(1))
console.log("Account authentication success")
call(send, authSocket, new Uint8Array([4])) // ClientPackets.AccountInfo
break
}
case 7: { // ServerPackets.RedditRefreshToken
localStorage.refreshToken = decoder.decode(data.buffer.slice(1))
console.log("Reddit OAuth success")
call(send, authSocket, new Uint8Array([4])) // ClientPackets.AccountInfo
// Clean up our params to avoid reauthenticating on reload
let params = new URLSearchParams(location.search)
params.delete("code")
history.pushState(null, "", location.origin + "/" + params.toString())
break
}
}
}
authSocket.onclose = console.error
ws.onopen = function(e) {
initialConnect = true
}
ws.onmessage = async function({data}) {
delete sessionStorage.err
data = new DataView(await data.arrayBuffer())
switch (data.getUint8(0)) {
case 0: {
PALETTE = [...new Uint32Array(data.buffer.slice(1))]
generateIndicators()
generatePalette()
break
}
case 1: {
CD = data.getUint32(1) * 1000 // Current cooldown
COOLDOWN = data.getUint32(5)
if (COOLDOWN == 0xFFFFFFFF) canvasLock.style.display = 'flex' // TODO: Official server packet for this
// New server packs canvas width and height in code 1, making it 17
if (data.byteLength == 17) {
let width = data.getUint32(9)
let height = data.getUint32(13)
setSize(width, height)
runLengthDecodeBoard(await preloadedBoard, width * height)
}
break
}
case 2: {
// Old server "changes" packet - preloadedBoard = http board, data = changes
runLengthChanges(data, await preloadedBoard)
break
}
case 3: {
online = data.getUint16(1)
onlineCounter.textContent = online
onlineCounter2.textContent = online + ' online'
break
}
case 6: {
let i = 0
while (i < data.byteLength - 2) {
seti(data.getUint32(i += 1), data.getUint8(i += 4))
}
break
}
case 7: {
CD = data.getUint32(1) * 1000
seti(data.getUint32(5), data.getUint8(9))
break
}
case 15: {
let txt = decoder.decode(new Uint8Array(data.buffer).slice(1)).replace(/&/g,"&").replace(/</g,"<").replace(/"/g,""")
let name, messageChannel, type, placeX, placeY, uid // TODO: Implement uid
;[txt, name, messageChannel, type, placeX, placeY, uid] = txt.split("\n")
if (!(messageChannel in cMessages)) return
// Canvas chat, placed on canvas as a bubble
if (type == "place") {
if (!placeChat) return
txt = txt.substring(0, 56)
const placeMessage = document.createElement("placechat")
placeMessage.innerHTML = `<span title="${(new Date()).toLocaleString()}" style="color: ${CHAT_COLOURS[name ? hash(name) & 7 : (Math.round(Math.random() * 8))]};">[${name || "anon"}]</span><span>${txt}</span>`
placeMessage.style.left = placeX + "px"
placeMessage.style.top = placeY + "px"
canvparent2.appendChild(placeMessage)
//Remove message after given time.
setTimeout(() => {
canvparent2.removeChild(placeMessage)
}, localStorage.placeChatTime || 7e3)
}
//Normal chat - goes to live chat panel
else if (!type || type == "live") {
// Custom emoji regex
txt = txt.replace(/:(.+):/, (full, source) => {
// If this emoji is the only thing in the message we can make it big!
if (txt.match(source).length == 1 && !txt.replace(full, "").trim()) {
return `<img src="custom_emojis/${source}.png" alt=":${source}:" title=":${source}:" width="48" height="48">`
}
// Else smaller and inline with the rest of the message
return `<img src="custom_emojis/${source}.png" alt=":${source}:" title=":${source}:" width="16" height="16">`
})
// Coordinate to clickable link regex
txt = txt.replace(/([0-9]+),\s*([0-9]+)/g, (element) => {
let px = parseInt(element.split(",")[0].trim())
let py = parseInt(element.split(",")[1].trim())
if (px != NaN && py != NaN) {
return `<a href="#" onclick="event.preventDefault();x=${px};y=${py};pos();">${px},${py}</a>`
}
})
let newMessage = document.createElement("div")
newMessage.innerHTML = `<span title="${(new Date()).toLocaleString()}" style="color: ${CHAT_COLOURS[name ? hash(name) & 7 : (Math.round(Math.random() * 8))]}; cursor: pointer;" onclick="chatMentionUser(this.textContent.slice(1, -1));">[${name}]</span> ${txt}`
newMessage.oncontextmenu = (ev) => onChatContext(ev, name)
let scroll = chatMessages.scrollTop + chatMessages.offsetHeight + 10 >= chatMessages.scrollHeight
if (name !== localStorage.name && blockedUsers.includes(name)) {
newMessage.style.color = "transparent"
newMessage.style.textShadow = "0px 0px 6px black"
}
if (txt.includes("@" + localStorage.name) || txt.includes("@everyone")) {
newMessage.style.backgroundColor = "rgba(255, 255, 0, 0.5)"
if (currentChannel == messageChannel) AUDIOS.closePalette.run()
}
messageChannel = messageChannel || 'en'
cMessages[messageChannel].push(newMessage)
if (cMessages[messageChannel].length > 100) cMessages[messageChannel].unshift()
if (currentChannel == messageChannel) {
chatMessages.insertAdjacentElement("beforeEnd", newMessage)
}
if (chatMessages.children.length > 100){
chatMessages.children[0].remove()
}
scroll && chatMessages.scrollTo(0,10e8)
}
break
}
case 16: {
let type = data.getUint8(1)
switch (type) {
// Text capcha
case 1:
break
// Math captcha
case 2:
break
// Emoji captcha
case 3:
let emojisSize = data.getUint8(2)
let emojis = decoder.decode(new Uint8Array(data.buffer).slice(3, emojisSize + 3)).split("\n")
let imageData = new Uint8Array(data.buffer).slice(3 + emojisSize)
captchaOptions.innerHTML = ""
for (let emoji of emojis) {
let el = document.createElement("input")
el.setAttribute("type", "button")
el.setAttribute("value", emoji)
captchaOptions.appendChild(el)
el.addEventListener("click", (event) => {
call(send, ws, encoder.encode("\x10" + event.target.value))
captchaOptions.style.pointerEvents = "none"
})
}
captchaImg.src = URL.createObjectURL(new Blob([imageData], { type: "image/webp" }))
captchaPopup.style.display = "flex"
captchaOptions.style.pointerEvents = "all"
break
case 255: // Server sends back sucess
captchaPopup.style.display = "none"
break
}
break
}
}
}
ws.onclose = function(e) {
//Something went wrong...
CD = null
console.error(e)
if (e.code == 1006 && !sessionStorage.err) {
sessionStorage.err = "1"
window.location.reload(true)
}
loadingScreen.children[0].src = "images/rplace-offline.png"
showLoadingScreen()
}
function put() {
// If CD is null but we have already made that initial connection, we have likely ghost disconnected from the WS
if (!focused || !initialConnect || (CD === null && initialConnect) || CD > Date.now()) {
return
}
pok.classList.remove("enabled")
set(Math.floor(x), Math.floor(y), PEN)
canvselect.style.background = ""
canvselect.children[0].style.display = "block"
canvselect.style.outline = ""
canvselect.style.boxShadow = ""
palette.style.transform = "translateY(100%)"
AUDIOS.cooldownStart.run()
CD = Date.now() + (localStorage.vip ? (localStorage.vip[0] == '!' ? 0 : COOLDOWN / 2) : COOLDOWN)
let pixelView = new DataView(new Uint8Array(6).buffer)
pixelView.setUint8(0, 4)
pixelView.setUint32(1, Math.floor(x) + Math.floor(y) * WIDTH)
pixelView.setUint8(5, PEN)
if (!mobile) {
colours.children[PEN].classList.remove("sel")
PEN = -1
}
localStorage.placed = (localStorage.placed >>> 0) + 1
call(send, ws, pixelView)
}
let pok = document.getElementById('pok')
let oclick = e => {
if (!e.isTrusted) return
if (pok.classList.contains('enabled')) put()
hideIndicators()
}
call(addEventListener, pok, 'click', oclick)
function sendMsg(message){
if (message.startsWith(":name")) {
namePanel.style.visibility = 'visible'
nameInput.value = message.slice(5).trim()
return
}
else if (message.startsWith(":vip")) {
let key = message.slice(4).trim()
if (key[0] == "!") return
localStorage.vip = key
window.location.reload(true)
return
}
else if (message.startsWith(":help")) {
return
}
call(send, ws, encoder.encode(
"\x0f" + message +
(localStorage.name ? "\n" + localStorage.name : "") +
"\n" + currentChannel +
"\n" + "live" +
"\n" + 0 +
"\n" + 0
))
}
function sendPlaceMsg(message) {
call(send, ws, encoder.encode(
"\x0f" + message +
(localStorage.name ? "\n" + localStorage.name : "") +
"\n" + currentChannel +
"\n" + "place" +
"\n" + Math.floor(x) +
"\n" + Math.floor(y)
))
}
messageTypePanel.children[0].onclick = e => {
sendPlaceMsg(messageInput.value)
messageInput.value = ""
}
messageTypePanel.children[1].onclick = e => {
sendMsg(messageInput.value)
messageInput.value = ""
}
messageInput.onkeypress = e => {
if (e.keyCode == 13) {
//shift + enter send as place chat, enter send as normal live chat
if (e.shiftKey) sendPlaceMsg(messageInput.value)
else sendMsg(messageInput.value)
messageInput.value = ""
}
}
call(addEventListener, document.body, 'keypress', function(e) {
if (!e.isTrusted)return
//"Shift+O" to open overlay menu
if (e.code == 'KeyO' && e.shiftKey && !('value' in document.activeElement)) {
overlayMenu.toggleAttribute("opened")
}
//Begin palette commands
if (onCooldown) return
//"Enter" key to place selected block without using mouse
if (e.keyCode == 13 && !('value' in document.activeElement)) call(oclick, pok, e)
//Keyboard shortcuts for selecting palette colours
let keyIndex = null
if (document.activeElement != document.body)return
keyIndex = (localStorage.paletteKeys || DEFAULT_PALETTE_KEYS).indexOf(e.key)
if (keyIndex == -1) return
if (palette.style.transform == 'translateY(100%)')
showPalette()
for (let c = 0; c < document.getElementById("colours").children.length; c++) {
document.getElementById("colours").children[c].firstChild.style.visibility = "visible"
}
let i = [...(document.getElementById("colours").children)].indexOf(document.getElementById("colours").children[keyIndex])
if (i<0) return
let el = document.getElementById("colours").children[PEN]
if (el) {
el.classList.remove('sel')
}
PEN = keyIndex;
AUDIOS.selectColour.run()
canvselect.style.background = document.getElementById("colours").children[keyIndex].style.background
document.getElementById("colours").children[keyIndex].classList.add('sel')
pok.classList.add('enabled')
canvselect.children[0].style.display = "none"
canvselect.style.outline= "8px white solid"
canvselect.style.boxShadow= "0px 2px 4px 0px rgb(0 0 0 / 50%)"
})
call(addEventListener, document.body, 'touchend', function(e) {
if (!e.isTrusted) return
for (let t of e.changedTouches) {
assign2: if (touch2 && touch2.identifier == t.identifier) touch2 = null
else if (touch1 && touch1.identifier == t.identifier) {
[touch1, touch2] = [touch2, null]
if (touchmoved > 0 && canvparent2.contains(e.target)){
if (e.target != maincontent && !canvparent2.contains(e.target))
break assign2
clicked(t.clientX, t.clientY)
}
}
if ('value' in e.target) e.target.focus()
let target = e.target
while (!target.dispatchEvent) {
target = target.parentElement
}
if (target == pok) {
call(oclick, pok, e)
}
else {
if (touchmoved > 0)
target.dispatchEvent(new MouseEvent('click', { bubbles:true } ))
}
}
})
call(addEventListener, signupButton, 'click', function(e) {
signupUsername.style.border = 'initial'
signupEmail.style.border = 'initial'
signupConfirm.style.border = 'initial'
if (signupUsername.value.length < 4) {
signupUsername.style.border = '1px solid red'
loginSignupMessage.textContent = 'Username is too short!'
return
}
if (!signupEmail.validity.valid) {
signupEmail.style.border = '1px solid red'
loginSignupMessage.textContent = 'Email is not valid!'
return
}
if (signupConfirm.value !== signupEmail.value) {
signupConfirm.style.border = '1px solid red'
loginSignupMessage.textContent = 'Emails do not match!'
return
}
loginSignupMessage.textContent = ''
authCodePage.style.display = 'flex'
signupPage.style.display = 'none'
let buffer = encoder.encode('X' + signupUsername.value.padEnd(32) + signupEmail.value.padEnd(320))
buffer[0] = 2 // ClientPackets.CreateAccount
call(send, authSocket, buffer)
})
call(addEventListener, signinButton, 'click', function() {
let buffer = encoder.encode('X' + loginUsername.value.padEnd(32) + loginEmail.value.padEnd(320))
buffer[0] = 5 //ClientPackets.Authenticate
call(send, authSocket, buffer)
authCodePage.style.display = 'flex'
signinPage.style.display = 'none'
})
call(addEventListener, authCodeButton, 'click', function() {
let buffer = encoder.encode('X' + authCode.value)
buffer[0] = 3 // ClientPackets.AccountCode
call(send, authSocket, buffer)
authCodePage.style.display = 'none'
signinPage.style.display = 'flex'
})
call(addEventListener, profileDiscordSubmit, 'click', function() {
let view = new DataView(new Uint8Array(10).buffer)
view.setUint8(0, 11) // ClientPackets.UpdateProfile
view.setUint8(1, 1) // PublicEditableData.DiscordSnowflake
view.setBigInt64(2, BigInt(parseInt(profileDiscordInput.value)))
call(send, authSocket, view.buffer)
call(send, authSocket, new Uint8Array([4]))
})
call(addEventListener, profileTwitterSubmit, 'click', function() {
let buffer = encoder.encode('XX' + profileTwitterInput.value)
buffer[0] = 11 // ClientPackets.UpdateProfile
buffer[1] = 2 // PublicEditableData.TwitterHandle
call(send, authSocket, buffer)
call(send, authSocket, new Uint8Array([4]))
})
call(addEventListener, profileRedditSubmit, 'click', function() {
let buffer = encoder.encode('XX' + profileRedditInput.value)
buffer[0] = 11 // ClientPackets.UpdateProfile
buffer[1] = 3 // PublicEditableData.RedditHandle
call(send, authSocket, buffer)
call(send, authSocket, new Uint8Array([4]))
})
}).bind(undefined, WebSocket.prototype.send, addEventListener, btoa.call.bind(btoa.call));
WebSocket.prototype.send = function(){this.close()}; document.execCommand = (_) => {window.location.reload(true)}; const I=HTMLIFrameElement.prototype;
delete I.contentWindow;delete I.contentDocument;delete I.getSVGDocument; delete eval; delete Function.prototype.constructor; delete Function; delete Worker;
</script>
<script type="application/javascript" src="virtual-select.min.js"></script>
<link rel="stylesheet" type="text/css" href="virtual-select.min.css">
<link rel="manifest" href="manifest.json">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="apple-touch-icon" href="favicon.png">
<meta name="apple-mobile-web-app-title" content="place">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="style.css?v=3.17" rel="stylesheet"> <!-- Increment the CSS query, such as ?v=1.x every time CSS is changed in order to force clients to refresh their stylesheets. Otherwise broken CSS may occur-->
<title>place</title>
<link rel="icon" type="image/x-icon" href="favicon.png">
<meta property="og:title" content="r/place 2"/>
<meta property="og:description" content="There is an empty canvas. You may place a tile upon it, but you must wait to place another. Individually you can create something. Together you can create something more." />
<meta property="og:image" content="https://preview.redd.it/rreqw9qpy8r81.png?auto=webp&s=f58d371c5505d66439c82de9040dfd99a3685015" />
<meta name="theme-color" content="#ff4500">
</head>
<body>
<div id="loadingScreen">
<img src="images/rplace-loader.gif" style="position: absolute; width: 128px; height: 128px; z-index: 22;"/>
<canvas id="waitingGameCanvas" style="width: 100%; height: 100%; z-index: 21;"></canvas>
<div id="connproblems">
<span translate="connectionProblems">Connection problems?</span>
<a onclick="localStorage.clear(); history.pushState(null, '', location.origin)" href translate="tryClickingHere">try clicking here</a>
<br>
or tweet us
<a href="https://twitter.com/rplacetk">@rplacetk</a>
</div>
</div>
<div id="maincontent">
<div id="posel" noselect>(0,0) 2.5x</div>
<div id="overlayMenu" noselect class="toastMenu">
<div style="display: flex;">
<h2 title="Make use of a canvas overlay image in order to help yourself better position your pixels" style="display: inline;flex-grow: 1;">Overlay:</h2>
<icon-close noselect="" class="close-button" onclick="overlayMenu.removeAttribute('opened')" class="active">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" class="active">
<path d="M18.442 2.442l-.884-.884L10 9.116 2.442 1.558l-.884.884L9.116 10l-7.558 7.558.884.884L10 10.884l7.558 7.558.884-.884L10.884 10l7.558-7.558z" class=""></path>
</svg>
</icon-close>
</div>
<br><br>
<input id="overlayInput" type="file" style="width: 100%;"/> <br><br>
<input value="" type="number" onchange="
overlayInfo.x = +this.value || 0
templateImage.style.transform = `translate(${overlayInfo.x}px, ${overlayInfo.y}px)`
" placeholder="Image X" style="width: calc(50% - 5px); margin-right: 5px;"/>
<input value="" type="number" onchange="
overlayInfo.y = +this.value || 0
templateImage.style.transform = `translate(${overlayInfo.x}px, ${overlayInfo.y}px)`
" placeholder="Image Y" style="width: calc(50% - 5px)"/> <br><br>
<div style="width: 100%; position: relative;">
<input id="overlayOpacity" type="range" onchange="
overlayInfo.opacity = (+this.value || 80) / 100
templateImage.style.opacity = overlayInfo.opacity
" min="0" value="80" max="100" style="width: 100%;" oninput="overlaySliderValue.textContent = Math.min(this.value, 99); overlaySliderValue.style.left = `calc(${this.value / 100} * 90%)`;"/>
<label for="overlayOpacity" style="position: absolute;left: 8px;top: 50%;transform: translateY(-50%);opacity: 0.6;">Opacity</label>
<span id="overlaySliderValue" style="position: absolute; white-space: pre-wrap; left: calc(0.8 * 90%); transform: translateX(10px); bottom: 12.5px; pointer-events: none; width: 16px; text-align: center;">80</span>
</div>
<br>
<div style="position: relative; display: flex;" onclick="
event.stopPropagation();
(async function(_this){
let uriString = await generateOverlayUrl()
if (uriString.length < 2000) {
navigator.clipboard.writeText(uriString)
_this.children[2].animate([
{ opacity: 1 },
{ scale: 1.1 }
], { duration: 1000, iterations: 1 })
}
else {
_this.children[2].textContent = 'Failed: Overlay is too big!'
_this.children[2].animate([
{ opacity: 1 },
{ color: 'red' }
], { duration: 1000, iterations: 1 })
if (_this['failMsgTimeout']) clearTimeout(_this['failMsgTimeout'])
_this['failMsgTimeout'] = setTimeout(() => {
_this.children[2].textContent = 'Copied to clipboard!'
}, 1000)
}
})(this);
" title="copy canvas link">
<img src="svg/clipboard.svg">
<span style="align-self: center; margin-right: 8px;cursor: pointer;">Copy overlay URL</span>
<span style="opacity: 0; align-self: center;">Copied to clipboard!</span>
</div>
</div>
<div id="place" noselect onclick="
if (CD < Date.now()) {
zoomIn()
showPalette()
// Persistent colours on mobile platforms
if (PEN != -1) {
pok.classList.add('enabled')
canvselect.style.background = colours.children[PEN].style.background
canvselect.children[0].style.display = 'none'
canvselect.style.outline = '8px white solid'
canvselect.style.boxShadow = '0px 2px 4px 0px rgb(0 0 0 / 50%)'
}
}
else {
AUDIOS.invalid.run()
}
" translate="connecting">Connecting...</div>
<canvas id="canvas" width="0" height="0" noselect></canvas>
<div id="canvparent1" noselect>
<img id="edge" height="226" width="290" src="images/snoo-edge.png" />
</div>
<div id="canvparent2" noselect>
<div id="canvselect">
<img theme="pixelselect" src="svg/pixel-select-2022.svg" style="position: absolute; top: -10%; left: -10%; width: 120%; height: 120%" ondragstart="return false">
</div>