Survev UI Mod v3

QoL features for Survev.io

  1. // ==UserScript==
  2. // @name Survev UI Mod v3
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-08-31
  5. // @description QoL features for Survev.io
  6. // @author Blubbled
  7. // @match https://survev.io/
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13.  
  14. (function() {
  15.  
  16. var lastCalledTime;
  17. var fps;
  18. var frameTimes = [];
  19. var maxFrames = 100;
  20. var uncappedFPS = false;
  21. var uiElementsEnabled = true;
  22. var fpsCounterEnabled = true;
  23.  
  24. function requestAnimFrame() {
  25. if (!lastCalledTime) {
  26. lastCalledTime = Date.now();
  27. fps = 0;
  28. return;
  29. }
  30.  
  31. var currentTime = Date.now();
  32. var delta = (currentTime - lastCalledTime) / 1000;
  33. lastCalledTime = currentTime;
  34.  
  35. frameTimes.push(delta);
  36.  
  37. if (frameTimes.length > maxFrames) {
  38. frameTimes.shift();
  39. }
  40.  
  41. var totalTime = frameTimes.reduce((sum, time) => sum + time, 0);
  42. fps = (frameTimes.length / totalTime).toFixed(0);
  43. }
  44.  
  45. function createFPSCounter() {
  46. var fpsCounter = document.createElement('div');
  47. fpsCounter.id = 'fps-counter';
  48. fpsCounter.style.position = 'fixed';
  49. fpsCounter.style.left = '10px';
  50. fpsCounter.style.top = '130px';
  51. fpsCounter.style.color = 'white';
  52. fpsCounter.style.fontSize = '20px';
  53. fpsCounter.style.fontWeight = 'bold';
  54. fpsCounter.style.zIndex = '1000';
  55. fpsCounter.style.backgroundColor = 'rgba(0, 0, 0, 0)';
  56. fpsCounter.style.padding = '5px';
  57. fpsCounter.style.borderRadius = '5px';
  58. document.body.appendChild(fpsCounter);
  59.  
  60. var lastUpdate = Date.now();
  61.  
  62. function updateFPSCounter() {
  63. requestAnimFrame();
  64. var now = Date.now();
  65. if (now - lastUpdate >= 1000) {
  66. fpsCounter.textContent = `FPS: ${fps}`;
  67. lastUpdate = now;
  68. }
  69.  
  70. requestAnimationFrame(updateFPSCounter);
  71. }
  72.  
  73. updateFPSCounter();
  74. }
  75.  
  76. createFPSCounter();
  77.  
  78.  
  79. function toggleFPSCounter(enabled) {
  80. var fpsCounter = document.getElementById('fps-counter');
  81. if (enabled) {
  82. fpsCounter.style.display = 'block';
  83. } else {
  84. fpsCounter.style.display = 'none';
  85. }
  86. }
  87.  
  88.  
  89. document.addEventListener("DOMContentLoaded", function() {
  90. var uiTopLeft = document.getElementById('ui-top-left');
  91.  
  92. if (uiTopLeft) {
  93.  
  94. uiTopLeft.style.position = 'relative';
  95.  
  96. uiTopLeft.style.left = '120px';
  97. }
  98. });
  99.  
  100.  
  101. var settingsButton = document.createElement('button');
  102. settingsButton.id = 'settings-button';
  103. settingsButton.textContent = 'Mod Settings';
  104. settingsButton.style.position = 'fixed';
  105. settingsButton.style.left = '10px';
  106. settingsButton.style.top = '50%';
  107. settingsButton.style.transform = 'translateY(-50%)';
  108. settingsButton.style.padding = '10px';
  109. settingsButton.style.fontSize = '18px';
  110. settingsButton.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  111. settingsButton.style.color = 'white';
  112. settingsButton.style.zIndex = '1000';
  113. settingsButton.style.display = 'none';
  114. document.body.appendChild(settingsButton);
  115.  
  116.  
  117. var settingsTab = document.createElement('div');
  118. settingsTab.id = 'settings-tab';
  119. settingsTab.style.position = 'fixed';
  120. settingsTab.style.left = '200px';
  121. settingsTab.style.top = '50%';
  122. settingsTab.style.width = '300px';
  123. settingsTab.style.height = '200px';
  124. settingsTab.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
  125. settingsTab.style.color = 'white';
  126. settingsTab.style.padding = '20px';
  127. settingsTab.style.borderRadius = '10px';
  128. settingsTab.style.display = 'none';
  129. settingsTab.innerHTML = '<h2>Mod Settings (a little buggy, re-enable uncapped FPS to update cursor info)</h2>';
  130. document.body.appendChild(settingsTab);
  131.  
  132. var fpsCheckbox = document.createElement('input');
  133. fpsCheckbox.type = 'checkbox';
  134. fpsCheckbox.id = 'uncapped-fps-checkbox';
  135. var fpsLabel = document.createElement('label');
  136. fpsLabel.setAttribute('for', 'uncapped-fps-checkbox');
  137. fpsLabel.textContent = 'Enable Uncapped FPS';
  138. settingsTab.appendChild(fpsCheckbox);
  139. settingsTab.appendChild(fpsLabel);
  140. settingsTab.appendChild(document.createElement('br'));
  141.  
  142.  
  143. var fpsCounterCheckbox = document.createElement('input');
  144. fpsCounterCheckbox.type = 'checkbox';
  145. fpsCounterCheckbox.id = 'fps-counter-checkbox';
  146. var fpsCounterLabel = document.createElement('label');
  147. fpsCounterLabel.setAttribute('for', 'fps-counter-checkbox');
  148. fpsCounterLabel.textContent = 'Show FPS Counter';
  149. settingsTab.appendChild(fpsCounterCheckbox);
  150. settingsTab.appendChild(fpsCounterLabel);
  151. settingsTab.appendChild(document.createElement('br'));
  152.  
  153.  
  154. var uiCheckbox = document.createElement('input');
  155. uiCheckbox.type = 'checkbox';
  156. uiCheckbox.id = 'ui-elements-checkbox';
  157. var uiLabel = document.createElement('label');
  158. uiLabel.setAttribute('for', 'ui-elements-checkbox');
  159. uiLabel.textContent = 'Enable Cursor Info';
  160. settingsTab.appendChild(uiCheckbox);
  161. settingsTab.appendChild(uiLabel);
  162.  
  163. function toggleUncappedFPS(enabled) {
  164. if (enabled) {
  165. window.requestAnimationFrame = function(callback) {
  166. return setTimeout(callback, 1);
  167. };
  168. } else {
  169. window.requestAnimationFrame = function(callback) {
  170. return window.setTimeout(callback, 1000 / 60);
  171. };
  172. }
  173. }
  174.  
  175.  
  176. function toggleUIElementDisplay(enabled) {
  177. if (enabled) {
  178. console.log("UI Elements Enabled");
  179. document.body.classList.remove('ui-hidden');
  180. } else {
  181. console.log("UI Elements Disabled");
  182. document.body.classList.add('ui-hidden');
  183. }
  184. }
  185.  
  186.  
  187. var style = document.createElement('style');
  188. style.innerHTML = `
  189. .ui-hidden .your-ui-element-class {
  190. display: none;
  191. }
  192. `;
  193. document.head.appendChild(style);
  194.  
  195.  
  196. function updateSettingsButtonVisibility() {
  197. var equippedWeapon = document.querySelector('.ui-weapon-switch[style*="background-color: rgba(0, 0, 0, 0.4)"], .ui-weapon-switch[style*="opacity: 1"]');
  198. if (!equippedWeapon) {
  199. settingsButton.style.display = 'block';
  200. } else {
  201. settingsButton.style.display = 'none';
  202. settingsTab.style.display = 'none';
  203. }
  204. }
  205.  
  206.  
  207. setInterval(updateSettingsButtonVisibility, 100);
  208.  
  209.  
  210. settingsButton.addEventListener('click', function() {
  211. if (settingsTab.style.display === 'none') {
  212. settingsTab.style.display = 'block';
  213. } else {
  214. settingsTab.style.display = 'none';
  215. }
  216. });
  217.  
  218.  
  219. function loadSettings() {
  220. var uncappedFPSSetting = localStorage.getItem('uncappedFPS') === 'true';
  221. var uiElementsSetting = localStorage.getItem('uiElementsEnabled') === 'true';
  222. var fpsCounterSetting = localStorage.getItem('fpsCounterEnabled') === 'true';
  223.  
  224. fpsCheckbox.checked = uncappedFPSSetting;
  225. uiCheckbox.checked = uiElementsSetting;
  226. fpsCounterCheckbox.checked = fpsCounterSetting;
  227.  
  228. toggleUncappedFPS(uncappedFPSSetting);
  229. toggleUIElementDisplay(uiElementsSetting);
  230. toggleFPSCounter(fpsCounterSetting);
  231. }
  232.  
  233. function saveSettings() {
  234. var uncappedFPSSetting = fpsCheckbox.checked;
  235. var uiElementsSetting = uiCheckbox.checked;
  236. var fpsCounterSetting = fpsCounterCheckbox.checked;
  237.  
  238. localStorage.setItem('uncappedFPS', uncappedFPSSetting);
  239. localStorage.setItem('uiElementsEnabled', uiElementsSetting);
  240. localStorage.setItem('fpsCounterEnabled', fpsCounterSetting);
  241.  
  242. toggleUncappedFPS(uncappedFPSSetting);
  243. toggleUIElementDisplay(uiElementsSetting);
  244. toggleFPSCounter(fpsCounterSetting);
  245. }
  246.  
  247. loadSettings();
  248.  
  249.  
  250. fpsCheckbox.addEventListener('change', saveSettings);
  251. uiCheckbox.addEventListener('change', saveSettings);
  252. fpsCounterCheckbox.addEventListener('change', saveSettings);
  253.  
  254.  
  255.  
  256. var gunSwitchDelayMap = {
  257. "AWM-S": 1000,
  258. "BLR 81": 1000,
  259. "Model 94": 1000,
  260. "Mosin-Nagant": 1000,
  261. "SV-98": 1000,
  262. "Scout Elite": 1000,
  263.  
  264. "Hawk 12G": 900,
  265. "Heart Cannon": 900,
  266. "M1100": 900,
  267. "M134": 900,
  268. "M79": 900,
  269. "M870": 900,
  270. "Potato Cannon": 900,
  271.  
  272. "AK-47": 750,
  273. "AN-94": 750,
  274. "BAR M1918": 750,
  275. "CZ-3A1": 750,
  276. "DP-28": 750,
  277. "FAMAS": 750,
  278. "Groza": 750,
  279. "Groza-S": 750,
  280. "L86A2": 750,
  281. "M1 Garand": 750,
  282. "M1014": 750,
  283. "M1A1": 750,
  284. "M249": 750,
  285. "M39 EMR": 750,
  286. "M416": 750,
  287. "M4A1-S": 750,
  288. "MAC-10": 750,
  289. "MP5": 750,
  290. "Mk 12 SPR": 750,
  291. "Mk45G": 750,
  292. "PKM": 750,
  293. "PKP Pecheneg": 750,
  294. "QBB-97": 750,
  295. "SCAR-H": 750,
  296. "SCAR-SSR": 750,
  297. "SPAS-12": 750,
  298. "SVD-63": 750,
  299. "Saiga-12": 750,
  300. "Spud Gun": 750,
  301. "UMP9": 750,
  302. "USAS-12": 750,
  303. "VSS": 750,
  304. "Vector": 750,
  305.  
  306. "Bugle": 300,
  307. "DEagle 50": 300,
  308. "Dual DEagle 50": 300,
  309. "Dual Flare Gun": 300,
  310. "Dual OT-38": 300,
  311. "Dual OTs-38": 300,
  312. "Dual P30L": 300,
  313. "Dual Peacemaker": 300,
  314. "Flare Gun": 300,
  315. "MP220": 300,
  316. "OT-38": 300,
  317. "OTs-38": 300,
  318. "Peacemaker": 300,
  319. "Rainbow Blaster": 300,
  320.  
  321. "Dual G18C": 250,
  322. "Dual M1911": 250,
  323. "Dual M9": 250,
  324. "Dual M93R": 250,
  325. "G18C": 250,
  326. "M1911": 250,
  327. "M9": 250,
  328. "M9 Cursed": 250,
  329. "M93R": 250,
  330. "P30L": 250
  331. };
  332.  
  333.  
  334. var currentCountdown = null;
  335.  
  336. function createSwitchDelayText() {
  337. var delayText = document.createElement('div');
  338. delayText.id = 'switch-delay-text';
  339. delayText.style.position = 'fixed';
  340. delayText.style.color = 'red';
  341. delayText.style.fontSize = '25px';
  342. delayText.style.fontWeight = 'bold';
  343. delayText.style.zIndex = '1000';
  344. delayText.style.left = '50%';
  345. delayText.style.transform = 'translateX(-50%)';
  346. delayText.style.top = '40%';
  347. document.body.appendChild(delayText);
  348. return delayText;
  349. }
  350.  
  351.  
  352. function showSwitchDelay(gunName, delayMs) {
  353. if (currentCountdown) {
  354. clearInterval(currentCountdown);
  355. }
  356.  
  357.  
  358. if (!gunSwitchDelayMap[gunName]) {
  359. return;
  360. }
  361.  
  362. var delayInSeconds = (delayMs / 1000).toFixed(2);
  363. var delayText = document.getElementById('switch-delay-text') || createSwitchDelayText();
  364.  
  365. delayText.textContent = `${delayInSeconds}s`;
  366. delayText.style.display = 'block';
  367.  
  368. currentCountdown = setInterval(function() {
  369. delayInSeconds -= 0.01;
  370. delayText.textContent = `${delayInSeconds.toFixed(2)}s`;
  371.  
  372. if (delayInSeconds <= 0) {
  373. clearInterval(currentCountdown);
  374. delayText.style.display = 'none';
  375. currentCountdown = null;
  376. }
  377. }, 10);
  378. }
  379.  
  380.  
  381. function detectWeaponSwitch() {
  382. var previousWeapon = null;
  383.  
  384. setInterval(function() {
  385. var equippedWeapon = document.querySelector('.ui-weapon-switch[style*="background-color: rgba(0, 0, 0, 0.4)"], .ui-weapon-switch[style*="opacity: 1"]');
  386. if (equippedWeapon) {
  387. var weaponName = equippedWeapon.querySelector('.ui-weapon-name').textContent.trim();
  388. if (weaponName !== previousWeapon) {
  389. previousWeapon = weaponName;
  390.  
  391. var delayMs = gunSwitchDelayMap[weaponName];
  392. if (delayMs) {
  393. showSwitchDelay(weaponName, delayMs);
  394. }
  395. }
  396. }
  397. }, 100);
  398. }
  399.  
  400. detectWeaponSwitch();
  401.  
  402.  
  403. function periodicallyShowKillCounter() {
  404. showKillCounter();
  405. setTimeout(periodicallyShowKillCounter, 100);
  406. }
  407.  
  408. function showKillCounter() {
  409. var killCounter = document.getElementById('ui-kill-counter-wrapper');
  410. if (killCounter) {
  411. killCounter.style.display = 'block';
  412. killCounter.style.position = 'fixed';
  413. killCounter.style.left = '5px';
  414. killCounter.style.top = '-25px';
  415. killCounter.style.color = 'white';
  416. killCounter.style.fontSize = '20px';
  417. killCounter.style.fontWeight = 'bold';
  418. killCounter.style.zIndex = '1000';
  419. killCounter.style.backgroundColor = 'rgba(0, 0, 0, 0)';
  420. killCounter.style.padding = '5px';
  421. killCounter.style.borderRadius = '5px';
  422.  
  423. var counterText = killCounter.querySelector('.counter-text');
  424. if (counterText) {
  425. counterText.style.minWidth = '30px';
  426. }
  427. }
  428. }
  429.  
  430. function calculateAverageBoostWidth() {
  431. var counterLengths = [98.5, 98.5, 147.75, 49.25];
  432. var boostCounters = document.querySelectorAll('#ui-boost-counter .ui-bar-inner');
  433. var totalWidth = 0;
  434.  
  435. boostCounters.forEach(function(counter, index) {
  436. var widthPercentage = parseFloat(counter.style.width);
  437. var unitLength = counterLengths[index];
  438. totalWidth += (widthPercentage / 100) * unitLength;
  439. });
  440.  
  441. var totalUnitLength = counterLengths.reduce((a, b) => a + b, 0);
  442. var averageWidthPercentage = (totalWidth / totalUnitLength) * 100;
  443.  
  444. return averageWidthPercentage.toFixed(2) + "%";
  445. }
  446.  
  447. function toggleUIElementDisplay(enabled) {
  448. if (enabled) {
  449.  
  450. var healthBarWidthCopy = document.createElement('span');
  451. healthBarWidthCopy.id = 'health-bar-width-copy';
  452. healthBarWidthCopy.classList.add('unselectable');
  453. healthBarWidthCopy.style.position = 'fixed';
  454. healthBarWidthCopy.style.fontSize = '25px';
  455. healthBarWidthCopy.style.fontWeight = 'bold';
  456. healthBarWidthCopy.style.display = 'none';
  457.  
  458. var ammoCountCopy = document.createElement('span');
  459. ammoCountCopy.id = 'ammo-count-copy';
  460. ammoCountCopy.classList.add('unselectable');
  461. ammoCountCopy.style.position = 'fixed';
  462. ammoCountCopy.style.fontSize = '25px';
  463. ammoCountCopy.style.fontWeight = 'bold';
  464. ammoCountCopy.style.display = 'none';
  465.  
  466. var weaponNameCopy = document.createElement('span');
  467. weaponNameCopy.id = 'weapon-name-copy';
  468. weaponNameCopy.classList.add('unselectable');
  469. weaponNameCopy.style.position = 'fixed';
  470. weaponNameCopy.style.fontSize = '20px';
  471. weaponNameCopy.style.fontWeight = 'bold';
  472. weaponNameCopy.style.display = 'none';
  473.  
  474. var boostWidthCopy = document.createElement('span');
  475. boostWidthCopy.id = 'boost-width-copy';
  476. boostWidthCopy.classList.add('unselectable');
  477. boostWidthCopy.style.position = 'fixed';
  478. boostWidthCopy.style.fontSize = '20px';
  479. boostWidthCopy.style.fontWeight = 'bold';
  480. boostWidthCopy.style.color = 'orange';
  481. boostWidthCopy.style.display = 'none';
  482.  
  483. function updateHealthBarWidthCopy() {
  484. var healthBar = document.getElementById('ui-health-actual');
  485. if (healthBar && healthBar.offsetWidth > 0 && healthBar.offsetHeight > 0) {
  486. var healthBarWidth = Math.round(parseFloat(healthBar.style.width));
  487. var healthBarColor = healthBar.style.backgroundColor;
  488.  
  489. healthBarWidthCopy.textContent = healthBarWidth + "%";
  490. healthBarWidthCopy.style.color = healthBarColor;
  491. healthBarWidthCopy.style.display = 'block';
  492. } else {
  493. healthBarWidthCopy.style.display = 'none';
  494. }
  495. }
  496.  
  497. function updateAmmoCountCopy() {
  498. var ammoCountElement = document.getElementById('ui-current-clip');
  499.  
  500. if (ammoCountElement && window.getComputedStyle(ammoCountElement).display !== 'none' && parseFloat(window.getComputedStyle(ammoCountElement).opacity) > 0) {
  501. var ammoCount = ammoCountElement.textContent;
  502. ammoCountCopy.textContent = ammoCount;
  503. ammoCountCopy.style.color = ammoCountElement.style.color;
  504. ammoCountCopy.style.display = 'block';
  505. } else {
  506. ammoCountCopy.style.display = 'none';
  507. }
  508. }
  509.  
  510. function updateWeaponNameCopy() {
  511. var equippedWeapon = document.querySelector('.ui-weapon-switch[style*="background-color: rgba(0, 0, 0, 0.4)"], .ui-weapon-switch[style*="opacity: 1"]');
  512. if (equippedWeapon) {
  513. var weaponName = equippedWeapon.querySelector('.ui-weapon-name').textContent;
  514. weaponNameCopy.textContent = weaponName;
  515. weaponNameCopy.style.color = 'white';
  516. weaponNameCopy.style.display = 'block';
  517. } else {
  518. weaponNameCopy.style.display = 'none';
  519. }
  520. }
  521.  
  522. function updateBoostWidthCopy() {
  523. var boostElement = document.getElementById('ui-boost-counter');
  524. if (boostElement && window.getComputedStyle(boostElement).display !== 'none' && parseFloat(window.getComputedStyle(boostElement).opacity) > 0) {
  525. var averageBoostWidth = calculateAverageBoostWidth();
  526. boostWidthCopy.textContent = averageBoostWidth;
  527. boostWidthCopy.style.display = 'block';
  528. } else {
  529. boostWidthCopy.style.display = 'none';
  530. }
  531. }
  532.  
  533. function followCursor(event) {
  534. healthBarWidthCopy.style.left = `${event.clientX - 70}px`;
  535. healthBarWidthCopy.style.top = `${event.clientY + 25}px`;
  536.  
  537. ammoCountCopy.style.left = `${event.clientX + 40}px`;
  538. ammoCountCopy.style.top = `${event.clientY + 25}px`;
  539.  
  540. weaponNameCopy.style.left = `${event.clientX + 40}px`;
  541. weaponNameCopy.style.top = `${event.clientY + 50}px`;
  542.  
  543. boostWidthCopy.style.left = `${event.clientX - 70}px`;
  544. boostWidthCopy.style.top = `${event.clientY + 50}px`;
  545. }
  546.  
  547. document.addEventListener('mousemove', followCursor);
  548.  
  549. healthBarWidthCopy.style.webkitTouchCallout = 'none'; /* iOS Safari */
  550. healthBarWidthCopy.style.webkitUserSelect = 'none'; /* Safari */
  551. healthBarWidthCopy.style.userSelect = 'none'; /* Standard syntax */
  552.  
  553. ammoCountCopy.style.webkitTouchCallout = 'none'; /* iOS Safari */
  554. ammoCountCopy.style.webkitUserSelect = 'none'; /* Safari */
  555. ammoCountCopy.style.userSelect = 'none'; /* Standard syntax */
  556.  
  557. weaponNameCopy.style.webkitTouchCallout = 'none'; /* iOS Safari */
  558. weaponNameCopy.style.webkitUserSelect = 'none'; /* Safari */
  559. weaponNameCopy.style.userSelect = 'none'; /* Standard syntax */
  560.  
  561. boostWidthCopy.style.webkitTouchCallout = 'none'; /* iOS Safari */
  562. boostWidthCopy.style.webkitUserSelect = 'none'; /* Safari */
  563. boostWidthCopy.style.userSelect = 'none'; /* Standard syntax */
  564.  
  565. document.body.appendChild(healthBarWidthCopy);
  566. document.body.appendChild(ammoCountCopy);
  567. document.body.appendChild(weaponNameCopy);
  568. document.body.appendChild(boostWidthCopy);
  569.  
  570. updateHealthBarWidthCopy();
  571. updateAmmoCountCopy();
  572. updateWeaponNameCopy();
  573. updateBoostWidthCopy();
  574.  
  575. var healthObserver = new MutationObserver(updateHealthBarWidthCopy);
  576. var healthTargetNode = document.getElementById('ui-health-actual');
  577. if (healthTargetNode) {
  578. healthObserver.observe(healthTargetNode, { attributes: true, attributeFilter: ['style', 'class'] });
  579. }
  580. if (healthTargetNode && healthTargetNode.parentElement) {
  581. healthObserver.observe(healthTargetNode.parentElement, { attributes: true, attributeFilter: ['style', 'class'] });
  582. }
  583.  
  584. var ammoObserver = new MutationObserver(updateAmmoCountCopy);
  585. var ammoTargetNode = document.getElementById('ui-current-clip');
  586. if (ammoTargetNode) {
  587. ammoObserver.observe(ammoTargetNode, { attributes: true, childList: true, subtree: true });
  588. }
  589.  
  590. var weaponObserver = new MutationObserver(updateWeaponNameCopy);
  591. var weaponTargetNodes = document.querySelectorAll('.ui-weapon-switch');
  592. weaponTargetNodes.forEach(function(node) {
  593. weaponObserver.observe(node, { attributes: true, attributeFilter: ['style', 'class'] });
  594. });
  595.  
  596. var boostObserver = new MutationObserver(updateBoostWidthCopy);
  597. var boostTargetNodes = document.querySelectorAll('#ui-boost-counter .ui-bar-inner');
  598. boostTargetNodes.forEach(function(node) {
  599. boostObserver.observe(node, { attributes: true, attributeFilter: ['style', 'class'] });
  600. });
  601.  
  602. } else {
  603. var healthBarWidthCopy = document.getElementById('health-bar-width-copy');
  604. if (healthBarWidthCopy) {
  605. healthBarWidthCopy.parentNode.removeChild(healthBarWidthCopy);
  606. }
  607.  
  608. var ammoCountCopy = document.getElementById('ammo-count-copy');
  609. if (ammoCountCopy) {
  610. ammoCountCopy.parentNode.removeChild(ammoCountCopy);
  611. }
  612.  
  613. var weaponNameCopy = document.getElementById('weapon-name-copy');
  614. if (weaponNameCopy) {
  615. weaponNameCopy.parentNode.removeChild(weaponNameCopy);
  616. }
  617.  
  618. var boostWidthCopy = document.getElementById('boost-width-copy');
  619. if (boostWidthCopy) {
  620. boostWidthCopy.parentNode.removeChild(boostWidthCopy);
  621. }
  622. }
  623. }
  624.  
  625. toggleUIElementDisplay(true);
  626. showKillCounter();
  627. periodicallyShowKillCounter();
  628. })();