diff --git a/assets/js/gamepad-tester.js b/assets/js/gamepad-tester.js index 98d66210..551c598d 100644 --- a/assets/js/gamepad-tester.js +++ b/assets/js/gamepad-tester.js @@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', function() { // If there are other gamepads, select the first one const remainingIndices = Object.keys(gamepads); if (remainingIndices.length > 0) { - activeGamepadIndex = parseInt(remainingIndices[0]); + activeGamepadIndex = Number.parseInt(remainingIndices[0]); gamepadSelector.value = activeGamepadIndex; } else { stopGamepadLoop(); @@ -54,7 +54,7 @@ document.addEventListener('DOMContentLoaded', function() { // Event listener for gamepad selector change gamepadSelector.addEventListener('change', function() { - activeGamepadIndex = parseInt(this.value); + activeGamepadIndex = Number.parseInt(this.value); initGamepadButtons(); initGamepadAxes(); }); @@ -409,14 +409,14 @@ document.addEventListener('DOMContentLoaded', function() { const vibrationCapabilities = gamepadHelper.getVibrationCapabilities(gamepad); if (!vibrationCapabilities.supported) return; - const duration = parseInt(document.getElementById('vibration-duration').value); + const duration = Number.parseInt(document.getElementById('vibration-duration').value); let vibrationOptions = { duration }; if (vibrationCapabilities.type === 'dual-rumble') { - vibrationOptions.weakMagnitude = parseFloat(document.getElementById('vibration-weak').value); - vibrationOptions.strongMagnitude = parseFloat(document.getElementById('vibration-strong').value); + vibrationOptions.weakMagnitude = Number.parseFloat(document.getElementById('vibration-weak').value); + vibrationOptions.strongMagnitude = Number.parseFloat(document.getElementById('vibration-strong').value); } else { - const magnitude = parseFloat(document.getElementById('vibration-magnitude').value); + const magnitude = Number.parseFloat(document.getElementById('vibration-magnitude').value); vibrationOptions.weakMagnitude = magnitude; vibrationOptions.strongMagnitude = magnitude; vibrationOptions.magnitude = magnitude; @@ -491,7 +491,7 @@ document.addEventListener('DOMContentLoaded', function() { // If we have gamepads already, start the loop if (Object.keys(gamepads).length > 0) { - activeGamepadIndex = parseInt(Object.keys(gamepads)[0]); + activeGamepadIndex = Number.parseInt(Object.keys(gamepads)[0]); updateStatus(`Gamepad ${gamepads[activeGamepadIndex].id} connected`); startGamepadLoop(); } diff --git a/assets/js/roadmap.js b/assets/js/roadmap.js index 29cf4f20..b462a82e 100644 --- a/assets/js/roadmap.js +++ b/assets/js/roadmap.js @@ -86,9 +86,9 @@ document.addEventListener('DOMContentLoaded', function() { labelEl.style.backgroundColor = `#${label.color}`; // Determine if label text should be dark or light based on background - const r = parseInt(label.color.substring(0, 2), 16); - const g = parseInt(label.color.substring(2, 4), 16); - const b = parseInt(label.color.substring(4, 6), 16); + const r = Number.parseInt(label.color.substring(0, 2), 16); + const g = Number.parseInt(label.color.substring(2, 4), 16); + const b = Number.parseInt(label.color.substring(4, 6), 16); const brightness = (r * 299 + g * 587 + b * 114) / 1000; labelEl.style.color = brightness > 125 ? '#000' : '#fff'; @@ -173,9 +173,9 @@ document.addEventListener('DOMContentLoaded', function() { labelEl.style.backgroundColor = `#${label.color}`; // Determine if label text should be dark or light based on background - const r = parseInt(label.color.substring(0, 2), 16); - const g = parseInt(label.color.substring(2, 4), 16); - const b = parseInt(label.color.substring(4, 6), 16); + const r = Number.parseInt(label.color.substring(0, 2), 16); + const g = Number.parseInt(label.color.substring(2, 4), 16); + const b = Number.parseInt(label.color.substring(4, 6), 16); const brightness = (r * 299 + g * 587 + b * 114) / 1000; labelEl.style.color = brightness > 125 ? '#000' : '#fff';