Deadshot.io Ventionware V2.6

Adds a customizable crosshair to deadshot.io with a stylish menu for color, opacity, and shape customization. Includes custom crosshair upload and size adjustment.

  1. // ==UserScript==
  2. // @name Deadshot.io Ventionware V2.6
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.6
  5. // @description Adds a customizable crosshair to deadshot.io with a stylish menu for color, opacity, and shape customization. Includes custom crosshair upload and size adjustment.
  6. // @author TheModDownloader
  7. // @icon https://deadshot.io/favicon.png
  8. // @license GNU GPLv3
  9. // @match *://deadshot.io/*
  10. // @grant GM_xmlhttpRequest
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Current script version
  17. const currentVersion = '2.6';
  18.  
  19. // URL to check for the latest version
  20. const versionCheckURL = 'https://file.garden/ZgfK0UDRARPwyXVE/versionVentionWare.txt';
  21.  
  22. // URL to redirect users if the script is outdated
  23. const updateURL = 'https://gf.qytechs.cn/en/scripts/524040-deadshot-io-ventionware-v2-6'; // Replace with your actual URL
  24.  
  25. // Create a container for all custom elements
  26. const customContainer = document.createElement('div');
  27. customContainer.style.position = 'fixed';
  28. customContainer.style.top = '0';
  29. customContainer.style.left = '0';
  30. customContainer.style.width = '100%';
  31. customContainer.style.height = '100%';
  32. customContainer.style.pointerEvents = 'none'; // Allow clicks to pass through
  33. customContainer.style.zIndex = '2147483647'; // Maximum z-index value
  34. document.body.appendChild(customContainer);
  35.  
  36. // Create the crosshair element
  37. const crosshair = document.createElement('div');
  38. crosshair.style.position = 'absolute';
  39. crosshair.style.top = '50%';
  40. crosshair.style.left = '50%';
  41. crosshair.style.transform = 'translate(-50%, -50%)';
  42. crosshair.style.width = '20px';
  43. crosshair.style.height = '20px';
  44. crosshair.style.border = '2px solid red';
  45. crosshair.style.borderRadius = '50%';
  46. crosshair.style.pointerEvents = 'none';
  47. customContainer.appendChild(crosshair);
  48.  
  49. // Create a container for the buttons and title
  50. const buttonContainer = document.createElement('div');
  51. buttonContainer.style.position = 'fixed';
  52. buttonContainer.style.bottom = '20px';
  53. buttonContainer.style.right = '-200px'; // Start off-screen to the right
  54. buttonContainer.style.display = 'flex';
  55. buttonContainer.style.flexDirection = 'column';
  56. buttonContainer.style.alignItems = 'flex-end';
  57. buttonContainer.style.gap = '10px';
  58. buttonContainer.style.zIndex = '100000';
  59. buttonContainer.style.transition = 'right 0.5s ease-in-out'; // Slide-in transition
  60. customContainer.appendChild(buttonContainer);
  61.  
  62. // Add the title with glow effect
  63. const title = document.createElement('div');
  64. title.textContent = 'VentionWare V2 Version 2.1';
  65. title.style.color = 'white';
  66. title.style.fontFamily = 'Arial, sans-serif';
  67. title.style.fontSize = '14px';
  68. title.style.fontWeight = 'bold';
  69. title.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  70. title.style.padding = '8px 12px';
  71. title.style.borderRadius = '5px';
  72. title.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.3)';
  73. title.style.textShadow = '0 0 10px #00ff00, 0 0 20px #00ff00'; // Glow effect
  74. buttonContainer.appendChild(title);
  75.  
  76. // Function to create a button with hover label
  77. function createButton(icon, color, labelText) {
  78. const button = document.createElement('button');
  79. button.innerHTML = icon;
  80. button.style.backgroundColor = color;
  81. button.style.color = 'white';
  82. button.style.border = 'none';
  83. button.style.borderRadius = '50%';
  84. button.style.width = '50px';
  85. button.style.height = '50px';
  86. button.style.fontSize = '24px';
  87. button.style.cursor = 'pointer';
  88. button.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.2)';
  89. button.style.transition = 'background-color 0.3s, transform 0.3s';
  90. button.style.pointerEvents = 'auto'; // Allow clicks on the button
  91.  
  92. // Create hover label
  93. const label = document.createElement('div');
  94. label.textContent = labelText;
  95. label.style.position = 'absolute';
  96. label.style.right = '60px'; // Position to the left of the button
  97. label.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  98. label.style.color = 'white';
  99. label.style.padding = '5px 10px';
  100. label.style.borderRadius = '5px';
  101. label.style.fontSize = '12px';
  102. label.style.opacity = '0';
  103. label.style.transition = 'opacity 0.3s';
  104. label.style.pointerEvents = 'none'; // Prevent clicks on the label
  105.  
  106. // Add hover effects
  107. button.addEventListener('mouseover', () => {
  108. button.style.transform = 'scale(1.1)';
  109. label.style.opacity = '1';
  110. });
  111. button.addEventListener('mouseout', () => {
  112. button.style.transform = 'scale(1)';
  113. label.style.opacity = '0';
  114. });
  115.  
  116. // Wrap button and label in a container
  117. const container = document.createElement('div');
  118. container.style.position = 'relative';
  119. container.style.display = 'flex';
  120. container.style.alignItems = 'center';
  121. container.appendChild(button);
  122. container.appendChild(label);
  123.  
  124. return { button, container };
  125. }
  126.  
  127. // Create the menu button
  128. const { button: menuButton, container: menuButtonContainer } = createButton('🎯', '#4CAF50', 'Open Menu');
  129. buttonContainer.appendChild(menuButtonContainer);
  130.  
  131. // Create the toggle crosshair button
  132. const { button: toggleButton, container: toggleButtonContainer } = createButton('👁️', '#2196F3', 'Toggle Crosshair');
  133. buttonContainer.appendChild(toggleButtonContainer);
  134.  
  135. // Toggle crosshair visibility
  136. let isCrosshairVisible = true;
  137. toggleButton.addEventListener('click', () => {
  138. isCrosshairVisible = !isCrosshairVisible;
  139. crosshair.style.display = isCrosshairVisible ? 'block' : 'none';
  140. });
  141.  
  142. // Create the kill script button
  143. const { button: killButton, container: killButtonContainer } = createButton('❌', '#F44336', 'Kill Script');
  144. buttonContainer.appendChild(killButtonContainer);
  145.  
  146. // Kill/uninject the script
  147. killButton.addEventListener('click', () => {
  148. document.body.removeChild(customContainer); // Remove all custom elements
  149. });
  150.  
  151. // Create the blur overlay
  152. const blurOverlay = document.createElement('div');
  153. blurOverlay.style.position = 'fixed';
  154. blurOverlay.style.top = '0';
  155. blurOverlay.style.left = '0';
  156. blurOverlay.style.width = '100%';
  157. blurOverlay.style.height = '100%';
  158. blurOverlay.style.backgroundColor = 'rgba(0, 0, 0, 0)'; // Start fully transparent
  159. blurOverlay.style.backdropFilter = 'blur(0px)'; // Start with no blur
  160. blurOverlay.style.display = 'none';
  161. blurOverlay.style.pointerEvents = 'auto'; // Allow clicks on the overlay
  162. blurOverlay.style.transition = 'backdrop-filter 0.3s ease-in-out, background-color 0.3s ease-in-out'; // Smooth transition
  163. customContainer.appendChild(blurOverlay);
  164.  
  165. // Create the color picker menu
  166. const colorMenu = document.createElement('div');
  167. colorMenu.style.position = 'fixed';
  168. colorMenu.style.top = '50%';
  169. colorMenu.style.left = '50%';
  170. colorMenu.style.transform = 'translate(-50%, -50%)';
  171. colorMenu.style.backgroundColor = 'rgba(0, 0, 0, 0)'; // Start fully transparent
  172. colorMenu.style.padding = '20px';
  173. colorMenu.style.borderRadius = '10px';
  174. colorMenu.style.display = 'none';
  175. colorMenu.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.3)';
  176. colorMenu.style.color = 'white';
  177. colorMenu.style.fontFamily = 'Arial, sans-serif';
  178. colorMenu.style.pointerEvents = 'auto'; // Allow clicks on the menu
  179. colorMenu.style.transition = 'background-color 0.3s ease-in-out, opacity 0.3s ease-in-out'; // Smooth transition
  180. customContainer.appendChild(colorMenu);
  181.  
  182. // Function to create a menu item with smooth text transition
  183. function createMenuItem(labelText, inputElement) {
  184. const container = document.createElement('div');
  185. container.style.opacity = '0'; // Start fully transparent
  186. container.style.transition = 'opacity 0.3s ease-in-out'; // Smooth transition
  187.  
  188. const label = document.createElement('label');
  189. label.textContent = labelText;
  190. label.style.display = 'block';
  191. label.style.marginBottom = '10px';
  192. label.style.color = 'white';
  193. label.style.fontFamily = 'Arial, sans-serif';
  194. label.style.fontSize = '14px';
  195. container.appendChild(label);
  196.  
  197. if (inputElement) {
  198. container.appendChild(inputElement);
  199. }
  200.  
  201. return container;
  202. }
  203.  
  204. // Crosshair Color
  205. const colorPickerContainer = document.createElement('div');
  206. colorPickerContainer.style.display = 'flex';
  207. colorPickerContainer.style.alignItems = 'center';
  208. colorPickerContainer.style.gap = '10px';
  209.  
  210. const colorPreview = document.createElement('div');
  211. colorPreview.style.width = '30px';
  212. colorPreview.style.height = '30px';
  213. colorPreview.style.borderRadius = '5px';
  214. colorPreview.style.backgroundColor = '#ff0000'; // Default color
  215. colorPreview.style.border = '2px solid white';
  216. colorPreview.style.cursor = 'pointer';
  217.  
  218. const colorInput = document.createElement('input');
  219. colorInput.type = 'color';
  220. colorInput.value = '#ff0000'; // Default color is red
  221. colorInput.style.opacity = '0';
  222. colorInput.style.position = 'absolute';
  223. colorInput.style.pointerEvents = 'none';
  224. colorInput.addEventListener('input', () => {
  225. crosshair.style.borderColor = colorInput.value;
  226. colorPreview.style.backgroundColor = colorInput.value;
  227. });
  228.  
  229. colorPreview.addEventListener('click', () => {
  230. colorInput.click(); // Trigger the color picker
  231. });
  232.  
  233. colorPickerContainer.appendChild(colorPreview);
  234. colorPickerContainer.appendChild(colorInput);
  235.  
  236. const colorMenuItem = createMenuItem('Crosshair Color: ', colorPickerContainer);
  237. colorMenu.appendChild(colorMenuItem);
  238.  
  239. // Crosshair Opacity
  240. const opacitySliderContainer = document.createElement('div');
  241. opacitySliderContainer.style.width = '100%';
  242. opacitySliderContainer.style.height = '20px';
  243. opacitySliderContainer.style.position = 'relative';
  244. opacitySliderContainer.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  245. opacitySliderContainer.style.borderRadius = '10px';
  246. opacitySliderContainer.style.overflow = 'hidden';
  247.  
  248. const opacitySliderFill = document.createElement('div');
  249. opacitySliderFill.style.position = 'absolute';
  250. opacitySliderFill.style.top = '0';
  251. opacitySliderFill.style.left = '0';
  252. opacitySliderFill.style.height = '100%';
  253. opacitySliderFill.style.width = '100%';
  254. opacitySliderFill.style.backgroundColor = '#2196F3';
  255. opacitySliderFill.style.borderRadius = '10px';
  256. opacitySliderFill.style.transition = 'width 0.2s ease-in-out';
  257.  
  258. const opacitySliderThumb = document.createElement('div');
  259. opacitySliderThumb.style.position = 'absolute';
  260. opacitySliderThumb.style.top = '0';
  261. opacitySliderThumb.style.left = '0';
  262. opacitySliderThumb.style.width = '20px';
  263. opacitySliderThumb.style.height = '20px';
  264. opacitySliderThumb.style.backgroundColor = 'white';
  265. opacitySliderThumb.style.borderRadius = '50%';
  266. opacitySliderThumb.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.3)';
  267. opacitySliderThumb.style.cursor = 'pointer';
  268. opacitySliderThumb.style.transition = 'left 0.2s ease-in-out';
  269.  
  270. opacitySliderContainer.appendChild(opacitySliderFill);
  271. opacitySliderContainer.appendChild(opacitySliderThumb);
  272.  
  273. const opacityInput = document.createElement('input');
  274. opacityInput.type = 'range';
  275. opacityInput.min = '0';
  276. opacityInput.max = '1';
  277. opacityInput.step = '0.1';
  278. opacityInput.value = '1';
  279. opacityInput.style.position = 'absolute';
  280. opacityInput.style.top = '0';
  281. opacityInput.style.left = '0';
  282. opacityInput.style.width = '100%';
  283. opacityInput.style.height = '100%';
  284. opacityInput.style.opacity = '0';
  285. opacityInput.style.cursor = 'pointer';
  286. opacityInput.addEventListener('input', () => {
  287. const value = parseFloat(opacityInput.value);
  288. opacitySliderFill.style.width = `${value * 100}%`;
  289. opacitySliderThumb.style.left = `${value * 100}%`;
  290. crosshair.style.opacity = value;
  291. });
  292. opacitySliderContainer.appendChild(opacityInput);
  293.  
  294. const opacityMenuItem = createMenuItem('Crosshair Opacity: ', opacitySliderContainer);
  295. colorMenu.appendChild(opacityMenuItem);
  296.  
  297. // Crosshair Shape
  298. const shapeSelectContainer = document.createElement('div');
  299. shapeSelectContainer.style.position = 'relative';
  300. shapeSelectContainer.style.width = '100%';
  301.  
  302. const shapeSelect = document.createElement('select');
  303. shapeSelect.style.width = '100%';
  304. shapeSelect.style.padding = '10px';
  305. shapeSelect.style.borderRadius = '5px';
  306. shapeSelect.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  307. shapeSelect.style.color = 'white';
  308. shapeSelect.style.border = 'none';
  309. shapeSelect.style.cursor = 'pointer';
  310. shapeSelect.style.appearance = 'none'; // Remove default arrow
  311. shapeSelect.style.fontFamily = 'Arial, sans-serif';
  312. shapeSelect.style.fontSize = '14px';
  313.  
  314. const shapes = [
  315. { value: 'circle', text: 'Circle' },
  316. { value: 'square', text: 'Square' },
  317. { value: 'dot', text: 'Dot' },
  318. { value: 'triangle', text: 'Triangle' },
  319. { value: 'rounded-square', text: 'Rounded Square' }
  320. ];
  321. shapes.forEach(shape => {
  322. const option = document.createElement('option');
  323. option.value = shape.value;
  324. option.textContent = shape.text;
  325. shapeSelect.appendChild(option);
  326. });
  327.  
  328. const shapeSelectArrow = document.createElement('div');
  329. shapeSelectArrow.style.position = 'absolute';
  330. shapeSelectArrow.style.top = '50%';
  331. shapeSelectArrow.style.right = '10px';
  332. shapeSelectArrow.style.transform = 'translateY(-50%)';
  333. shapeSelectArrow.style.width = '0';
  334. shapeSelectArrow.style.height = '0';
  335. shapeSelectArrow.style.borderLeft = '5px solid transparent';
  336. shapeSelectArrow.style.borderRight = '5px solid transparent';
  337. shapeSelectArrow.style.borderTop = '5px solid white';
  338. shapeSelectArrow.style.pointerEvents = 'none';
  339.  
  340. shapeSelectContainer.appendChild(shapeSelect);
  341. shapeSelectContainer.appendChild(shapeSelectArrow);
  342.  
  343. shapeSelect.addEventListener('change', () => {
  344. const shape = shapeSelect.value;
  345. if (shape === 'circle') {
  346. crosshair.style.borderRadius = '50%';
  347. crosshair.style.width = '20px';
  348. crosshair.style.height = '20px';
  349. crosshair.style.borderLeft = 'none';
  350. crosshair.style.borderRight = 'none';
  351. crosshair.style.borderBottom = 'none';
  352. } else if (shape === 'square') {
  353. crosshair.style.borderRadius = '0';
  354. crosshair.style.width = '20px';
  355. crosshair.style.height = '20px';
  356. crosshair.style.borderLeft = 'none';
  357. crosshair.style.borderRight = 'none';
  358. crosshair.style.borderBottom = 'none';
  359. } else if (shape === 'dot') {
  360. crosshair.style.borderRadius = '50%';
  361. crosshair.style.width = '10px';
  362. crosshair.style.height = '10px';
  363. crosshair.style.borderLeft = 'none';
  364. crosshair.style.borderRight = 'none';
  365. crosshair.style.borderBottom = 'none';
  366. } else if (shape === 'triangle') {
  367. crosshair.style.borderRadius = '0';
  368. crosshair.style.width = '0';
  369. crosshair.style.height = '0';
  370. crosshair.style.border = 'none';
  371. crosshair.style.borderLeft = '10px solid transparent';
  372. crosshair.style.borderRight = '10px solid transparent';
  373. crosshair.style.borderBottom = `20px solid ${crosshair.style.borderColor}`;
  374. } else if (shape === 'rounded-square') {
  375. crosshair.style.borderRadius = '10px';
  376. crosshair.style.width = '20px';
  377. crosshair.style.height = '20px';
  378. crosshair.style.borderLeft = 'none';
  379. crosshair.style.borderRight = 'none';
  380. crosshair.style.borderBottom = 'none';
  381. }
  382. });
  383.  
  384. const shapeMenuItem = createMenuItem('Crosshair Shape: ', shapeSelectContainer);
  385. colorMenu.appendChild(shapeMenuItem);
  386.  
  387. // Custom Crosshair Upload
  388. const customCrosshairInput = document.createElement('input');
  389. customCrosshairInput.type = 'file';
  390. customCrosshairInput.accept = 'image/*';
  391. customCrosshairInput.style.display = 'none';
  392.  
  393. const customCrosshairLabel = document.createElement('label');
  394. customCrosshairLabel.textContent = 'Upload Custom Crosshair';
  395. customCrosshairLabel.style.display = 'block';
  396. customCrosshairLabel.style.marginTop = '15px';
  397. customCrosshairLabel.style.marginBottom = '10px';
  398. customCrosshairLabel.style.color = 'white';
  399. customCrosshairLabel.style.fontFamily = 'Arial, sans-serif';
  400. customCrosshairLabel.style.fontSize = '14px';
  401. customCrosshairLabel.style.cursor = 'pointer';
  402. customCrosshairLabel.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  403. customCrosshairLabel.style.padding = '10px';
  404. customCrosshairLabel.style.borderRadius = '5px';
  405. customCrosshairLabel.style.textAlign = 'center';
  406. customCrosshairLabel.style.transition = 'background-color 0.2s ease-in-out';
  407.  
  408. customCrosshairLabel.addEventListener('mouseover', () => {
  409. customCrosshairLabel.style.backgroundColor = 'rgba(255, 255, 255, 0.2)';
  410. });
  411. customCrosshairLabel.addEventListener('mouseout', () => {
  412. customCrosshairLabel.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  413. });
  414.  
  415. customCrosshairLabel.addEventListener('click', () => {
  416. customCrosshairInput.click(); // Trigger the file input
  417. });
  418.  
  419. customCrosshairInput.addEventListener('change', (event) => {
  420. const file = event.target.files[0];
  421. if (file) {
  422. const reader = new FileReader();
  423. reader.onload = (e) => {
  424. crosshair.style.backgroundImage = `url(${e.target.result})`;
  425. crosshair.style.backgroundSize = 'cover';
  426. crosshair.style.border = 'none';
  427. };
  428. reader.readAsDataURL(file);
  429. }
  430. });
  431.  
  432. const customCrosshairMenuItem = createMenuItem('', customCrosshairLabel);
  433. colorMenu.appendChild(customCrosshairMenuItem);
  434. colorMenu.appendChild(customCrosshairInput);
  435.  
  436. // Crosshair Size Adjustment
  437. const sizeSliderContainer = document.createElement('div');
  438. sizeSliderContainer.style.width = '100%';
  439. sizeSliderContainer.style.height = '20px';
  440. sizeSliderContainer.style.position = 'relative';
  441. sizeSliderContainer.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  442. sizeSliderContainer.style.borderRadius = '10px';
  443. sizeSliderContainer.style.overflow = 'hidden';
  444.  
  445. const sizeSliderFill = document.createElement('div');
  446. sizeSliderFill.style.position = 'absolute';
  447. sizeSliderFill.style.top = '0';
  448. sizeSliderFill.style.left = '0';
  449. sizeSliderFill.style.height = '100%';
  450. sizeSliderFill.style.width = '50%'; // Default size
  451. sizeSliderFill.style.backgroundColor = '#4CAF50';
  452. sizeSliderFill.style.borderRadius = '10px';
  453. sizeSliderFill.style.transition = 'width 0.2s ease-in-out';
  454.  
  455. const sizeSliderThumb = document.createElement('div');
  456. sizeSliderThumb.style.position = 'absolute';
  457. sizeSliderThumb.style.top = '0';
  458. sizeSliderThumb.style.left = '50%';
  459. sizeSliderThumb.style.width = '20px';
  460. sizeSliderThumb.style.height = '20px';
  461. sizeSliderThumb.style.backgroundColor = 'white';
  462. sizeSliderThumb.style.borderRadius = '50%';
  463. sizeSliderThumb.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.3)';
  464. sizeSliderThumb.style.cursor = 'pointer';
  465. sizeSliderThumb.style.transition = 'left 0.2s ease-in-out';
  466.  
  467. sizeSliderContainer.appendChild(sizeSliderFill);
  468. sizeSliderContainer.appendChild(sizeSliderThumb);
  469.  
  470. const sizeInput = document.createElement('input');
  471. sizeInput.type = 'range';
  472. sizeInput.min = '10';
  473. sizeInput.max = '100';
  474. sizeInput.value = '20';
  475. sizeInput.style.position = 'absolute';
  476. sizeInput.style.top = '0';
  477. sizeInput.style.left = '0';
  478. sizeInput.style.width = '100%';
  479. sizeInput.style.height = '100%';
  480. sizeInput.style.opacity = '0';
  481. sizeInput.style.cursor = 'pointer';
  482. sizeInput.addEventListener('input', () => {
  483. const value = parseFloat(sizeInput.value);
  484. sizeSliderFill.style.width = `${value}%`;
  485. sizeSliderThumb.style.left = `${value}%`;
  486. crosshair.style.width = `${value}px`;
  487. crosshair.style.height = `${value}px`;
  488. });
  489. sizeSliderContainer.appendChild(sizeInput);
  490.  
  491. const sizeMenuItem = createMenuItem('Crosshair Size: ', sizeSliderContainer);
  492. colorMenu.appendChild(sizeMenuItem);
  493.  
  494. // Crosshair Glow
  495. const glowCheckboxContainer = document.createElement('label');
  496. glowCheckboxContainer.style.display = 'flex';
  497. glowCheckboxContainer.style.alignItems = 'center';
  498. glowCheckboxContainer.style.cursor = 'pointer';
  499.  
  500. const glowCheckbox = document.createElement('div');
  501. glowCheckbox.style.width = '20px';
  502. glowCheckbox.style.height = '20px';
  503. glowCheckbox.style.borderRadius = '5px';
  504. glowCheckbox.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
  505. glowCheckbox.style.position = 'relative';
  506. glowCheckbox.style.transition = 'background-color 0.2s ease-in-out';
  507.  
  508. const glowCheckboxTick = document.createElement('div');
  509. glowCheckboxTick.style.position = 'absolute';
  510. glowCheckboxTick.style.top = '50%';
  511. glowCheckboxTick.style.left = '50%';
  512. glowCheckboxTick.style.transform = 'translate(-50%, -50%)';
  513. glowCheckboxTick.style.width = '12px';
  514. glowCheckboxTick.style.height = '12px';
  515. glowCheckboxTick.style.backgroundColor = '#4CAF50';
  516. glowCheckboxTick.style.borderRadius = '3px';
  517. glowCheckboxTick.style.opacity = '0';
  518. glowCheckboxTick.style.transition = 'opacity 0.2s ease-in-out';
  519.  
  520. glowCheckbox.appendChild(glowCheckboxTick);
  521. glowCheckboxContainer.appendChild(glowCheckbox);
  522.  
  523. const glowCheckboxLabel = document.createElement('span');
  524. glowCheckboxLabel.textContent = 'Enable Crosshair Glow';
  525. glowCheckboxLabel.style.marginLeft = '10px';
  526. glowCheckboxLabel.style.color = 'white';
  527. glowCheckboxLabel.style.fontFamily = 'Arial, sans-serif';
  528. glowCheckboxLabel.style.fontSize = '14px';
  529. glowCheckboxContainer.appendChild(glowCheckboxLabel);
  530.  
  531. glowCheckboxContainer.addEventListener('click', () => {
  532. const isChecked = glowCheckboxTick.style.opacity === '1';
  533. glowCheckboxTick.style.opacity = isChecked ? '0' : '1';
  534. glowCheckbox.style.backgroundColor = isChecked ? 'rgba(255, 255, 255, 0.1)' : 'rgba(255, 255, 255, 0.3)';
  535.  
  536. if (!isChecked) {
  537. crosshair.style.boxShadow = `0 0 10px ${crosshair.style.borderColor}, 0 0 20px ${crosshair.style.borderColor}`;
  538. } else {
  539. crosshair.style.boxShadow = 'none';
  540. }
  541. });
  542.  
  543. const glowMenuItem = createMenuItem('', glowCheckboxContainer);
  544. colorMenu.appendChild(glowMenuItem);
  545.  
  546. // Toggle the color menu and blur overlay visibility
  547. menuButton.addEventListener('click', () => {
  548. const isMenuVisible = colorMenu.style.display === 'none';
  549. colorMenu.style.display = isMenuVisible ? 'block' : 'none';
  550. blurOverlay.style.display = isMenuVisible ? 'block' : 'none';
  551.  
  552. // Smoothly transition the blur, menu background, and text opacity
  553. if (isMenuVisible) {
  554. setTimeout(() => {
  555. blurOverlay.style.backdropFilter = 'blur(5px)';
  556. blurOverlay.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
  557. colorMenu.style.backgroundColor = 'rgba(0, 0, 0, 0.9)';
  558. Array.from(colorMenu.children).forEach(child => {
  559. child.style.opacity = '1'; // Fade in menu items
  560. });
  561. }, 10); // Small delay to allow display change before transition
  562. } else {
  563. blurOverlay.style.backdropFilter = 'blur(0px)';
  564. blurOverlay.style.backgroundColor = 'rgba(0, 0, 0, 0)';
  565. colorMenu.style.backgroundColor = 'rgba(0, 0, 0, 0)';
  566. Array.from(colorMenu.children).forEach(child => {
  567. child.style.opacity = '0'; // Fade out menu items
  568. });
  569. }
  570. });
  571.  
  572. // Close the menu when clicking outside
  573. blurOverlay.addEventListener('click', () => {
  574. colorMenu.style.display = 'none';
  575. blurOverlay.style.display = 'none';
  576. blurOverlay.style.backdropFilter = 'blur(0px)';
  577. blurOverlay.style.backgroundColor = 'rgba(0, 0, 0, 0)';
  578. colorMenu.style.backgroundColor = 'rgba(0, 0, 0, 0)';
  579. Array.from(colorMenu.children).forEach(child => {
  580. child.style.opacity = '0'; // Fade out menu items
  581. });
  582. });
  583.  
  584. // Function to display a message at the top of the screen
  585. function displayMessage(message, backgroundColor = 'rgba(255, 0, 0, 0.8)') {
  586. const messageDiv = document.createElement('div');
  587. messageDiv.textContent = message;
  588. messageDiv.style.position = 'fixed';
  589. messageDiv.style.top = '10px';
  590. messageDiv.style.left = '50%';
  591. messageDiv.style.transform = 'translateX(-50%)';
  592. messageDiv.style.backgroundColor = backgroundColor;
  593. messageDiv.style.color = 'white';
  594. messageDiv.style.padding = '10px';
  595. messageDiv.style.borderRadius = '5px';
  596. messageDiv.style.zIndex = '1000000';
  597. messageDiv.style.fontFamily = 'Arial, sans-serif';
  598. messageDiv.style.fontSize = '14px';
  599. messageDiv.style.boxShadow = '0 2px 4px rgba(0, 0, 0, 0.3)';
  600. document.body.appendChild(messageDiv);
  601. }
  602.  
  603. // Check for script updates
  604. try {
  605. GM_xmlhttpRequest({
  606. method: 'GET',
  607. url: versionCheckURL,
  608. onload: function(response) {
  609. const latestVersion = response.responseText.trim();
  610. if (latestVersion !== currentVersion) {
  611. displayMessage(
  612. `Your script is outdated (v${currentVersion}). Latest version is v${latestVersion}.`,
  613. 'rgba(255, 0, 0, 0.8)'
  614. );
  615. const updateLink = document.createElement('a');
  616. updateLink.textContent = 'Click here to update.';
  617. updateLink.href = updateURL;
  618. updateLink.style.color = '#00ff00';
  619. updateLink.style.marginLeft = '10px';
  620. updateLink.style.textDecoration = 'underline';
  621. document.body.appendChild(updateLink);
  622. }
  623. },
  624. onerror: function(error) {
  625. console.error('Failed to check for updates:', error);
  626. displayMessage(
  627. 'This script requires permission to fetch data. Please enable GM_xmlhttpRequest in your userscript manager.',
  628. 'rgba(255, 0, 0, 0.8)'
  629. );
  630. }
  631. });
  632. } catch (error) {
  633. console.error('GM_xmlhttpRequest is not available:', error);
  634. displayMessage(
  635. 'This script requires permission to fetch data. Please enable GM_xmlhttpRequest in your userscript manager.',
  636. 'rgba(255, 0, 0, 0.8)'
  637. );
  638. }
  639.  
  640. // Slide the GUI in from the right after the page loads
  641. setTimeout(() => {
  642. buttonContainer.style.right = '20px'; // Slide into position
  643. }, 500); // Delay the slide-in slightly for a smoother effect
  644. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址