added a "no gamepad detected" indication
This commit is contained in:
parent
f0e4d20513
commit
8a342d60ec
@ -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%;
|
||||
|
@ -11,6 +11,7 @@
|
||||
<link rel="stylesheet" href="css/main.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="no-gamepad">No gamepad detected</div>
|
||||
<div class="gamepad"></div>
|
||||
<div class="help">
|
||||
<h2>Help</h2>
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user