Ocultar botón de pantalla completa si no es posible
This commit is contained in:
parent
fbcb0f59e9
commit
d2105b0ea4
1 changed files with 12 additions and 7 deletions
19
src/main.ts
19
src/main.ts
|
@ -295,12 +295,17 @@ async function initJuego() {
|
||||||
window.requestAnimationFrame(loop);
|
window.requestAnimationFrame(loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("full-screen")!.addEventListener("click", async () => {
|
const fullscreenEl = document.getElementById("full-screen")!;
|
||||||
document.documentElement.requestFullscreen &&
|
if ("requestFullscreen" in document.documentElement) {
|
||||||
(await document.documentElement.requestFullscreen({
|
fullscreenEl.addEventListener("click", async () => {
|
||||||
navigationUI: "hide",
|
document.documentElement.requestFullscreen &&
|
||||||
}));
|
(await document.documentElement.requestFullscreen({
|
||||||
await screen.orientation.lock("landscape");
|
navigationUI: "hide",
|
||||||
});
|
}));
|
||||||
|
await screen.orientation.lock("landscape");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
fullscreenEl.hidden = true;
|
||||||
|
}
|
||||||
|
|
||||||
initJuego();
|
initJuego();
|
||||||
|
|
Loading…
Reference in a new issue