-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclient.js
More file actions
2866 lines (2639 loc) · 130 KB
/
Copy pathclient.js
File metadata and controls
2866 lines (2639 loc) · 130 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
// ==UserScript==
// @name Unverified V2
// @namespace http://tampermonkey.net/
// @version 4
// @description Look at my license before you modify, I WILL DMCA you.
// @icon https://raw.githubusercontent.com/wytlines100/UnverifiedV2/refs/heads/main/logo.jpg
// @downloadURL https://raw.githubusercontent.com/wytlines100/UnverifiedV2/refs/heads/main/client.js
// @updateURL https://raw.githubusercontent.com/wytlines100/UnverifiedV2/refs/heads/main/client.js
// @license Proprietary License
// @author wytlines, andreypidd, jet, joudaALT, Trust, TheM1ddleM1n
// @match https://miniblox.io/*
// @grant GM_xmlhttpRequest
// @grant GM_info
// @grant unsafeWindow
// @connect raw.githubusercontent.com
// @connect ip-api.com
// ==/UserScript==
document.title = 'Unverified V2';
class UnverifiedIntro {
constructor() {
this.container = document.createElement("div");
Object.assign(this.container.style, {
position: "fixed",
top: 0, left: 0, width: "100vw", height: "100vh",
display: "flex", alignItems: "center", justifyContent: "center", flexDirection: "column",
backgroundColor: "black",
overflow: "hidden", zIndex: 9999,
opacity: 0,
transition: "opacity 0.6s ease",
});
this.check = document.createElement("div");
this.check.textContent = "✓";
Object.assign(this.check.style, {
color: "red", fontSize: "5rem", opacity: 0.05,
transition: "opacity 1.4s ease, transform 1.4s ease",
textShadow: '0 0 5px red, 0 0 10px red, 0 0 20px red',
});
this.circle = document.createElement("div");
Object.assign(this.circle.style, {
width: "100px", height: "100px", backgroundColor: "black",
border: "2px solid red", borderRadius: "50%",
boxShadow: "0 0 10px red, 0 0 20px red, 0 0 30px red",
display: "flex", alignItems: "center", justifyContent: "center",
opacity: 0, transform: "scale(0.85)",
transition: "opacity 1.4s ease, transform 1.4s cubic-bezier(0.22, 1, 0.36, 1)",
});
this.circle.appendChild(this.check);
this.container.appendChild(this.circle);
this.unverifiedText = document.createElement("div");
this.unverifiedText.textContent = "Unverified V2";
Object.assign(this.unverifiedText.style, {
color: "red", fontSize: "60px", opacity: 0, marginTop: "50px",
transition: "opacity 1.1s ease",
textShadow: '0 0 5px red, 0 0 10px red, 0 0 20px red',
});
this.container.appendChild(this.unverifiedText);
this.creditsText = document.createElement("div");
this.creditsText.textContent = "\nBy wytlines,\nandreypidd, jet, joudaALT, Trust, TheM1ddleM1n";
Object.assign(this.creditsText.style, {
color: "red", fontSize: "30px", opacity: 0, transition: "opacity 1.1s ease",
whiteSpace: 'pre-line', textAlign: "center",
textShadow: '0 0 5px red, 0 0 10px red, 0 0 20px red',
});
this.container.appendChild(this.creditsText);
this.keybindText = document.createElement("div");
const introKeybind = localStorage.getItem('uv2-setting-uikeybind') || 'rshift';
this.keybindText.textContent = `Press ${introKeybind === 'backtick' ? '`' : 'Right Shift'} to open the menu`;
Object.assign(this.keybindText.style, {
color: "red", fontSize: "30px", opacity: 0, marginTop: "30px",
transition: "opacity 1.1s ease",
textShadow: '0 0 5px red, 0 0 10px red, 0 0 20px red',
});
this.container.appendChild(this.keybindText);
}
playIntro() {
document.body.appendChild(this.container);
requestAnimationFrame(() => { this.container.style.opacity = 1; });
setTimeout(() => {
this.circle.style.opacity = 1;
this.circle.style.transform = "scale(1)";
this.check.style.opacity = 1;
}, 200);
setTimeout(() => { this.check.style.transform = "rotate(180deg)"; }, 700);
setTimeout(() => {
this.unverifiedText.style.opacity = 1;
}, 2400);
setTimeout(() => { this.creditsText.style.opacity = 1; }, 3600);
setTimeout(() => { this.keybindText.style.opacity = 1; }, 4800);
setTimeout(() => {
this.container.style.transition = "opacity 1.8s cubic-bezier(0.4, 0, 0.2, 1), transform 1.8s cubic-bezier(0.4, 0, 0.2, 1)";
this.container.style.opacity = 0;
this.container.style.transform = "scale(1.04)";
}, 10800);
setTimeout(() => { this.container.remove(); }, 12600);
}
}
(function() {
'use strict';
const waitForGame = setInterval(() => {
if (!/\/join\//.test(window.location.pathname)) return;
const reactRoot = document.querySelector("#react");
if (!reactRoot) return;
const game = Object.values(reactRoot)[0]?.updateQueue?.baseState?.element?.props?.game;
if (game && game.chat && typeof game.chat.addChat === "function") {
clearInterval(waitForGame);
game.chat.addChat({
text: "\\glow\\\\shiny\\\\#BF3011\\[Unverified V2]:\\reset\\ Client initialized. Updates and support are available on our Discord."
});
}
}, 500);
})();
(function() {
'use strict';
let rawTypedSlash = false;
const gameRef = {
_game: null,
get game() {
if (this._game) return this._game;
const reactRoot = document.querySelector("#react");
if (!reactRoot) return null;
try {
const fiber = Object.values(reactRoot)[0];
const game = fiber?.updateQueue?.baseState?.element?.props?.game;
if (game) this._game = game;
return game;
} catch (e) { return null; }
}
};
function pushLocalChat(textMsg) {
const game = gameRef.game;
if (game && game.chat && typeof game.chat.addChat === "function") {
game.chat.addChat({ text: textMsg });
}
}
async function handleInfoCommand(targetUser) {
if (!targetUser) {
pushLocalChat("\\#FF0000\\Error executing command: /info <username>");
return;
}
try {
const res = await fetch('https://miniblox.io/auth-api/accounts/stats/username', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: targetUser })
});
if (!res.ok) {
pushLocalChat(`\\#FF0000\\Error executing command: User ${targetUser} not found`);
return;
}
const data = await res.json();
if (data && data.profile) {
const username = data.profile.username || targetUser;
const rawRank = data.profile.rank ? data.profile.rank.trim().toLowerCase() : "";
const rank = (!rawRank || rawRank === "player") ? "None" : rawRank;
const level = data.profile.level !== undefined ? data.profile.level : "0";
pushLocalChat(`Username: ${username}\nRank: ${rank}\nLevel: ${level}`);
} else {
pushLocalChat(`\\#FF0000\\Error executing command: User ${targetUser} not found`);
}
} catch (err) {
pushLocalChat(`\\#FF0000\\Error executing command: User ${targetUser} not found`);
}
}
function checkAndExecuteInfo(inputStr) {
if (typeof inputStr !== 'string') return false;
const trimmed = inputStr.trim();
const cleanStr = trimmed.replace(/^\//, '').trim();
if (cleanStr.toLowerCase() === 'info' || cleanStr.toLowerCase().startsWith('info ')) {
if (trimmed.startsWith('/') || rawTypedSlash) {
const parts = cleanStr.split(/\s+/);
handleInfoCommand(parts[1] || "");
rawTypedSlash = false;
return true;
}
}
rawTypedSlash = false;
return false;
}
function hookChatEngine() {
const game = gameRef.game;
if (!game || !game.chat) return false;
const chat = game.chat;
window.addEventListener('keydown', (e) => {
if (e.key === '/' || e.code === 'Slash') rawTypedSlash = true;
}, true);
if (typeof chat.runCommand === 'function' && !chat.runCommand._isHooked) {
const origRunCommand = chat.runCommand;
chat.runCommand = function(cmdText, ...args) {
if (checkAndExecuteInfo(cmdText)) return;
return origRunCommand.apply(this, [cmdText, ...args]);
};
chat.runCommand._isHooked = true;
}
if (typeof chat.submit === 'function' && !chat.submit._isHooked) {
const origSubmit = chat.submit;
chat.submit = function(...args) {
if (checkAndExecuteInfo(chat.inputValue)) {
chat.setInputValue ? chat.setInputValue("") : (chat.inputValue = "");
if (typeof chat.closeInput === 'function') chat.closeInput();
return;
}
return origSubmit.apply(this, args);
};
chat.submit._isHooked = true;
}
return true;
}
const initInterval = setInterval(() => {
if (hookChatEngine()) clearInterval(initInterval);
}, 500);
})();
(function() {
'use strict';
const intro = new UnverifiedIntro();
intro.playIntro();
const UV2_RAW_BASE = 'https://raw.githubusercontent.com/wytlines100/UnverifiedV2/refs/heads/main/';
const UV2_SCRIPT_URL = UV2_RAW_BASE + 'client.js';
const UV2_CHANGELOG_URL = UV2_RAW_BASE + 'CHANGELOG.md';
let uv2LastCheck = 0;
function uv2CompareVersions(a, b) {
const pa = String(a).split('.').map(n => parseInt(n, 10) || 0);
const pb = String(b).split('.').map(n => parseInt(n, 10) || 0);
const len = Math.max(pa.length, pb.length);
for (let i = 0; i < len; i++) {
const x = pa[i] || 0;
const y = pb[i] || 0;
if (x > y) return 1;
if (x < y) return -1;
}
return 0;
}
function uv2ParseChangelog(text) {
const m = text.match(/\n## ([^\n]+)\n([\s\S]*?)(\n## |$)/);
if (!m) return null;
return {
heading: m[1].trim(),
notes: m[2].trim().split('\n').map(l => l.replace(/^-\s*/, '')).filter(l => l.length > 0)
};
}
function uv2ShowPopup(opts) {
const existing = document.getElementById('uv2-popup');
if (existing) existing.remove();
const wrap = document.createElement('div');
wrap.id = 'uv2-popup';
wrap.style.cssText = 'position:fixed;top:-300px;left:50%;transform:translateX(-50%);z-index:100002;pointer-events:none;transition:top 0.5s ease,opacity 0.5s ease;opacity:0;';
const box = document.createElement('div');
box.style.cssText = 'pointer-events:auto;background:#141414;border:1px solid rgba(231,76,60,0.5);border-radius:28px;padding:16px 24px;width:340px;max-width:90vw;font-family:MinibloxFont,sans-serif;color:#fff;box-shadow:0 12px 40px rgba(0,0,0,0.7);box-sizing:border-box;text-align:center;';
const title = document.createElement('div');
title.textContent = opts.title;
title.style.cssText = 'font-size:16px;color:#e74c3c;text-shadow:0 0 12px rgba(231,76,60,0.5);';
box.appendChild(title);
const subtitle = document.createElement('div');
subtitle.textContent = opts.subtitle;
subtitle.style.cssText = 'font-size:11px;color:#666;margin:2px 0 10px;letter-spacing:0.5px;';
box.appendChild(subtitle);
if (opts.notes.length) {
const list = document.createElement('div');
list.style.cssText = 'display:flex;flex-direction:column;gap:6px;margin-bottom:12px;max-height:120px;overflow-y:auto;text-align:left;';
opts.notes.forEach(line => {
const row = document.createElement('div');
row.style.cssText = 'display:flex;align-items:flex-start;gap:8px;font-size:12px;color:#ccc;line-height:1.4;';
const dot = document.createElement('div');
dot.style.cssText = 'width:4px;height:4px;border-radius:50%;background:#e74c3c;margin-top:6px;flex-shrink:0;';
const text = document.createElement('div');
text.textContent = line;
row.appendChild(dot);
row.appendChild(text);
list.appendChild(row);
});
box.appendChild(list);
}
function close() {
wrap.style.top = '-300px';
wrap.style.opacity = '0';
setTimeout(() => wrap.remove(), 500);
}
const btnRow = document.createElement('div');
btnRow.style.cssText = 'display:flex;gap:8px;';
const primaryBtn = document.createElement('button');
primaryBtn.textContent = opts.primaryLabel;
primaryBtn.style.cssText = 'flex:1;background:#e74c3c;color:#fff;border:none;border-radius:16px;padding:8px 14px;cursor:pointer;font-family:MinibloxFont,sans-serif;font-size:12px;';
primaryBtn.addEventListener('click', () => {
if (opts.onPrimary) opts.onPrimary();
close();
});
btnRow.appendChild(primaryBtn);
if (opts.secondaryLabel) {
const secondaryBtn = document.createElement('button');
secondaryBtn.textContent = opts.secondaryLabel;
secondaryBtn.style.cssText = 'flex:1;background:#2a2a2a;color:#fff;border:1px solid #444;border-radius:16px;padding:8px 14px;cursor:pointer;font-family:MinibloxFont,sans-serif;font-size:12px;';
secondaryBtn.addEventListener('click', () => {
if (opts.onSecondary) opts.onSecondary();
close();
});
btnRow.appendChild(secondaryBtn);
}
box.appendChild(btnRow);
wrap.appendChild(box);
document.body.appendChild(wrap);
setTimeout(() => { wrap.style.top = '18px'; wrap.style.opacity = '1'; }, 20);
}
function uv2Check() {
const installed = GM_info.script.version;
GM_xmlhttpRequest({
method: 'GET',
url: UV2_SCRIPT_URL + '?t=' + Date.now(),
onload(r) {
const m = r.responseText.match(/@version\s+([\d.]+)/);
const latest = m ? m[1] : null;
const hasUpdate = latest && uv2CompareVersions(latest, installed) > 0 && sessionStorage.getItem('uv2-update-dismissed') !== latest;
const needsWhatsNew = localStorage.getItem('uv2-whatsnew-version') !== installed;
if (!hasUpdate && !needsWhatsNew) return;
if (document.getElementById('uv2-popup')) return;
GM_xmlhttpRequest({
method: 'GET',
url: UV2_CHANGELOG_URL + '?t=' + Date.now(),
onload(c) {
if (document.getElementById('uv2-popup')) return;
const log = uv2ParseChangelog(c.responseText);
if (hasUpdate) {
uv2ShowPopup({
title: 'Update Available',
subtitle: `v${installed} -> v${latest}`,
notes: log ? log.notes : [],
primaryLabel: 'Update Now',
secondaryLabel: 'Remind Me Later',
onPrimary: () => window.open(UV2_SCRIPT_URL, '_blank'),
onSecondary: () => sessionStorage.setItem('uv2-update-dismissed', latest)
});
} else if (log) {
uv2ShowPopup({
title: "What's New",
subtitle: log.heading,
notes: log.notes,
primaryLabel: 'Dismiss',
onPrimary: () => localStorage.setItem('uv2-whatsnew-version', installed)
});
}
},
onerror() {
if (hasUpdate && !document.getElementById('uv2-popup')) {
uv2ShowPopup({
title: 'Update Available',
subtitle: `v${installed} -> v${latest}`,
notes: [],
primaryLabel: 'Update Now',
secondaryLabel: 'Remind Me Later',
onPrimary: () => window.open(UV2_SCRIPT_URL, '_blank'),
onSecondary: () => sessionStorage.setItem('uv2-update-dismissed', latest)
});
}
}
});
}
});
}
function uv2ThrottledCheck() {
const now = Date.now();
if (now - uv2LastCheck < 30000) return;
uv2LastCheck = now;
uv2Check();
}
setTimeout(uv2ThrottledCheck, 12800);
setInterval(uv2ThrottledCheck, 60000);
document.addEventListener('visibilitychange', () => {
if (!document.hidden) uv2ThrottledCheck();
});
const style = document.createElement('style');
style.innerHTML = `
@font-face {
font-family: 'MinibloxFont';
src: url('https://cdn.glitch.global/adb12490-d563-43cb-9711-2a69a8bb1c06/Faithful.ttf?v=1735593093308') format('truetype');
}
@keyframes uv2UIOpen {
from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes uv2UIClose {
from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
to { opacity: 0; transform: translate(-50%, -54%) scale(0.94); }
}
#uv2-main-ui.uv2-animate-in {
animation: uv2UIOpen 0.22s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#uv2-main-ui.uv2-animate-out {
animation: uv2UIClose 0.18s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes uv2-title-shine-loop {
0% { background-position: 200% center; }
100% { background-position: -200% center; }
}
.uv2-title-shine {
background-image: linear-gradient(100deg, #e74c3c 0%, #e74c3c 40%, #ff8a80 50%, #e74c3c 60%, #e74c3c 100%);
background-size: 250% auto;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;
animation: uv2-title-shine-loop 3.5s linear infinite;
text-shadow: 0 0 18px rgba(231,76,60,0.55);
}
@keyframes notificationProgress {
0% { width: 100%; }
100% { width: 0%; }
}
@keyframes afkPulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.5; transform: scale(1.2); }
}
.bind-popup { position:absolute; background-color:#2c3e50; color:white; padding:20px; border-radius:10px; box-shadow:0 0 10px rgba(0,0,0,0.7); z-index:10001; font-family:'MinibloxFont',sans-serif; display:none; text-align:center; }
.bind-popup input { background-color:#34495e; color:white; border:2px solid #e74c3c; border-radius:5px; padding:10px; font-size:18px; width:200px; }
.bind-popup button { background-color:#e74c3c; color:white; border:none; border-radius:5px; padding:10px 20px; margin-top:10px; cursor:pointer; }
.bind-popup button:hover { background-color:#c0392b; }
.module-tooltip { visibility:hidden; position:absolute; background-color:#2c3e50; color:white; padding:5px 10px; border-radius:5px; font-size:14px; z-index:10000; opacity:0; transition:opacity 0.3s ease; bottom:6px; right:10px; white-space:nowrap; pointer-events:none; }
.other-notification { font-family:'MinibloxFont',sans-serif; font-size:14px; color:white; background:linear-gradient(135deg, #e74c3c, #c0392b); padding:12px 24px; border-radius:8px; margin-bottom:12px; box-shadow:0 4px 15px rgba(0,0,0,0.3); transition:opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); opacity:0; transform:translateX(40px) scale(0.96); border-left:4px solid #ffcc00; font-weight:500; letter-spacing:0.5px; position:relative; overflow:hidden; will-change:transform, opacity; }
.notification-progress { position:absolute; bottom:0; left:0; height:3px; background:#ffcc00; width:100%; animation: notificationProgress 3s linear forwards; }
.settings-icon { width:30px; height:30px; fill:white; transition:transform 0.3s ease; }
.settings-icon:hover { transform:rotate(90deg); }
#uv2-sidebar { box-sizing:border-box; }
#uv2-page-settings-content { box-sizing:border-box; height:100%; }
#uv2-settings-panel { width:100% !important; height:100% !important; max-height:none !important; border-radius:0 !important; border:none !important; box-shadow:none !important; background:#000000 !important; display:flex; flex-direction:column; }
#uv2-settings-titlebar { background:#000000 !important; border-bottom:1px solid rgba(255,255,255,0.07) !important; flex-shrink:0; }
#uv2-settings-titlebar { display:flex; align-items:center; justify-content:space-between; padding:14px 18px; }
#uv2-settings-titlebar span { font-size:15px; font-weight:600; display:flex; align-items:center; gap:8px; }
#uv2-settings-titlebar span svg { fill:#e74c3c; }
#uv2-settings-close { background:none; border:none; color:#aaa; font-size:20px; cursor:pointer; line-height:1; padding:2px 6px; border-radius:4px; transition:background 0.2s,color 0.2s; }
#uv2-settings-close:hover { background:#e74c3c; color:#fff; }
#uv2-settings-body { display:flex; flex:1; min-height:0; overflow:hidden; }
#uv2-settings-content { flex:1; min-height:0; overflow-y:auto; padding:16px 20px; }
.uv2-settings-page { display:block; }
.uv2-settings-page + .uv2-settings-page { border-top:1px solid rgba(255,255,255,0.08); margin-top:16px; padding-top:4px; }
.uv2-section-title { font-size:10px; text-transform:uppercase; letter-spacing:0.1em; color:#555; margin:16px 0 8px; padding-left:4px; }
.uv2-setting-row { display:flex; align-items:center; height:52px; padding:0 16px; border-radius:8px; background:linear-gradient(135deg,#222222,#191919); border:1px solid rgba(255,255,255,0.07); margin-bottom:8px; box-shadow:0 1px 4px rgba(0,0,0,0.35); transition:background 0.15s ease; box-sizing:border-box; border-bottom:1px solid rgba(255,255,255,0.07); }
.uv2-setting-row:last-child { margin-bottom:0; }
.uv2-setting-row:hover { background:linear-gradient(135deg,#2a2a2a,#202020); }
.uv2-setting-row > div:first-child { display:flex; align-items:center; flex:1; min-width:0; }
.uv2-setting-label { font-size:13px; color:#ccc; min-width:155px; flex-shrink:0; padding-right:16px; border-right:1px solid rgba(255,255,255,0.09); font-family:'MinibloxFont',sans-serif; white-space:nowrap; }
.uv2-setting-desc { font-size:11.5px; color:#555; padding-left:16px; flex:1; font-family:'MinibloxFont',sans-serif; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.uv2-toggle { position:relative; width:42px; height:22px; flex-shrink:0; }
.uv2-toggle input { display:none; }
.uv2-toggle-track { position:absolute; inset:0; background:#444; border-radius:999px; cursor:pointer; transition:background 0.2s; }
.uv2-toggle-track::after { content:''; position:absolute; top:3px; left:3px; width:16px; height:16px; background:#fff; border-radius:50%; transition:transform 0.2s; }
.uv2-toggle input:checked + .uv2-toggle-track { background:#e74c3c; }
.uv2-toggle input:checked + .uv2-toggle-track::after { transform:translateX(20px); }
.module-container {
border-radius: 8px !important;
}
`;
document.head.appendChild(style);
const ui = document.createElement("div");
ui.id = "uv2-main-ui";
ui.style.position = "fixed";
ui.style.top = "50%";
ui.style.left = "50%";
ui.style.transform = "translate(-50%, -50%)";
ui.style.backgroundColor = "#000000";
ui.style.color = "white";
ui.style.padding = "0";
ui.style.borderRadius = "10px";
ui.style.display = "none";
ui.style.flexDirection = "row";
ui.style.zIndex = "9999";
ui.style.boxShadow = "0 32px 80px rgba(0,0,0,0.95), 0 0 0 1px rgba(231,76,60,0.15), inset 0 1px 0 rgba(255,255,255,0.04)";
ui.style.fontFamily = 'MinibloxFont, sans-serif';
ui.style.maxHeight = "90vh";
ui.style.maxWidth = "92vw";
ui.style.width = "960px";
ui.style.borderTop = "2px solid rgba(231,76,60,0.8)";
ui.style.overflow = "hidden";
document.body.appendChild(ui);
const faLink = document.createElement("link");
faLink.rel = "stylesheet";
faLink.href = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css";
document.head.appendChild(faLink);
const targetImageUrl = "https://images3.alphacoders.com/133/1333794.jpeg";
const targetImageSelector = "img.chakra-image.css-139opjw";
function enforceTargetImage() {
const img = document.querySelector(targetImageSelector);
if (!img) return;
if (img.getAttribute("src") !== targetImageUrl) {
img.src = targetImageUrl;
}
if (img.getAttribute("srcset") !== targetImageUrl) {
img.srcset = targetImageUrl;
}
}
enforceTargetImage();
const imageObserver = new MutationObserver(() => {
enforceTargetImage();
});
imageObserver.observe(document.body, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ["src", "srcset"]
});
const uv2Sidebar = document.createElement("div");
uv2Sidebar.id = "uv2-sidebar";
uv2Sidebar.style.cssText = [
"width:160px;min-width:160px;background:#000000;display:flex;flex-direction:column;",
"border-right:1px solid rgba(255,255,255,0.06);overflow:hidden;flex-shrink:0;",
"border-radius:0 0 0 10px;"
].join("");
const uv2SidebarLogo = document.createElement("div");
uv2SidebarLogo.style.cssText = [
"padding:18px 14px 16px;border-bottom:1px solid rgba(255,255,255,0.06);",
"display:flex;align-items:center;gap:9px;"
].join("");
uv2SidebarLogo.innerHTML = [
'<img src="https://raw.githubusercontent.com/wytlines100/UnverifiedV2/refs/heads/main/logo.jpg" style="width:28px;height:28px;border-radius:6px;object-fit:cover;flex-shrink:0;border:1px solid rgba(231,76,60,0.4);">',
'<span style="color:#e74c3c;font-size:10px;letter-spacing:2px;text-transform:uppercase;',
'font-family:MinibloxFont,sans-serif;line-height:1.2;">UV2</span>'
].join("");
uv2Sidebar.appendChild(uv2SidebarLogo);
const uv2NavDefs = [
{ page: 'main', label: 'Modules', icon: 'fa-th-large' },
{ page: 'gui', label: 'Color', icon: 'fa-paint-brush' },
{ page: 'config', label: 'Config', icon: 'fa-cog' },
{ page: 'settings', label: 'Settings', icon: 'fa-sliders' },
{ page: 'changelog', label: 'Changelog', icon: 'fa-history' },
];
const uv2NavEls = {};
const uv2SidebarNav = document.createElement("div");
uv2SidebarNav.style.cssText = "display:flex;flex-direction:column;padding:8px 0;flex:1;";
uv2NavDefs.forEach(def => {
const el = document.createElement("div");
el.dataset.page = def.page;
el.style.cssText = [
"display:flex;align-items:center;gap:10px;padding:11px 16px;cursor:pointer;",
"font-size:13px;color:#666;border-left:2px solid transparent;",
"transition:all 0.15s ease;font-family:MinibloxFont,sans-serif;user-select:none;"
].join("");
el.innerHTML = `<i class="fa ${def.icon}" style="font-size:15px;width:18px;text-align:center;flex-shrink:0;"></i><span>${def.label}</span>`;
el.addEventListener("mouseenter", () => {
if (el.dataset.active !== "1") { el.style.color = "#ccc"; el.style.backgroundColor = "rgba(255,255,255,0.04)"; }
});
el.addEventListener("mouseleave", () => {
if (el.dataset.active !== "1") { el.style.color = "#666"; el.style.backgroundColor = ""; }
});
el.addEventListener("click", () => switchUv2Page(def.page));
uv2NavEls[def.page] = el;
uv2SidebarNav.appendChild(el);
});
uv2Sidebar.appendChild(uv2SidebarNav);
const uv2SidebarFooter = document.createElement("div");
uv2SidebarFooter.style.cssText = [
"padding:12px 14px;border-top:1px solid rgba(255,255,255,0.05);",
"font-size:11px;color:#888;letter-spacing:1.5px;text-transform:uppercase;",
"font-family:MinibloxFont,sans-serif;text-align:center;"
].join("");
uv2SidebarFooter.textContent = "v" + GM_info.script.version;
uv2Sidebar.appendChild(uv2SidebarFooter);
ui.appendChild(uv2Sidebar);
const uv2ContentArea = document.createElement("div");
uv2ContentArea.style.cssText = "flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0;";
ui.appendChild(uv2ContentArea);
const uv2MainPage = document.createElement("div");
uv2MainPage.id = "uv2-page-main-content";
uv2MainPage.style.cssText = "flex:1;display:flex;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding:22px 24px;";
uv2ContentArea.appendChild(uv2MainPage);
const uv2GUIPage = document.createElement("div");
uv2GUIPage.id = "uv2-page-gui-content";
uv2GUIPage.style.cssText = "flex:1;display:none;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding:22px 24px;";
uv2ContentArea.appendChild(uv2GUIPage);
const uv2ConfigPage = document.createElement("div");
uv2ConfigPage.id = "uv2-page-config-content";
uv2ConfigPage.style.cssText = "flex:1;display:none;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding:22px 24px;";
uv2ContentArea.appendChild(uv2ConfigPage);
const uv2SettingsPage = document.createElement("div");
uv2SettingsPage.id = "uv2-page-settings-content";
uv2SettingsPage.style.cssText = "flex:1;display:none;overflow:hidden;";
uv2ContentArea.appendChild(uv2SettingsPage);
const uv2ChangelogPage = document.createElement("div");
uv2ChangelogPage.id = "uv2-page-changelog-content";
uv2ChangelogPage.style.cssText = "flex:1;display:none;flex-direction:column;overflow-y:auto;overflow-x:hidden;padding:22px 24px;";
uv2ContentArea.appendChild(uv2ChangelogPage);
let guiPrimaryColor = localStorage.getItem('uv2-gui-primary-color') || '#e74c3c';
let armorHudDocked = localStorage.getItem('uv2-armorhud-docked') === 'true';
let armorHudOpacity = parseFloat(localStorage.getItem('uv2-armorhud-opacity') || '1');
let armorHudBgOpacity = parseFloat(localStorage.getItem('uv2-armorhud-bgopacity') || '0.55');
let armorHudIconSize = parseInt(localStorage.getItem('uv2-armorhud-iconsize') || '0', 10);
let armorHudGap = parseInt(localStorage.getItem('uv2-armorhud-gap') || '4', 10);
function applyGUIStyles() {
ui.style.backgroundColor = '#000000';
ui.style.color = '#ffffff';
ui.querySelectorAll('.mp-search-go').forEach(btn => {
btn.style.backgroundColor = guiPrimaryColor;
});
ui.querySelectorAll('.module-container').forEach(mc => {
const span = mc.querySelector('span');
if (span) {
span.style.color = guiPrimaryColor;
span.style.textShadow = `0 0 18px ${guiPrimaryColor}40`;
}
if (mc._uv2Active) {
mc.style.border = `1px solid ${guiPrimaryColor}80`;
mc.style.boxShadow = `0 0 0 3px ${guiPrimaryColor}14, 0 1px 4px rgba(0,0,0,0.4)`;
const tw = mc._toggleWrap;
const tk = mc._toggleKnob;
if (tw) { tw.style.background = `${guiPrimaryColor}40`; tw.style.borderColor = `${guiPrimaryColor}60`; }
if (tk) tk.style.background = guiPrimaryColor;
}
});
let toggleStyle = document.getElementById('uv2-dynamic-toggle-style');
if (!toggleStyle) {
toggleStyle = document.createElement('style');
toggleStyle.id = 'uv2-dynamic-toggle-style';
document.head.appendChild(toggleStyle);
}
toggleStyle.textContent = `.uv2-toggle input:checked + .uv2-toggle-track { background: ${guiPrimaryColor} !important; }`;
Object.values(uv2NavEls).forEach(el => {
if (el.dataset.active === "1") {
el.style.color = guiPrimaryColor;
el.style.borderLeftColor = guiPrimaryColor;
el.style.backgroundColor = `${guiPrimaryColor}14`;
const icon = el.querySelector('i');
if (icon) icon.style.color = guiPrimaryColor;
}
});
if (typeof title !== 'undefined' && title) {
title.style.color = guiPrimaryColor;
}
const armorHudPin = document.querySelector('#armor-hud-dock-btn');
if (armorHudPin && armorHudDocked) {
armorHudPin.style.color = guiPrimaryColor;
armorHudPin.style.textShadow = `0 0 8px ${guiPrimaryColor}80`;
}
try { if (typeof buildArmorHudSettingsPage === 'function') buildArmorHudSettingsPage(); } catch(e) {}
['#save-config-btn', '#load-config-btn'].forEach(sel => {
const btn = document.querySelector(sel);
if (btn) { btn.style.background = guiPrimaryColor; btn.style.backgroundColor = guiPrimaryColor; }
});
const changelogPage = document.getElementById('uv2-page-changelog-content');
if (changelogPage) {
changelogPage.querySelectorAll('.uv2-changelog-title').forEach(el => { el.style.color = guiPrimaryColor; });
changelogPage.querySelectorAll('.uv2-changelog-dot').forEach(el => { el.style.background = guiPrimaryColor; });
changelogPage.querySelectorAll('.uv2-changelog-marker').forEach(el => {
el.style.background = guiPrimaryColor;
el.style.boxShadow = `0 0 10px ${guiPrimaryColor}80`;
});
changelogPage.querySelectorAll('.uv2-changelog-tag').forEach(el => {
el.style.color = guiPrimaryColor;
el.style.borderColor = `${guiPrimaryColor}80`;
});
}
}
function buildGUIPage() {
uv2GUIPage.innerHTML = '';
const heading = document.createElement('h2');
heading.textContent = 'Color';
heading.style.cssText = 'font-size:28px;font-family:MinibloxFont,sans-serif;margin:0 0 20px 0;text-align:center;color:#fff;';
uv2GUIPage.appendChild(heading);
const sectionLabel = document.createElement('div');
sectionLabel.className = 'uv2-section-title';
sectionLabel.textContent = 'Accent color';
sectionLabel.style.marginTop = '0';
uv2GUIPage.appendChild(sectionLabel);
const row = document.createElement('div');
row.style.cssText = 'display:flex;align-items:center;gap:16px;padding:4px 0 20px 0;';
uv2GUIPage.appendChild(row);
const picker = document.createElement('input');
picker.type = 'color';
picker.value = guiPrimaryColor;
picker.style.cssText = 'width:48px;height:48px;border:none;border-radius:8px;cursor:pointer;background:none;padding:0;flex-shrink:0;';
row.appendChild(picker);
const hexInput = document.createElement('input');
hexInput.type = 'text';
hexInput.value = guiPrimaryColor;
hexInput.maxLength = 7;
hexInput.style.cssText = 'background:#111;color:#fff;border:1px solid rgba(255,255,255,0.12);border-radius:6px;padding:10px 14px;font-size:14px;font-family:MinibloxFont,sans-serif;width:110px;outline:none;';
row.appendChild(hexInput);
const previewDot = document.createElement('div');
previewDot.style.cssText = `width:28px;height:28px;border-radius:50%;background:${guiPrimaryColor};box-shadow:0 0 12px ${guiPrimaryColor}88;transition:background 0.15s,box-shadow 0.15s;flex-shrink:0;`;
row.appendChild(previewDot);
const recentLabel = document.createElement('div');
recentLabel.className = 'uv2-section-title';
recentLabel.textContent = 'Recent colors';
uv2GUIPage.appendChild(recentLabel);
const recentRow = document.createElement('div');
recentRow.style.cssText = 'display:flex;flex-wrap:wrap;gap:10px;padding:4px 0 0 0;';
uv2GUIPage.appendChild(recentRow);
function loadRecent() {
try { return JSON.parse(localStorage.getItem('uv2-recent-colors') || '[]'); } catch(e) { return []; }
}
function saveRecent(hex) {
let list = loadRecent().filter(c => c !== hex);
list.unshift(hex);
if (list.length > 7) list = list.slice(0, 7);
localStorage.setItem('uv2-recent-colors', JSON.stringify(list));
}
function renderRecent() {
recentRow.innerHTML = '';
loadRecent().forEach(hex => {
const swatch = document.createElement('div');
swatch.style.cssText = `width:32px;height:32px;border-radius:6px;background:${hex};cursor:pointer;border:2px solid transparent;transition:border-color 0.15s,transform 0.15s;flex-shrink:0;`;
swatch.addEventListener('mouseenter', () => { swatch.style.transform = 'scale(1.15)'; });
swatch.addEventListener('mouseleave', () => { swatch.style.transform = 'scale(1)'; });
swatch.addEventListener('click', () => { applyColor(hex); });
if (hex === guiPrimaryColor) swatch.style.borderColor = '#fff';
recentRow.appendChild(swatch);
});
}
function applyColor(hex) {
guiPrimaryColor = hex;
localStorage.setItem('uv2-gui-primary-color', hex);
picker.value = hex;
hexInput.value = hex;
previewDot.style.background = hex;
previewDot.style.boxShadow = `0 0 12px ${hex}88`;
saveRecent(hex);
renderRecent();
applyGUIStyles();
}
renderRecent();
picker.addEventListener('change', () => { applyColor(picker.value); });
hexInput.addEventListener('input', () => {
const val = hexInput.value.trim();
if (/^#[0-9a-fA-F]{6}$/.test(val)) applyColor(val);
});
hexInput.addEventListener('keydown', e => { if (e.key === 'Enter') hexInput.blur(); });
}
function buildConfigPage() {
uv2ConfigPage.innerHTML = `
<h2 style="font-size:30px;font-family:MinibloxFont,sans-serif;margin:0 0 20px 0;text-align:center;">Config Management</h2>
<div class="uv2-section-title">Save / Load Configuration</div>
<div class="uv2-setting-row" style="display:flex;flex-direction:row;height:auto;padding:16px;gap:16px;">
<button id="save-config-btn" style="flex:1;background:${guiPrimaryColor};color:white;border:none;border-radius:6px;padding:12px 20px;cursor:pointer;font-family:MinibloxFont,sans-serif;">Save Config</button>
<input type="file" id="config-file-input" accept=".json" style="display:none;">
<button id="load-config-btn" style="flex:1;background:${guiPrimaryColor};color:white;border:none;border-radius:6px;padding:12px 20px;cursor:pointer;font-family:MinibloxFont,sans-serif;">Load Config</button>
</div>
`;
const saveBtn = uv2ConfigPage.querySelector('#save-config-btn');
if (saveBtn) {
saveBtn.addEventListener('click', () => {
const config = {
version: GM_info.script.version,
gui: {
primaryColor: guiPrimaryColor,
},
settings: {
moduleSounds: settings.moduleSounds,
saving: settings.saving,
autoAfk: settings.autoAfk,
afkChat: settings.afkChat,
afkDelay: afkDelay,
uiKeybind: uiKeybind,
},
moduleBindings: moduleBindings,
moduleStates: {},
};
[...gridContainer.children].forEach(mc => {
const name = mc.dataset.moduleName;
if (name) config.moduleStates[name] = mc._uv2Active;
});
const jsonStr = JSON.stringify(config, null, 2);
const blob = new Blob([jsonStr], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `unverified-config-${new Date().toISOString().slice(0,19)}.json`;
a.click();
URL.revokeObjectURL(url);
showNotification('Configuration saved successfully!', true);
});
}
const fileInput = uv2ConfigPage.querySelector('#config-file-input');
const loadBtn = uv2ConfigPage.querySelector('#load-config-btn');
if (fileInput && loadBtn) {
loadBtn.addEventListener('click', () => {
fileInput.click();
});
fileInput.addEventListener('change', (e) => {
const file = e.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = (event) => {
try {
const config = JSON.parse(event.target.result);
if (config.gui) {
if (config.gui.primaryColor) {
guiPrimaryColor = config.gui.primaryColor;
localStorage.setItem('uv2-gui-primary-color', guiPrimaryColor);
}
applyGUIStyles();
buildGUIPage();
}
if (config.settings) {
if (typeof config.settings.moduleSounds === 'boolean') {
settings.moduleSounds = config.settings.moduleSounds;
localStorage.setItem('uv2-setting-sounds', settings.moduleSounds);
const soundsToggle = document.querySelector("#uv2-toggle-sounds");
if (soundsToggle) soundsToggle.checked = settings.moduleSounds;
}
if (typeof config.settings.saving === 'boolean') {
settings.saving = config.settings.saving;
localStorage.setItem('uv2-setting-saving', settings.saving ? 'true' : 'false');
const savingToggle = document.querySelector("#uv2-toggle-saving");
if (savingToggle) savingToggle.checked = settings.saving;
}
if (typeof config.settings.autoAfk === 'boolean') {
settings.autoAfk = config.settings.autoAfk;
localStorage.setItem('uv2-setting-autoafk', settings.autoAfk ? 'true' : 'false');
const autoAfkToggle = document.querySelector("#uv2-toggle-autoafk");
if (autoAfkToggle) autoAfkToggle.checked = settings.autoAfk;
if (settings.autoAfk) startAfkDetector(); else stopAfkDetector();
}
if (typeof config.settings.afkChat === 'boolean') {
settings.afkChat = config.settings.afkChat;
localStorage.setItem('uv2-setting-afkchat', settings.afkChat);
const afkChatToggle = document.querySelector("#uv2-toggle-afkchat");
if (afkChatToggle) afkChatToggle.checked = settings.afkChat;
}
if (typeof config.settings.afkDelay === 'number') {
afkDelay = Math.min(120, Math.max(5, config.settings.afkDelay));
localStorage.setItem('uv2-setting-afkdelay', afkDelay);
if (afkDelayInput) afkDelayInput.value = afkDelay;
}
}
if (typeof config.settings.uiKeybind === 'string') {
uiKeybind = config.settings.uiKeybind;
localStorage.setItem('uv2-setting-uikeybind', uiKeybind);
const uiKeybindSelect = document.querySelector("#uv2-uikeybind-select");
if (uiKeybindSelect) uiKeybindSelect.value = uiKeybind;
}
if (config.moduleBindings) {
moduleBindings = config.moduleBindings;
}
setTimeout(() => {
if (config.moduleStates) {
isRestoring = true;
[...gridContainer.children].forEach(mc => {
const name = mc.dataset.moduleName;
if (name && config.moduleStates[name] !== undefined) {
if (config.moduleStates[name] && !mc._uv2Active) mc.click();
else if (!config.moduleStates[name] && mc._uv2Active) mc.click();
}
});
isRestoring = false;
}
}, 500);
showNotification('Configuration loaded successfully!', true);
} catch (err) {
console.error(err);
showNotification('Failed!: Invalid JSON config', false);
}
};
reader.readAsText(file);
fileInput.value = '';
});
}
}
function buildArmorHudSettingsPage() {
const container = document.getElementById('uv2-armorhud-settings-section');
if (!container) return;
container.innerHTML = '';
const statusRow = document.createElement('div');
statusRow.style.cssText = 'display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-radius:8px;background:linear-gradient(135deg,#222,#191919);border:1px solid rgba(255,255,255,0.07);margin-bottom:12px;';
const statusText = document.createElement('div');
statusText.id = 'armor-hud-status-text';
statusText.style.cssText = 'font-size:13px;color:#ccc;font-family:MinibloxFont,sans-serif;';
statusText.textContent = armorHudDocked ? 'Status: Docked' : 'Status: Floating';
const statusBtn = document.createElement('button');
statusBtn.id = 'armor-hud-status-btn';
statusBtn.textContent = armorHudDocked ? 'Undock' : 'Dock Now';
statusBtn.style.cssText = `background:${guiPrimaryColor};color:white;border:none;border-radius:6px;padding:8px 16px;cursor:pointer;font-family:MinibloxFont,sans-serif;font-size:12px;`;
statusRow.appendChild(statusText);
statusRow.appendChild(statusBtn);
container.appendChild(statusRow);
statusBtn.addEventListener('click', () => {
const btn = document.querySelector('#armor-hud-dock-btn');
if (btn) btn.click();
else showNotification('Turn on Armor HUD first', false);
});
function buildSliderRow(labelText, id, min, max, value, formatFn) {
const row = document.createElement('div');
row.style.cssText = 'margin-bottom:14px;';
const labelRow = document.createElement('div');
labelRow.style.cssText = 'display:flex;justify-content:space-between;align-items:center;margin-bottom:5px;';
const label = document.createElement('span');
label.style.cssText = 'font-size:11px;color:#888;text-transform:uppercase;letter-spacing:0.05em;';
label.textContent = labelText;
const valueEl = document.createElement('span');
valueEl.id = id + '-value';
valueEl.style.cssText = `font-size:12px;color:${guiPrimaryColor};font-weight:600;`;
valueEl.textContent = formatFn(value);
labelRow.appendChild(label);
labelRow.appendChild(valueEl);
row.appendChild(labelRow);
const slider = document.createElement('input');
slider.type = 'range';
slider.id = id;
slider.min = min;
slider.max = max;
slider.value = value;
slider.style.cssText = `width:100%;accent-color:${guiPrimaryColor};`;
row.appendChild(slider);
container.appendChild(row);
return slider;
}
const opacitySlider = buildSliderRow('Icon Opacity', 'armor-hud-opacity-slider', 20, 100, Math.round(armorHudOpacity * 100), v => v + '%');
opacitySlider.addEventListener('input', function() {
armorHudOpacity = this.value / 100;
localStorage.setItem('uv2-armorhud-opacity', armorHudOpacity);
const el = document.querySelector('#armor-hud-opacity-slider-value');
if (el) el.textContent = this.value + '%';
if (armorHudEl) armorHudEl.style.opacity = armorHudOpacity;
});
const bgOpacitySlider = buildSliderRow('Background Opacity', 'armor-hud-bgopacity-slider', 0, 100, Math.round(armorHudBgOpacity * 100), v => v + '%');
bgOpacitySlider.addEventListener('input', function() {
armorHudBgOpacity = this.value / 100;
localStorage.setItem('uv2-armorhud-bgopacity', armorHudBgOpacity);
const el = document.querySelector('#armor-hud-bgopacity-slider-value');
if (el) el.textContent = this.value + '%';
if (armorHudDocked) armorHudRender();
});
const sizeSlider = buildSliderRow('Icon Size', 'armor-hud-size-slider', 0, 64, armorHudIconSize, v => v == 0 ? 'Auto' : v + 'px');
sizeSlider.addEventListener('input', function() {
armorHudIconSize = parseInt(this.value, 10);