diff --git a/js/gamepad.js b/js/gamepad.js index ab59dd3..c2414b8 100644 --- a/js/gamepad.js +++ b/js/gamepad.js @@ -189,8 +189,15 @@ class Gamepad { */ onGamepadDisconnect(e) { // on gamepad disconnection, remove it from the list - this.disconnect(e.gamepad.index); - this.scan(); + this.$gamepad.addClass('disconnected'); + + window.setTimeout(() => { + this.$gamepad.removeClass('disconnected'); + + // remove gamepad from the list and start back scanning + this.disconnect(e.gamepad.index); + this.scan(); + }, 5000); } /** diff --git a/templates/ds4/disconnected.svg b/templates/ds4/disconnected.svg index 2264c3a..4cd3e97 100644 --- a/templates/ds4/disconnected.svg +++ b/templates/ds4/disconnected.svg @@ -1,4 +1,4 @@ - - + + diff --git a/templates/xbox-one/disconnected.svg b/templates/xbox-one/disconnected.svg index 0c98180..0934e8b 100644 --- a/templates/xbox-one/disconnected.svg +++ b/templates/xbox-one/disconnected.svg @@ -1,4 +1,4 @@ - - + +