// ==UserScript== // @name Custom Crosshair🏆🔥💪(Advanced with Hotkey) // @namespace voidrevenant // @version 2.0 // @description Advanced viewport scope layout framework with live UI rendering controls and a menu hide hotkey. good luck heheh😎 // @author voidrevenant // @match *://kour.io/* // @run-at document-end // @grant none // ==/UserScript== (function() { 'use strict'; // Global configuration object tracking custom user properties const _cfg = { visible: true, menuOpen: false, uiVisible: true, // Tracks whether the menu button itself is hidden or shown size: 440, color: '#00ff77', opacity: 1.0, animSpeed: 20 // seconds per full rotation }; // Inject CSS keyframes directly into the head for the rotating arc animation const style_sheet = document.createElement('style'); style_sheet.innerHTML = ` @keyframes scope_spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } `; document.head.appendChild(style_sheet); // --- DOM Elements Instantiation --- const scope_el = document.createElement('div'); const ui_wrap = document.createElement('div'); const toggle_btn = document.createElement('button'); const opt_panel = document.createElement('div'); // --- Base Layout Assembly --- scope_el.id = 'scope_overlay_core'; Object.assign(scope_el.style, { position: 'fixed', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', width: `${_cfg.size}px`, height: `${_cfg.size}px`, pointerEvents: 'none', zIndex: '99998', display: 'block', opacity: _cfg.opacity, transition: 'width 0.1s ease, height 0.1s ease' }); // Helper function to render or update the SVG/HTML inside the crosshair ring function renderCrosshairGraphics() { scope_el.innerHTML = `
`; } renderCrosshairGraphics(); // Initial draw ui_wrap.id = 'scope_ui_root'; Object.assign(ui_wrap.style, { position: 'fixed', top: '25px', right: '25px', zIndex: '99999', fontFamily: 'monospace', display: 'block' // Controlled by the hotkey }); toggle_btn.innerText = '[📌Crosshair MENU]'; Object.assign(toggle_btn.style, { padding: '8px 12px', backgroundColor: '#0a0a0a', color: _cfg.color, border: `1px solid ${_cfg.color}`, borderRadius: '4px', cursor: 'pointer', fontSize: '12px', fontWeight: 'bold', letterSpacing: '1px' }); opt_panel.id = 'scope_control_card'; Object.assign(opt_panel.style, { display: 'none', marginTop: '6px', width: '210px', backgroundColor: 'rgba(10, 10, 10, 0.95)', border: `1px solid ${_cfg.color}66`, padding: '12px', color: '#fff', fontSize: '11px', borderRadius: '4px' }); // Populate control menu layout panel elements opt_panel.innerHTML = `
RENDER SCOPE
SCOPE SIZE${_cfg.size}px
OPACITY100%
RETICLE COLOR
Press 'H' to completely hide menu
`; // --- Core Logic & Event Bindings --- toggle_btn.onclick = () => { _cfg.menuOpen = !_cfg.menuOpen; opt_panel.style.display = _cfg.menuOpen ? 'block' : 'none'; }; toggle_btn.onmouseover = () => { toggle_btn.style.backgroundColor = '#151515'; }; toggle_btn.onmouseout = () => { toggle_btn.style.backgroundColor = '#0a0a0a'; }; // --- Initialization Deferred Injection --- document.body.appendChild(scope_el); ui_wrap.appendChild(toggle_btn); ui_wrap.appendChild(opt_panel); document.body.appendChild(ui_wrap); // --- Live DOM Listeners for Real-time Modifying --- // Toggle scope canvas execution document.getElementById('chk_render').onchange = (e) => { _cfg.visible = e.target.checked; scope_el.style.display = _cfg.visible ? 'block' : 'none'; }; // Live resizing slider execution document.getElementById('sld_size').oninput = (e) => { _cfg.size = e.target.value; document.getElementById('lbl_size').innerText = `${_cfg.size}px`; scope_el.style.width = `${_cfg.size}px`; scope_el.style.height = `${_cfg.size}px`; }; // Live opacity transparency level execution document.getElementById('sld_opacity').oninput = (e) => { _cfg.opacity = e.target.value / 100; document.getElementById('lbl_opacity').innerText = `${e.target.value}%`; scope_el.style.opacity = _cfg.opacity; }; // Live color picker theme palette updating execution document.getElementById('clr_theme').oninput = (e) => { _cfg.color = e.target.value; // Sync the main menu configuration elements to match the newly selected color toggle_btn.style.color = _cfg.color; toggle_btn.style.border = `1px solid ${_cfg.color}`; opt_panel.style.border = `1px solid ${_cfg.color}66`; document.getElementById('chk_render').style.accentColor = _cfg.color; document.getElementById('sld_size').style.accentColor = _cfg.color; document.getElementById('sld_opacity').style.accentColor = _cfg.color; // Force a graphic rerender of the central UI scope elements using the fresh hex colors renderCrosshairGraphics(); }; // --- Menu Toggle Hotkey Event Listener --- window.addEventListener('keydown', (event) => { // Checks if the key pressed is 'h' or 'H' if (event.key.toLowerCase() === 'h') { _cfg.uiVisible = !_cfg.uiVisible; ui_wrap.style.display = _cfg.uiVisible ? 'block' : 'none'; } }); })();