mobile: one mode-toggle button instead of two bottom tabs

Replace the two-tab bottom bar (Live / Архив) with a single centered
toggle button. It switches the mode either/or: shows the current mode
with a swap glyph (⇆), tap flips Live ⇄ Архив.

VERSION 0.0.150 -> 0.0.151

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 23:49:02 +05:00
parent c91f82bf28
commit 126b588dc7
4 changed files with 20 additions and 17 deletions
+6 -5
View File
@@ -14,7 +14,7 @@ async function api(url) {
}
const M = {
cams: [], liveId: null, archId: null, date: null,
cams: [], liveId: null, archId: null, date: null, view: "live",
async init() {
let data;
@@ -44,15 +44,16 @@ const M = {
else if (lv.webkitEnterFullscreen) lv.webkitEnterFullscreen(); // iOS
});
document.querySelectorAll(".m-tab").forEach((tb) => {
tb.onclick = () => this.showView(tb.dataset.view);
});
// одна кнопка снизу — переключатель режима (или/или): Live ⇄ Архив
document.getElementById("m-mode").onclick = () =>
this.showView(this.view === "live" ? "arch" : "live");
this.showView("live");
},
showView(v) {
document.querySelectorAll(".m-tab").forEach((t) => t.classList.toggle("active", t.dataset.view === v));
this.view = v;
document.getElementById("m-mode-name").textContent = v === "live" ? "Live" : "Архив";
document.getElementById("view-live").hidden = v !== "live";
document.getElementById("view-arch").hidden = v !== "arch";
if (v === "live") { this.stopArch(); this.startLive(); }