Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions assets/js/gamepad-tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
});
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
12 changes: 6 additions & 6 deletions assets/js/roadmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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';

Expand Down