mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-08-07 18:36:34 +00:00
Deploy site from a0a97138e0
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user