@@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', function() {
4444 // If there are other gamepads, select the first one
4545 const remainingIndices = Object . keys ( gamepads ) ;
4646 if ( remainingIndices . length > 0 ) {
47- activeGamepadIndex = parseInt ( remainingIndices [ 0 ] ) ;
47+ activeGamepadIndex = Number . parseInt ( remainingIndices [ 0 ] ) ;
4848 gamepadSelector . value = activeGamepadIndex ;
4949 } else {
5050 stopGamepadLoop ( ) ;
@@ -54,7 +54,7 @@ document.addEventListener('DOMContentLoaded', function() {
5454
5555 // Event listener for gamepad selector change
5656 gamepadSelector . addEventListener ( 'change' , function ( ) {
57- activeGamepadIndex = parseInt ( this . value ) ;
57+ activeGamepadIndex = Number . parseInt ( this . value ) ;
5858 initGamepadButtons ( ) ;
5959 initGamepadAxes ( ) ;
6060 } ) ;
@@ -409,14 +409,14 @@ document.addEventListener('DOMContentLoaded', function() {
409409 const vibrationCapabilities = gamepadHelper . getVibrationCapabilities ( gamepad ) ;
410410 if ( ! vibrationCapabilities . supported ) return ;
411411
412- const duration = parseInt ( document . getElementById ( 'vibration-duration' ) . value ) ;
412+ const duration = Number . parseInt ( document . getElementById ( 'vibration-duration' ) . value ) ;
413413 let vibrationOptions = { duration } ;
414414
415415 if ( vibrationCapabilities . type === 'dual-rumble' ) {
416- vibrationOptions . weakMagnitude = parseFloat ( document . getElementById ( 'vibration-weak' ) . value ) ;
417- vibrationOptions . strongMagnitude = parseFloat ( document . getElementById ( 'vibration-strong' ) . value ) ;
416+ vibrationOptions . weakMagnitude = Number . parseFloat ( document . getElementById ( 'vibration-weak' ) . value ) ;
417+ vibrationOptions . strongMagnitude = Number . parseFloat ( document . getElementById ( 'vibration-strong' ) . value ) ;
418418 } else {
419- const magnitude = parseFloat ( document . getElementById ( 'vibration-magnitude' ) . value ) ;
419+ const magnitude = Number . parseFloat ( document . getElementById ( 'vibration-magnitude' ) . value ) ;
420420 vibrationOptions . weakMagnitude = magnitude ;
421421 vibrationOptions . strongMagnitude = magnitude ;
422422 vibrationOptions . magnitude = magnitude ;
@@ -491,7 +491,7 @@ document.addEventListener('DOMContentLoaded', function() {
491491
492492 // If we have gamepads already, start the loop
493493 if ( Object . keys ( gamepads ) . length > 0 ) {
494- activeGamepadIndex = parseInt ( Object . keys ( gamepads ) [ 0 ] ) ;
494+ activeGamepadIndex = Number . parseInt ( Object . keys ( gamepads ) [ 0 ] ) ;
495495 updateStatus ( `Gamepad ${ gamepads [ activeGamepadIndex ] . id } connected` ) ;
496496 startGamepadLoop ( ) ;
497497 }
0 commit comments