From 8a342d60ec2c9189c8b713bb8f6dc09f29576f1b Mon Sep 17 00:00:00 2001 From: e7d Date: Fri, 11 Nov 2016 01:32:07 +0100 Subject: [PATCH] added a "no gamepad detected" indication --- css/main.css | 7 +++++++ index.html | 1 + js/gamepad.js | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/css/main.css b/css/main.css index 4eba7c0..393608a 100644 --- a/css/main.css +++ b/css/main.css @@ -2,6 +2,13 @@ body { background: transparent; overflow: hidden; } +.no-gamepad { + width: 100vw; + line-height: 100vh; + text-align: center; + text-transform: uppercase; + font-weight: 700; +} .gamepad { position: absolute; top: 50%; diff --git a/index.html b/index.html index 60b6c64..1c7e596 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,7 @@ +
No gamepad detected

Help

diff --git a/js/gamepad.js b/js/gamepad.js index a067cbf..33dfcf0 100644 --- a/js/gamepad.js +++ b/js/gamepad.js @@ -93,7 +93,7 @@ function scanGamepads() { return; } - var gamepads = getGamepads(); + gamepads = getGamepads(); for (var gamepadIndex = 0; gamepadIndex < gamepads.length; gamepadIndex++) { var gamepad = gamepads[gamepadIndex]; if (gamepad) {