mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
feat: kiosk-mode hides server, agents, guardian panels + HA/agents/memory/proxmox from bottom bar
- Adds body.kiosk-mode class on fullscreen entry/exit - Hides: #server-panel, #tab-agents, #tab-guardian, tab buttons - Hides bottom bar: Home Assistant, Agents, Memory, Proxmox - Falls back to INTEL tab if agents/guardian was active on kiosk entry - All elements remain visible in normal/tablet mode
This commit is contained in:
@@ -1364,3 +1364,23 @@ body.tablet-mode .alert-item { font-size:0.75rem; padding:9px 11px; }
|
||||
|
||||
/* ── BOTTOM BAR ─────────────────────────────────────────────────── */
|
||||
body.tablet-mode #bottomBar { font-size:0.7rem; height:34px; }
|
||||
|
||||
/* ════════════════════════════════════════════════════════════════════════
|
||||
KIOSK MODE — hide noisy panels, keep it clean on Fire tablet
|
||||
Only active when body.kiosk-mode (fullscreen + tablet)
|
||||
════════════════════════════════════════════════════════════════════════ */
|
||||
|
||||
/* Hide server stats, agents tab, guardian tab in kiosk */
|
||||
body.kiosk-mode #server-panel { display:none !important; }
|
||||
body.kiosk-mode #tab-btn-agents { display:none !important; }
|
||||
body.kiosk-mode #tab-btn-guardian { display:none !important; }
|
||||
body.kiosk-mode #tab-agents { display:none !important; }
|
||||
body.kiosk-mode #tab-guardian { display:none !important; }
|
||||
|
||||
/* Hide bottom bar: Home Assistant, Agents, Memory, Proxmox */
|
||||
body.kiosk-mode #bb-ha-item { display:none !important; }
|
||||
body.kiosk-mode #bb-agents-item { display:none !important; }
|
||||
body.kiosk-mode #bb-memory-item { display:none !important; }
|
||||
body.kiosk-mode #bb-pve-item { display:none !important; }
|
||||
|
||||
/* If agents or guardian was the active tab, switch to intel */
|
||||
|
||||
@@ -1783,11 +1783,18 @@ async function toggleKiosk() {
|
||||
if ("wakeLock" in navigator) {
|
||||
try { _wakeLock = await navigator.wakeLock.request("screen"); } catch(e) {}
|
||||
}
|
||||
document.body.classList.add("kiosk-mode");
|
||||
// Switch away from hidden tabs if one is active
|
||||
const activeTab = document.querySelector(".tab-pane.active");
|
||||
if (activeTab && (activeTab.id === "tab-agents" || activeTab.id === "tab-guardian")) {
|
||||
switchTab("intel");
|
||||
}
|
||||
if (btn) { btn.textContent = "⧞ EXIT"; btn.style.color = "var(--cyan)"; }
|
||||
} else {
|
||||
const ex = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen;
|
||||
if (ex) ex.call(document).catch(() => {});
|
||||
if (_wakeLock) { _wakeLock.release().catch(() => {}); _wakeLock = null; }
|
||||
document.body.classList.remove("kiosk-mode");
|
||||
if (btn) { btn.textContent = "⧞ KIOSK"; btn.style.color = ""; }
|
||||
if (!isTablet()) document.body.classList.remove("tablet-mode");
|
||||
}
|
||||
@@ -1803,6 +1810,7 @@ function _onFsChange() {
|
||||
const btn = document.getElementById("kioskBtn");
|
||||
if (!document.fullscreenElement && !document.webkitFullscreenElement) {
|
||||
if (_wakeLock) { _wakeLock.release().catch(() => {}); _wakeLock = null; }
|
||||
document.body.classList.remove("kiosk-mode");
|
||||
if (btn) { btn.textContent = "⧞ KIOSK"; btn.style.color = ""; }
|
||||
if (!isTablet()) document.body.classList.remove("tablet-mode");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user