diff --git a/src/main.ts b/src/main.ts index f415b80..8d45ce5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -295,12 +295,17 @@ async function initJuego() { window.requestAnimationFrame(loop); } -document.getElementById("full-screen")!.addEventListener("click", async () => { - document.documentElement.requestFullscreen && - (await document.documentElement.requestFullscreen({ - navigationUI: "hide", - })); - await screen.orientation.lock("landscape"); -}); +const fullscreenEl = document.getElementById("full-screen")!; +if ("requestFullscreen" in document.documentElement) { + fullscreenEl.addEventListener("click", async () => { + document.documentElement.requestFullscreen && + (await document.documentElement.requestFullscreen({ + navigationUI: "hide", + })); + await screen.orientation.lock("landscape"); + }); +} else { + fullscreenEl.hidden = true; +} initJuego();