Vortex Forge Web Client V1.0

Vortex Forge Web Client

目前为 2024-12-31 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Vortex Forge Web Client V1.0
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.9
  5. // @description Vortex Forge Web Client
  6. // @author NOOB
  7. // @match https://deadshot.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13.  
  14. let featuresEnabled = true;
  15. let seasonalModeEnabled = true;
  16. let fireworkInterval = null;
  17. let kKeyInterval = null;
  18. let isRightMousePressed = false;
  19.  
  20. const newSettingsContent = `
  21. <div class="setting toggle" style="margin-top: 80px; padding: 9px 30px;">
  22. <p style="font-size: 21px;">Seasonal Update</p>
  23. <label>
  24. <input id="vfswapper" class="checkbox" type="checkbox" checked="">
  25. <span></span>
  26. </label>
  27. </div>
  28. <div class="setting toggle" style="padding: 9px 30px; background-color: rgba(255, 255, 255, 0.03);">
  29. <p style="font-size: 21px;">VF Mode</p>
  30. <label>
  31. <input id="vfsettings" class="checkbox" type="checkbox" checked="">
  32. <span></span>
  33. </label>
  34. </div>`;
  35.  
  36. function addCustomSettingsToTop() {
  37. const settingsDiv = document.getElementById('settingsDiv');
  38. if (settingsDiv && !document.getElementById('vfswapper')) {
  39. const customDiv = document.createElement('div');
  40. customDiv.innerHTML = newSettingsContent;
  41.  
  42. settingsDiv.insertBefore(customDiv, settingsDiv.firstChild);
  43. }
  44. }
  45.  
  46. function waitForSettingsDiv() {
  47. const retryInterval = setInterval(() => {
  48. const settingsDiv = document.getElementById('settingsDiv');
  49. if (settingsDiv) {
  50. addCustomSettingsToTop();
  51. setupSeasonalModeToggle();
  52. setupVortexForgeModeToggle();
  53. clearInterval(retryInterval);
  54. }
  55. }, 500);
  56. }
  57.  
  58. function setupSeasonalModeToggle() {
  59. const swapperCheckbox = document.getElementById('vfswapper');
  60. if (swapperCheckbox) {
  61. swapperCheckbox.addEventListener('change', (event) => {
  62. seasonalModeEnabled = event.target.checked;
  63. toggleSeasonalFeatures(seasonalModeEnabled);
  64. });
  65. }
  66. }
  67.  
  68. function setupVortexForgeModeToggle() {
  69. const vfCheckbox = document.getElementById('vfsettings');
  70. if (vfCheckbox) {
  71. vfCheckbox.addEventListener('change', (event) => {
  72. featuresEnabled = event.target.checked;
  73. toggleFeatures(featuresEnabled);
  74. });
  75. }
  76. }
  77.  
  78. function toggleFeatures(enabled) {
  79. if (!enabled) {
  80. stopKKeyPress();
  81. isRightMousePressed = false;
  82. }
  83. }
  84.  
  85. function createFireworkParticle(x, y, color) {
  86. const particle = document.createElement('div');
  87. particle.className = 'firework-particle';
  88. particle.style.position = 'absolute';
  89. particle.style.top = `${y}px`;
  90. particle.style.left = `${x}px`;
  91. particle.style.width = '5px';
  92. particle.style.height = '5px';
  93. particle.style.backgroundColor = color;
  94. particle.style.borderRadius = '50%';
  95. particle.style.pointerEvents = 'none';
  96. particle.style.transform = 'translate(-50%, -50%)';
  97.  
  98. const angle = Math.random() * 360;
  99. const speed = Math.random() * 3 + 2;
  100. const duration = Math.random() * 1 + 1.5;
  101.  
  102. const xVelocity = Math.cos((angle * Math.PI) / 180) * speed;
  103. const yVelocity = Math.sin((angle * Math.PI) / 180) * speed;
  104.  
  105. const animation = particle.animate(
  106. [
  107. { transform: `translate(0, 0)`, opacity: 1 },
  108. { transform: `translate(${xVelocity * 50}px, ${yVelocity * 50}px)`, opacity: 0 },
  109. ],
  110. {
  111. duration: duration * 1000,
  112. easing: 'ease-out',
  113. }
  114. );
  115.  
  116. animation.onfinish = () => particle.remove();
  117. document.body.appendChild(particle);
  118. }
  119.  
  120. function launchFirework() {
  121. const x = Math.random() * window.innerWidth;
  122. const y = Math.random() * window.innerHeight * 0.5;
  123. const colors = ['red', 'blue', 'yellow', 'green', 'purple', 'orange', 'pink'];
  124.  
  125. for (let i = 0; i < 50; i++) {
  126. createFireworkParticle(x, y, colors[Math.floor(Math.random() * colors.length)]);
  127. }
  128. }
  129.  
  130. function startFireworks() {
  131. if (!fireworkInterval) {
  132. fireworkInterval = setInterval(launchFirework, 1000);
  133. }
  134. }
  135.  
  136. function stopFireworks() {
  137. if (fireworkInterval) {
  138. clearInterval(fireworkInterval);
  139. fireworkInterval = null;
  140. }
  141. }
  142.  
  143. function createHappyNewYearText() {
  144. const textDiv = document.createElement('div');
  145. textDiv.id = 'happy-new-year-text';
  146. textDiv.innerText = '🎉 Happy New Year! 🎆';
  147. textDiv.style.position = 'fixed';
  148. textDiv.style.top = '50%';
  149. textDiv.style.left = '50%';
  150. textDiv.style.transform = 'translate(-50%, -50%) scale(0)';
  151. textDiv.style.fontSize = '4rem';
  152. textDiv.style.color = 'gold';
  153. textDiv.style.fontWeight = 'bold';
  154. textDiv.style.textShadow = '0 0 10px red, 0 0 20px yellow, 0 0 30px white';
  155. textDiv.style.pointerEvents = 'none';
  156. textDiv.style.opacity = '0';
  157. textDiv.style.zIndex = '9999';
  158.  
  159. document.body.appendChild(textDiv);
  160.  
  161. const animation = textDiv.animate(
  162. [
  163. { transform: 'translate(-50%, -50%) scale(0)', opacity: 0 },
  164. { transform: 'translate(-50%, -50%) scale(1.2)', opacity: 1, offset: 0.5 },
  165. { transform: 'translate(-50%, -50%) scale(1)', opacity: 1 },
  166. { transform: 'translate(-50%, -50%) scale(1)', opacity: 0 },
  167. ],
  168. {
  169. duration: 5000,
  170. easing: 'ease-in-out',
  171. }
  172. );
  173.  
  174. animation.onfinish = () => textDiv.remove();
  175. }
  176.  
  177. function toggleSeasonalFeatures(enabled) {
  178. if (enabled) {
  179. startFireworks();
  180. createHappyNewYearText();
  181. } else {
  182. stopFireworks();
  183. }
  184. }
  185.  
  186. function startKKeyPress() {
  187. if (!kKeyInterval) {
  188. kKeyInterval = setInterval(() => {
  189. const kKeyEvent = new KeyboardEvent('keydown', {
  190. key: 'K',
  191. code: 'KeyK',
  192. keyCode: 75,
  193. which: 75,
  194. bubbles: true,
  195. cancelable: true,
  196. });
  197. document.dispatchEvent(kKeyEvent);
  198. }, 100);
  199. }
  200. }
  201.  
  202. function stopKKeyPress() {
  203. if (kKeyInterval) {
  204. clearInterval(kKeyInterval);
  205. kKeyInterval = null;
  206.  
  207. const kKeyUpEvent = new KeyboardEvent('keyup', {
  208. key: 'K',
  209. code: 'KeyK',
  210. keyCode: 75,
  211. which: 75,
  212. bubbles: true,
  213. cancelable: true,
  214. });
  215. document.dispatchEvent(kKeyUpEvent);
  216. }
  217. }
  218.  
  219. document.addEventListener('mousedown', (e) => {
  220. if (!featuresEnabled) return;
  221.  
  222. if (e.button === 2) {
  223. if (!isRightMousePressed) {
  224. isRightMousePressed = true;
  225. startKKeyPress();
  226. }
  227. }
  228. });
  229.  
  230. document.addEventListener('mouseup', (e) => {
  231. if (e.button === 2) {
  232. stopKKeyPress();
  233. isRightMousePressed = false;
  234. }
  235. });
  236.  
  237. window.addEventListener('load', () => {
  238. waitForSettingsDiv();
  239. toggleSeasonalFeatures(seasonalModeEnabled);
  240. });
  241. })();