From 89ef30348a5b1dd9ee0deef037f0e244c84ea953 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 8 Jul 2025 15:09:38 -0700 Subject: [PATCH] Add Full Screen mode --- index.html | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index f698f1f..42de701 100644 --- a/index.html +++ b/index.html @@ -722,6 +722,19 @@ +
+ +
+
+ + +
+
+ + +
+
+
@@ -1103,7 +1116,7 @@ const elements = this.form.elements; for (const element of elements) { - if (!element.name) continue; + if (!element.name || element.dataset.notIni == "true") continue; let value; switch (element.type) { @@ -1234,6 +1247,23 @@ } else { history.replaceState({ page: 'main' }, '', window.location.pathname); } + + const fullscreenElement = document.getElementById('window-fullscreen'); + const windowedElement = document.getElementById('window-windowed'); + + fullscreenElement.addEventListener('change', () => { + if (fullscreenElement.checked) { + document.documentElement.requestFullscreen().catch(err => { + console.error(`Error attempting to enable full-screen mode: ${err.message} (${err.name})`); + }); + } + }); + + windowedElement.addEventListener('change', () => { + if (windowedElement.checked && document.fullscreenElement) { + document.exitFullscreen(); + } + }); });