diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-09 19:55:38 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-09 19:55:38 +0100 |
| commit | ddc62adc923b2668207c4c7a527ed221c9ba9393 (patch) | |
| tree | e972cda783409601c642c556dd0e4eeb8bf35f98 /static/app.js | |
| parent | fd9d6dafd12348e7ecd0aab216dfeda1fe13a088 (diff) | |
| download | deck-it-ddc62adc923b2668207c4c7a527ed221c9ba9393.tar.gz deck-it-ddc62adc923b2668207c4c7a527ed221c9ba9393.zip | |
feat: fullscreen toggle for the tablet browser
Diffstat (limited to 'static/app.js')
| -rw-r--r-- | static/app.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/static/app.js b/static/app.js index ce3ec62..d125d69 100644 --- a/static/app.js +++ b/static/app.js @@ -186,6 +186,16 @@ async function boot() { showTab(tabs[saved] ? saved : "Dashboard"); } +const fullscreenButton = document.getElementById("fullscreen"); +fullscreenButton?.addEventListener("click", async () => { + try { + if (document.fullscreenElement) await document.exitFullscreen(); + else await document.documentElement.requestFullscreen(); + } catch { + // the browser refused; nothing to do + } +}); + document.addEventListener("visibilitychange", () => { if (document.visibilityState === "visible") refreshers.forEach((fn) => fn()); }); |
