added a "no gamepad detected" indication
This commit is contained in:
parent
f0e4d20513
commit
8a342d60ec
@ -2,6 +2,13 @@ body {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
.no-gamepad {
|
||||||
|
width: 100vw;
|
||||||
|
line-height: 100vh;
|
||||||
|
text-align: center;
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
.gamepad {
|
.gamepad {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<link rel="stylesheet" href="css/main.css">
|
<link rel="stylesheet" href="css/main.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<div class="no-gamepad">No gamepad detected</div>
|
||||||
<div class="gamepad"></div>
|
<div class="gamepad"></div>
|
||||||
<div class="help">
|
<div class="help">
|
||||||
<h2>Help</h2>
|
<h2>Help</h2>
|
||||||
|
@ -93,7 +93,7 @@ function scanGamepads() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var gamepads = getGamepads();
|
gamepads = getGamepads();
|
||||||
for (var gamepadIndex = 0; gamepadIndex < gamepads.length; gamepadIndex++) {
|
for (var gamepadIndex = 0; gamepadIndex < gamepads.length; gamepadIndex++) {
|
||||||
var gamepad = gamepads[gamepadIndex];
|
var gamepad = gamepads[gamepadIndex];
|
||||||
if (gamepad) {
|
if (gamepad) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user