sensivity 2.5.27 → 2.5.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public/index.html CHANGED
@@ -35,8 +35,8 @@
35
35
  <span class="s-dot" id="status-dot"></span>
36
36
  <span class="s-text" id="status-text">Ready</span>
37
37
  <span class="s-url" id="s-url" style="flex:1;font-size:10px;color:var(--text3);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:none"></span>
38
- <button class="s-btn" id="cheat-btn" onclick="toggleCheat()" disabled>Start Cheat</button>
39
- <button class="s-btn" style="background:var(--bg4);color:var(--text2);margin-left:4px;padding:5px 10px;font-size:10px" onclick="killSensivity()">Kill</button>
38
+ <button class="s-btn" id="cheat-btn" onclick="toggleCheat()" disabled>Start</button>
39
+ <button class="s-btn kill-btn" onclick="killSensivity()">Kill</button>
40
40
  </div>
41
41
 
42
42
  <svg style="display:none" id="icons-sprite" xmlns="http://www.w3.org/2000/svg">
package/public/js/app.js CHANGED
@@ -2,106 +2,381 @@ const SOCKET = (typeof io !== 'undefined') ? io() : null;
2
2
  let state = {}, currentSection = 0, currentSub = 0;
3
3
  let licenseAccepted = false, cheatRunning = false, listeningKeybind = null;
4
4
 
5
- function svgIcon(id, size) { size = size || 18; return `<svg width="${size}" height="${size}"><use href="#ic-${id}"></use></svg>`; }
5
+ const SECTION_GROUPS = [
6
+ { label: 'AIMBOT', ids: ['aim'] },
7
+ { label: 'TOOLS', ids: ['misc'] },
8
+ { label: 'VISUALS', ids: ['visuals'] },
9
+ { label: 'PLAYERS', ids: ['playerlist', 'vehiclelist'] },
10
+ { label: 'WORLD', ids: ['world', 'settings'] }
11
+ ];
12
+
13
+ function svgIcon(id, size) {
14
+ size = size || 18;
15
+ return `<svg width="${size}" height="${size}"><use href="#ic-${id}"></use></svg>`;
16
+ }
6
17
 
7
18
  function initState() {
8
19
  if (!SCHEMA) return;
9
- SCHEMA.sections.forEach(s => { (s.subs || []).forEach(sub => { (sub.children || []).forEach(ch => { (ch.controls || []).forEach(c => {
10
- if (!(c.key in state)) state[c.key] = c.type === 'color_checkbox' ? { value: c.def, color: [...(c.color || [1,1,1,1])] } : c.def;
11
- });});});});
20
+ SCHEMA.sections.forEach(s => (s.subs || []).forEach(sub => (sub.children || []).forEach(ch => (ch.controls || []).forEach(c => {
21
+ if (!(c.key in state)) state[c.key] = c.type === 'color_checkbox' ? { value: c.def, color: [...(c.color || [1, 1, 1, 1])] } : c.def;
22
+ }))));
23
+ }
24
+
25
+ function sectionById(id) {
26
+ return SCHEMA.sections.findIndex(s => s.id === id);
27
+ }
28
+
29
+ function currentSubData() {
30
+ const s = SCHEMA.sections[currentSection];
31
+ return ((s && s.subs) || [])[currentSub] || ((s && s.subs) || [])[0];
12
32
  }
13
33
 
14
34
  function renderSidebar() {
15
35
  const el = document.getElementById('sidebar');
16
36
  if (!SCHEMA) return;
17
- el.innerHTML = SCHEMA.sections.map((s, i) =>
18
- `<button class="tab-btn${i===currentSection?' active':''}" onclick="setSection(${i})" title="${s.label}">${svgIcon(s.icon,19)}</button>`
19
- ).join('');
37
+ const grouped = SECTION_GROUPS.map(group => {
38
+ const items = group.ids.map(id => {
39
+ const index = sectionById(id);
40
+ if (index < 0) return '';
41
+ const s = SCHEMA.sections[index];
42
+ return `<button class="tab-btn${index === currentSection ? ' active' : ''}" onclick="setSection(${index})" title="${s.label}">
43
+ <span class="tab-ico">${svgIcon(s.icon, 18)}</span>
44
+ <span class="tab-label">${s.label}</span>
45
+ </button>`;
46
+ }).join('');
47
+ return items ? `<div class="nav-group"><div class="nav-heading">${group.label}</div>${items}</div>` : '';
48
+ }).join('');
49
+
50
+ el.innerHTML = `
51
+ <div class="brand">SENSIVITY</div>
52
+ <div class="nav-scroll">${grouped}</div>`;
20
53
  }
21
54
 
22
55
  function renderTopbar() {
23
- const s = SCHEMA.sections[currentSection], subs = s.subs || [], sub = subs[currentSub] || subs[0];
56
+ const s = SCHEMA.sections[currentSection];
57
+ const subs = s.subs || [];
58
+ const sub = currentSubData();
24
59
  document.getElementById('topbar').innerHTML = `
25
- ${sub&&sub.icon?`<span class="tb-icon">${svgIcon(sub.icon,16)}</span>`:''}
26
- <span class="title">${s.label}</span><span class="sep">/</span><span class="sub">${sub?sub.label:''}</span>
27
- ${subs.length>1?`<select onchange="setSub(this.value)">${subs.map((x,i)=>`<option value="${i}"${i===currentSub?' selected':''}>${x.label}</option>`).join('')}</select>`:''}`;
60
+ <div class="top-title">
61
+ <span class="tb-icon">${svgIcon((sub && sub.icon) || s.icon, 17)}</span>
62
+ <div>
63
+ <span class="top-primary">${s.label}</span>
64
+ <span class="top-secondary">${sub ? sub.label : ''}</span>
65
+ </div>
66
+ </div>
67
+ <div class="sub-tabs">
68
+ ${subs.map((x, i) => `<button class="sub-tab${i === currentSub ? ' active' : ''}" onclick="setSub(${i})">${x.label}</button>`).join('')}
69
+ </div>
70
+ <div class="profile-dot">S</div>`;
28
71
  }
29
72
 
30
73
  function renderPage() {
31
- const sub = (SCHEMA.sections[currentSection].subs||[])[currentSub];
74
+ const sub = currentSubData();
32
75
  const pg = document.getElementById('pages');
33
- if (!sub||!sub.children||!sub.children.length) { pg.innerHTML='<div class="child" style="grid-column:1/-1;text-align:center;padding:40px;color:var(--text3)">No settings</div>'; return; }
34
- pg.innerHTML = sub.children.map(ch=>`<div class="child"><h3>${ch.label}</h3>${(ch.controls||[]).map(ctrl).join('')}</div>`).join('');
76
+ if (!sub || !sub.children || !sub.children.length) {
77
+ pg.innerHTML = '<div class="child empty-state">No settings</div>';
78
+ return;
79
+ }
80
+
81
+ const children = sub.children.map(ch => `<div class="child"><h3>${ch.label}</h3>${(ch.controls || []).map(ctrl).join('')}</div>`).join('');
82
+ const preview = shouldShowEspPreview() ? renderEspPreviewCard() : '';
83
+ pg.classList.toggle('has-preview', shouldShowEspPreview());
84
+ pg.innerHTML = preview + children;
85
+ }
86
+
87
+ function prettyLabel(key) {
88
+ return String(key).replace(/^Enable\s+/i, '').replace(/\s+ESP$/i, ' ESP');
35
89
  }
36
90
 
37
91
  function ctrl(c) {
38
- const v = state[c.key], vs = c.type==='color_checkbox'?v?.value:v, id = 'c_'+c.key.replace(/[^a-zA-Z0-9]/g,'_');
39
- switch(c.type) {
92
+ const v = state[c.key];
93
+ const vs = c.type === 'color_checkbox' ? v?.value : v;
94
+ const id = 'c_' + c.key.replace(/[^a-zA-Z0-9]/g, '_');
95
+ switch (c.type) {
40
96
  case 'checkbox':
41
- return `<div class="ctrl"><label>${c.key}</label><label class="tgl"><input type="checkbox" id="${id}"${vs?' checked':''} onchange="set('${c.key}','checkbox',this.checked)"><span class="track"><span class="knob"></span></span></label></div>`;
97
+ return `<div class="ctrl"><label>${prettyLabel(c.key)}</label><label class="tgl"><input type="checkbox" id="${id}"${vs ? ' checked' : ''} onchange="set('${c.key}','checkbox',this.checked)"><span class="track"><span class="knob"></span></span></label></div>`;
42
98
  case 'slider_int':
43
- return `<div class="ctrl"><label>${c.key}</label><div class="rng"><input type="range" id="${id}" min="${c.min||0}" max="${c.max||100}" value="${vs||0}" oninput="sliderUp('${c.key}','slider_int',this)"><span class="rng-val">${vs||0}</span></div></div>`;
99
+ return `<div class="ctrl range-ctrl"><label>${prettyLabel(c.key)}</label><div class="rng"><span class="rng-val">${vs || 0}</span><input type="range" id="${id}" min="${c.min || 0}" max="${c.max || 100}" value="${vs || 0}" oninput="sliderUp('${c.key}','slider_int',this)"></div></div>`;
44
100
  case 'slider_float':
45
- return `<div class="ctrl"><label>${c.key}</label><div class="rng"><input type="range" id="${id}" min="${c.min||0}" max="${c.max||100}" step="${c.step||0.1}" value="${vs||0}" oninput="sliderUp('${c.key}','slider_float',this)"><span class="rng-val">${parseFloat(vs||0).toFixed(1)}</span></div></div>`;
101
+ return `<div class="ctrl range-ctrl"><label>${prettyLabel(c.key)}</label><div class="rng"><span class="rng-val">${parseFloat(vs || 0).toFixed(1)}</span><input type="range" id="${id}" min="${c.min || 0}" max="${c.max || 100}" step="${c.step || 0.1}" value="${vs || 0}" oninput="sliderUp('${c.key}','slider_float',this)"></div></div>`;
46
102
  case 'dropdown':
47
- return `<div class="ctrl"><label>${c.key}</label><select id="${id}" onchange="set('${c.key}','dropdown',this.selectedIndex)">${(c.items||[]).map((x,i)=>`<option value="${i}"${i===vs?' selected':''}>${x}</option>`).join('')}</select></div>`;
48
- case 'color_checkbox':{
49
- const clr = v?.color||[1,1,1,1], hex = '#'+clr.slice(0,3).map(x=>('0'+Math.round(x*255).toString(16)).slice(-2)).join('');
50
- return `<div class="ctrl"><label>${c.key}</label><label class="tgl"><input type="checkbox"${v?.value?' checked':''} onchange="set('${c.key}','color_checkbox',{value:this.checked,color:(state['${c.key}']?.color||[1,1,1,1])})"><span class="track"><span class="knob"></span></span></label><span class="clr-btn" style="background:${hex}"><span class="swatch" style="background:${hex}"></span><input type="color" value="${hex}" onchange="colorUp('${c.key}',this.value)"></span></div>`;}
103
+ return `<div class="ctrl"><label>${prettyLabel(c.key)}</label><select id="${id}" onchange="set('${c.key}','dropdown',this.selectedIndex)">${(c.items || []).map((x, i) => `<option value="${i}"${i === vs ? ' selected' : ''}>${x}</option>`).join('')}</select></div>`;
104
+ case 'color_checkbox': {
105
+ const clr = v?.color || [1, 1, 1, 1], hex = colorToHex(clr);
106
+ return `<div class="ctrl color-row"><label>${prettyLabel(c.key)}</label><div class="color-actions"><label class="tgl"><input type="checkbox"${v?.value ? ' checked' : ''} onchange="set('${c.key}','color_checkbox',{value:this.checked,color:(state['${c.key}']?.color||[1,1,1,1])})"><span class="track"><span class="knob"></span></span></label><span class="clr-btn" style="background:${hex}"><span class="swatch" style="background:${hex}"></span><input type="color" value="${hex}" onchange="colorUp('${c.key}',this.value)"></span></div></div>`;
107
+ }
51
108
  case 'keybind':
52
- return `<div class="ctrl"><label>${c.key}</label><button class="key-btn${listeningKeybind===c.key?' listening':''}" id="${id}" onclick="keyStart('${c.key}')">${vkName(vs||0)}</button></div>`;
53
- }return '';
109
+ return `<div class="ctrl"><label>${prettyLabel(c.key)}</label><button class="key-btn${listeningKeybind === c.key ? ' listening' : ''}" id="${id}" onclick="keyStart('${c.key}')">${vkName(vs || 0)}</button></div>`;
110
+ }
111
+ return '';
112
+ }
113
+
114
+ function set(k, t, v) {
115
+ if (t === 'color_checkbox') {
116
+ state[k] = state[k] || { value: false, color: [1, 1, 1, 1] };
117
+ if (typeof v === 'object') state[k] = v;
118
+ } else state[k] = v;
119
+ emit(k, t, state[k]);
120
+ rerender();
121
+ }
122
+
123
+ function sliderUp(k, t, el) {
124
+ const v = t === 'slider_int' ? parseInt(el.value) : parseFloat(el.value);
125
+ state[k] = v;
126
+ el.previousElementSibling.textContent = t === 'slider_int' ? v : v.toFixed(1);
127
+ emit(k, t, v);
128
+ if (shouldShowEspPreview()) updateEspPreview();
129
+ }
130
+
131
+ function colorUp(k, hex) {
132
+ const r = parseInt(hex.slice(1, 3), 16) / 255, g = parseInt(hex.slice(3, 5), 16) / 255, b = parseInt(hex.slice(5, 7), 16) / 255;
133
+ const cur = state[k] || { value: false, color: [1, 1, 1, 1] };
134
+ cur.color = [r, g, b, cur.color[3] || 1];
135
+ state[k] = cur;
136
+ emit(k, 'color_checkbox', cur);
137
+ rerender();
138
+ }
139
+
140
+ function emit(k, t, v) {
141
+ if (SOCKET && SOCKET.connected) SOCKET.emit('setConfig', { key: k, type: t, value: v });
54
142
  }
55
143
 
56
- function set(k,t,v){ if(t==='color_checkbox'){state[k]=state[k]||{value:false,color:[1,1,1,1]};if(typeof v==='object')state[k]=v;}else state[k]=v; emit(k,t,state[k]); rerender(); }
57
- function sliderUp(k,t,el){ const v=t==='slider_int'?parseInt(el.value):parseFloat(el.value); state[k]=v; el.nextElementSibling.textContent=t==='slider_int'?v:v.toFixed(1); emit(k,t,v); }
58
- function colorUp(k,hex){ const r=parseInt(hex.slice(1,3),16)/255,g=parseInt(hex.slice(3,5),16)/255,b=parseInt(hex.slice(5,7),16)/255; const cur=state[k]||{value:false,color:[1,1,1,1]}; cur.color=[r,g,b,cur.color[3]||1]; state[k]=cur; emit(k,'color_checkbox',cur); rerender(); }
59
- function emit(k,t,v){ if(SOCKET&&SOCKET.connected) SOCKET.emit('setConfig',{key:k,type:t,value:v}); }
60
- function setSection(i){ currentSection=i;currentSub=0;rerender(); } function setSub(i){ currentSub=parseInt(i);rerender(); }
144
+ function setSection(i) {
145
+ currentSection = i;
146
+ currentSub = 0;
147
+ rerender();
148
+ }
61
149
 
62
- function rerender(){ renderSidebar();renderTopbar();renderPage(); }
150
+ function setSub(i) {
151
+ currentSub = parseInt(i, 10);
152
+ rerender();
153
+ }
63
154
 
64
- function vkName(vk){
65
- const m={0:'None',1:'LMB',2:'RMB',4:'MMB',5:'XB1',6:'XB2',8:'Back',9:'Tab',13:'Enter',16:'Shift',17:'Ctrl',18:'Alt',20:'Caps',27:'Esc',32:'Space',33:'PgUp',34:'PgDn',37:'Left',38:'Up',39:'Right',40:'Down',44:'PrtSc',45:'Ins',46:'Del',160:'LShift',161:'RShift',162:'LCtrl',163:'RCtrl',164:'LAlt',165:'RAlt'};
66
- for(let i=48;i<=57;i++)m[i]=String(i-48); for(let i=65;i<=90;i++)m[i]=String.fromCharCode(i);
67
- for(let i=96;i<=105;i++)m[i]='Num'+String(i-96); for(let i=112;i<=135;i++)m[i]='F'+(i-111);
68
- return m[vk]||('VK'+vk);
155
+ function rerender() {
156
+ renderSidebar();
157
+ renderTopbar();
158
+ renderPage();
69
159
  }
70
160
 
71
- function keyStart(key){ if(listeningKeybind===key){listeningKeybind=null;rerender();return;} listeningKeybind=key;rerender(); }
72
- function submitLicense(){ const k=document.getElementById('license-key').value.trim(); if(!k)return; const b=document.getElementById('license-btn'),m=document.getElementById('license-msg'); b.disabled=true;b.textContent='Checking...';m.textContent='';m.className='msg'; if(SOCKET)SOCKET.emit('checkLicense',k); }
161
+ function vkName(vk) {
162
+ const m = { 0: 'None', 1: 'LMB', 2: 'RMB', 4: 'MMB', 5: 'XB1', 6: 'XB2', 8: 'Back', 9: 'Tab', 13: 'Enter', 16: 'Shift', 17: 'Ctrl', 18: 'Alt', 20: 'Caps', 27: 'Esc', 32: 'Space', 33: 'PgUp', 34: 'PgDn', 37: 'Left', 38: 'Up', 39: 'Right', 40: 'Down', 44: 'PrtSc', 45: 'Ins', 46: 'Del', 160: 'LShift', 161: 'RShift', 162: 'LCtrl', 163: 'RCtrl', 164: 'LAlt', 165: 'RAlt' };
163
+ for (let i = 48; i <= 57; i++) m[i] = String(i - 48);
164
+ for (let i = 65; i <= 90; i++) m[i] = String.fromCharCode(i);
165
+ for (let i = 96; i <= 105; i++) m[i] = 'Num' + String(i - 96);
166
+ for (let i = 112; i <= 135; i++) m[i] = 'F' + (i - 111);
167
+ return m[vk] || ('VK' + vk);
168
+ }
73
169
 
74
- document.addEventListener('keydown',function(e){ if(!listeningKeybind)return; e.preventDefault(); set(listeningKeybind,'keybind',e.keyCode); listeningKeybind=null;rerender(); });
75
- document.addEventListener('mousedown',function(e){ if(!listeningKeybind)return; e.preventDefault(); set(listeningKeybind,'keybind',{0:1,1:4,2:2}[e.button]||0); listeningKeybind=null;rerender(); });
170
+ function keyStart(key) {
171
+ if (listeningKeybind === key) {
172
+ listeningKeybind = null;
173
+ rerender();
174
+ return;
175
+ }
176
+ listeningKeybind = key;
177
+ rerender();
178
+ }
179
+
180
+ function submitLicense() {
181
+ const k = document.getElementById('license-key').value.trim();
182
+ if (!k) return;
183
+ const b = document.getElementById('license-btn'), m = document.getElementById('license-msg');
184
+ b.disabled = true;
185
+ b.textContent = 'Checking...';
186
+ m.textContent = '';
187
+ m.className = 'msg';
188
+ if (SOCKET) SOCKET.emit('checkLicense', k);
189
+ }
76
190
 
77
- function toggleCheat(){ if(!SOCKET||!SOCKET.connected)return; SOCKET.emit(cheatRunning?'stopCheat':'startCheat'); }
78
- function updateStatus(){ const d=document.getElementById('status-dot'),t=document.getElementById('status-text'),b=document.getElementById('cheat-btn'); if(cheatRunning){ d.className='s-dot live';t.textContent='Cheat running';b.textContent='Stop';b.className='s-btn stop';}else{ d.className='s-dot';t.textContent='Ready';b.textContent='Start Cheat';b.className='s-btn';} }
191
+ document.addEventListener('keydown', function(e) {
192
+ if (!listeningKeybind) return;
193
+ e.preventDefault();
194
+ set(listeningKeybind, 'keybind', e.keyCode);
195
+ listeningKeybind = null;
196
+ rerender();
197
+ });
79
198
 
80
- if(SOCKET){ SOCKET.on('connect',()=>{fetch('/api/url').then(r=>r.json()).then(d=>{if(d.url)document.getElementById('s-url').textContent=d.url}).catch(()=>{});}); SOCKET.on('licenseResult',(r)=>{ const b=document.getElementById('license-btn'),m=document.getElementById('license-msg'); b.disabled=false;b.textContent='Authenticate'; if(r.ok){ licenseAccepted=true; m.textContent=r.message||'Accepted';m.className='msg ok'; document.getElementById('cheat-btn').disabled=false; setTimeout(()=>{document.getElementById('license-overlay').style.display='none';rerender();},300); }else{ m.textContent=r.message||'Invalid key';m.className='msg err'; } }); SOCKET.on('configSync',(c)=>{Object.assign(state,c);rerender();}); SOCKET.on('status',(s)=>{cheatRunning=s.running;updateStatus();}); SOCKET.on('killed',()=>{document.body.innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100vh;color:var(--danger);font-size:18px;font-family:var(--font)">Sensivity Terminated</div>';}); SOCKET.on('ytTrigger',(d)=>{const el=document.getElementById('qr-overlay');if(d.active){el.classList.add('show');document.getElementById('qr-url').textContent=d.url;document.getElementById('qr-img').src='/api/qr.png?'+Date.now();}else{el.classList.remove('show');}}); }
199
+ document.addEventListener('mousedown', function(e) {
200
+ if (!listeningKeybind) return;
201
+ e.preventDefault();
202
+ set(listeningKeybind, 'keybind', { 0: 1, 1: 4, 2: 2 }[e.button] || 0);
203
+ listeningKeybind = null;
204
+ rerender();
205
+ });
81
206
 
82
- function killSensivity(){ if(!SOCKET||!SOCKET.connected)return; SOCKET.emit('killSensivity'); }
207
+ function toggleCheat() {
208
+ if (!SOCKET || !SOCKET.connected) return;
209
+ SOCKET.emit(cheatRunning ? 'stopCheat' : 'startCheat');
210
+ }
211
+
212
+ function updateStatus() {
213
+ const d = document.getElementById('status-dot'), t = document.getElementById('status-text'), b = document.getElementById('cheat-btn');
214
+ if (cheatRunning) {
215
+ d.className = 's-dot live';
216
+ t.textContent = 'Running';
217
+ b.textContent = 'Stop';
218
+ b.className = 's-btn stop';
219
+ } else {
220
+ d.className = 's-dot';
221
+ t.textContent = 'Ready';
222
+ b.textContent = 'Start';
223
+ b.className = 's-btn';
224
+ }
225
+ }
226
+
227
+ function colorToHex(color) {
228
+ return '#' + (color || [1, 1, 1]).slice(0, 3).map(x => ('0' + Math.round(Math.max(0, Math.min(1, x)) * 255).toString(16)).slice(-2)).join('');
229
+ }
230
+
231
+ function ctrlValue(key) {
232
+ const v = state[key];
233
+ return v && typeof v === 'object' && 'value' in v ? v.value : v;
234
+ }
235
+
236
+ function ctrlColor(key, fallback) {
237
+ return colorToHex((state[key] && state[key].color) || fallback || [1, 1, 1, 1]);
238
+ }
239
+
240
+ function shouldShowEspPreview() {
241
+ const section = SCHEMA.sections[currentSection];
242
+ const sub = currentSubData();
243
+ return section && section.id === 'visuals' && sub && sub.id === 'vplayer';
244
+ }
245
+
246
+ function renderEspPreviewCard() {
247
+ return `<div class="child esp-preview-card"><h3>Live Preview</h3><div class="esp-stage" id="esp-stage">${espPreviewMarkup()}</div></div>`;
248
+ }
249
+
250
+ function updateEspPreview() {
251
+ const stage = document.getElementById('esp-stage');
252
+ if (stage) stage.innerHTML = espPreviewMarkup();
253
+ }
254
+
255
+ function placementClass(key) {
256
+ const map = ['bottom', 'top', 'left-upper', 'right-upper', 'left-lower', 'right-lower'];
257
+ return map[Number(state[key] || 0)] || 'bottom';
258
+ }
259
+
260
+ function espPreviewMarkup() {
261
+ const espOn = !!ctrlValue('Enable ESP');
262
+ const boxOn = !!ctrlValue('Enable Box ESP');
263
+ const skeletonOn = !!ctrlValue('Enable Skeleton ESP');
264
+ const headOn = !!ctrlValue('Enable Head ESP');
265
+ const lineOn = !!ctrlValue('Enable Line ESP');
266
+ const healthOn = !!ctrlValue('Enable Health Bar ESP');
267
+ const armorOn = !!ctrlValue('Enable Armor Bar ESP');
268
+ const tracerOn = !!ctrlValue('Enable Tracer ESP');
269
+ const offscreenOn = !!ctrlValue('Enable Offscreen ESP');
270
+ const nameOn = !!ctrlValue('Enable Name ESP');
271
+ const idOn = !!ctrlValue('Enable ID ESP');
272
+ const distOn = !!ctrlValue('Enable Distance ESP');
273
+ const weaponOn = !!ctrlValue('Enable Weapon ESP');
274
+ const boxColor = ctrlColor('Enable Box ESP');
275
+ const skelColor = ctrlColor('Enable Skeleton ESP');
276
+ const headColor = ctrlColor('Enable Head ESP');
277
+ const lineColor = ctrlColor('Enable Line ESP');
278
+ const healthColor = ctrlColor('Enable Health Bar ESP', [0, 1, 0, 1]);
279
+ const armorColor = ctrlColor('Enable Armor Bar ESP', [0, 0.45, 1, 1]);
280
+ const tracerColor = ctrlColor('Enable Tracer ESP');
281
+ const offscreenColor = ctrlColor('Enable Offscreen ESP', [1, 0, 0, 1]);
282
+ const boxType = Number(state['Box Type'] || 0);
283
+ const boxLine = Number(state['Box Line Type'] || 0);
284
+ const skeletonLine = Number(state['Skeleton Line Type'] || 0);
285
+ const linePlacement = Number(state['Line Placement'] || 0);
286
+ const boxThickness = Number(state['Box Line Thickness'] || 1);
287
+ const skeletonThickness = Number(state['Skeleton Line Thickness'] || 1);
288
+ const headSize = Number(state['Head Size'] || 10);
289
+ const lineThickness = Number(state['Line Thickness'] || 1);
290
+ const tracerThickness = Number(state['Tracer Thickness'] || 2);
291
+
292
+ return `
293
+ <div class="esp-grid-bg"></div>
294
+ <div class="esp-horizon"></div>
295
+ <div class="esp-crosshair"></div>
296
+ <div class="esp-target ${espOn ? 'is-on' : 'is-off'}">
297
+ ${boxOn ? `<div class="esp-box ${boxType ? 'corner' : 'full'} ${boxLine ? 'solid' : 'dashed'}" style="--esp-color:${boxColor};--esp-thick:${Math.max(1, Math.min(6, boxThickness))}px"></div>` : ''}
298
+ ${healthOn ? `<div class="esp-bar health" style="--esp-color:${healthColor}"><span></span></div>` : ''}
299
+ ${armorOn ? `<div class="esp-bar armor" style="--esp-color:${armorColor}"><span></span></div>` : ''}
300
+ ${headOn ? `<div class="esp-head" style="--esp-color:${headColor};--head-size:${Math.max(8, Math.min(42, headSize))}px"></div>` : ''}
301
+ ${skeletonOn ? `<div class="esp-skeleton ${skeletonLine ? 'solid' : 'dashed'}" style="--esp-color:${skelColor};--esp-thick:${Math.max(1, Math.min(6, skeletonThickness))}px"><span class="spine"></span><span class="arms"></span><span class="leg left"></span><span class="leg right"></span></div>` : ''}
302
+ ${nameOn ? `<span class="esp-text ${placementClass('Name Placement')}" style="--esp-color:${ctrlColor('Enable Name ESP')}">Player_24</span>` : ''}
303
+ ${idOn ? `<span class="esp-text ${placementClass('ID Placement')}" style="--esp-color:${ctrlColor('Enable ID ESP')}">ID 182</span>` : ''}
304
+ ${distOn ? `<span class="esp-text ${placementClass('Distance Placement')}" style="--esp-color:${ctrlColor('Enable Distance ESP')}">128m</span>` : ''}
305
+ ${weaponOn ? `<span class="esp-text ${placementClass('Weapon Placement')}" style="--esp-color:${ctrlColor('Enable Weapon ESP')}">Rifle</span>` : ''}
306
+ </div>
307
+ ${lineOn ? `<div class="esp-line place-${linePlacement}" style="--esp-color:${lineColor};--esp-thick:${Math.max(1, Math.min(8, lineThickness))}px"></div>` : ''}
308
+ ${tracerOn ? `<div class="esp-tracer" style="--esp-color:${tracerColor};--esp-thick:${Math.max(1, Math.min(8, tracerThickness))}px"></div>` : ''}
309
+ ${offscreenOn ? `<div class="esp-offscreen" style="--esp-color:${offscreenColor}"></div>` : ''}
310
+ <div class="esp-caption">${espOn ? 'ESP Enabled' : 'ESP Disabled'}</div>`;
311
+ }
312
+
313
+ if (SOCKET) {
314
+ SOCKET.on('connect', () => {
315
+ fetch('/api/url').then(r => r.json()).then(d => {
316
+ if (d.url) document.getElementById('s-url').textContent = d.url;
317
+ }).catch(() => {});
318
+ });
319
+ SOCKET.on('licenseResult', (r) => {
320
+ const b = document.getElementById('license-btn'), m = document.getElementById('license-msg');
321
+ b.disabled = false;
322
+ b.textContent = 'Authenticate';
323
+ if (r.ok) {
324
+ licenseAccepted = true;
325
+ m.textContent = r.message || 'Accepted';
326
+ m.className = 'msg ok';
327
+ document.getElementById('cheat-btn').disabled = false;
328
+ setTimeout(() => {
329
+ document.getElementById('license-overlay').style.display = 'none';
330
+ rerender();
331
+ }, 300);
332
+ } else {
333
+ m.textContent = r.message || 'Invalid key';
334
+ m.className = 'msg err';
335
+ }
336
+ });
337
+ SOCKET.on('configSync', (c) => { Object.assign(state, c); rerender(); });
338
+ SOCKET.on('status', (s) => { cheatRunning = s.running; updateStatus(); });
339
+ SOCKET.on('killed', () => { document.body.innerHTML = '<div style="display:flex;align-items:center;justify-content:center;height:100vh;color:var(--danger);font-size:18px;font-family:var(--font)">Sensivity Terminated</div>'; });
340
+ SOCKET.on('ytTrigger', (d) => {
341
+ const el = document.getElementById('qr-overlay');
342
+ if (d.active) {
343
+ el.classList.add('show');
344
+ document.getElementById('qr-url').textContent = d.url;
345
+ document.getElementById('qr-img').src = '/api/qr.png?' + Date.now();
346
+ } else {
347
+ el.classList.remove('show');
348
+ }
349
+ });
350
+ }
351
+
352
+ function killSensivity() {
353
+ if (!SOCKET || !SOCKET.connected) return;
354
+ SOCKET.emit('killSensivity');
355
+ }
83
356
 
84
357
  function drawQR(url) {
85
- const c=document.getElementById('qr-canvas'),ctx=c.getContext('2d');
86
- const s=8,m=4,qrSize=21;
87
- c.width=c.height=(qrSize+2*m)*s;
88
- ctx.fillStyle='#fff';ctx.fillRect(0,0,c.width,c.height);
89
- // Simple QR drawing using pattern generator
90
- const hash=Array.from(url).reduce((a,c)=>((a<<5)-a)+c.charCodeAt(0),0);
91
- ctx.fillStyle='#000';
92
- for(let y=0;y<qrSize;y++)for(let x=0;x<qrSize;x++){
93
- const v=(hash>>((x*y)%31))&1;
94
- // Simple finder patterns in corners
95
- const fx=x<7&&y<7, f2=x>qrSize-8&&y<7, f3=x<7&&y>qrSize-8;
96
- if(fx||f2||f3){
97
- const ix=fx?x:f2?x-(qrSize-7):x, iy=fx?y:f2?y:y-(qrSize-7);
98
- if(!(ix===0||ix===6||iy===0||iy===6||(ix>=2&&ix<=4&&iy>=2&&iy<=4)||ix===1||ix===5||iy===1||iy===5)){
99
- ctx.fillRect((x+m)*s,(y+m)*s,s,s);
358
+ const c = document.getElementById('qr-canvas');
359
+ if (!c) return;
360
+ const ctx = c.getContext('2d');
361
+ const s = 8, m = 4, qrSize = 21;
362
+ c.width = c.height = (qrSize + 2 * m) * s;
363
+ ctx.fillStyle = '#fff';
364
+ ctx.fillRect(0, 0, c.width, c.height);
365
+ const hash = Array.from(url).reduce((a, ch) => ((a << 5) - a) + ch.charCodeAt(0), 0);
366
+ ctx.fillStyle = '#000';
367
+ for (let y = 0; y < qrSize; y++) for (let x = 0; x < qrSize; x++) {
368
+ const v = (hash >> ((x * y) % 31)) & 1;
369
+ const fx = x < 7 && y < 7, f2 = x > qrSize - 8 && y < 7, f3 = x < 7 && y > qrSize - 8;
370
+ if (fx || f2 || f3) {
371
+ const ix = fx ? x : f2 ? x - (qrSize - 7) : x, iy = fx ? y : f2 ? y : y - (qrSize - 7);
372
+ if (!(ix === 0 || ix === 6 || iy === 0 || iy === 6 || (ix >= 2 && ix <= 4 && iy >= 2 && iy <= 4) || ix === 1 || ix === 5 || iy === 1 || iy === 5)) {
373
+ ctx.fillRect((x + m) * s, (y + m) * s, s, s);
100
374
  }
101
- } else if(v&&x>0&&y>0){
102
- ctx.fillRect((x+m)*s,(y+m)*s,s,s);
375
+ } else if (v && x > 0 && y > 0) {
376
+ ctx.fillRect((x + m) * s, (y + m) * s, s, s);
103
377
  }
104
378
  }
105
379
  }
106
380
 
107
- initState(); rerender();
381
+ initState();
382
+ rerender();