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:
@@ -36,8 +36,8 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<nav class="m-tabs">
|
<nav class="m-tabs">
|
||||||
<button class="m-tab active" data-view="live"><span class="i">▦</span>Live</button>
|
<!-- одна кнопка: переключает режим Live ⇄ Архив (или/или) -->
|
||||||
<button class="m-tab" data-view="arch"><span class="i">🗄</span>Архив</button>
|
<button class="m-mode" id="m-mode"><span class="i">⇆</span><span class="m-mode-name" id="m-mode-name">Live</span></button>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<script src="/static/mobile.js"></script>
|
<script src="/static/mobile.js"></script>
|
||||||
|
|||||||
@@ -46,14 +46,16 @@ html, body {
|
|||||||
.m-empty { color: #8b93a7; text-align: center; padding: 28px 16px; font-size: 14px; }
|
.m-empty { color: #8b93a7; text-align: center; padding: 28px 16px; font-size: 14px; }
|
||||||
|
|
||||||
.m-tabs {
|
.m-tabs {
|
||||||
flex: none; display: flex; background: #161a22; border-top: 1px solid #272d3a;
|
flex: none; display: flex; justify-content: center; background: #161a22;
|
||||||
padding-bottom: env(safe-area-inset-bottom, 0);
|
border-top: 1px solid #272d3a; padding: 8px 12px;
|
||||||
|
padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
|
||||||
}
|
}
|
||||||
.m-tab {
|
/* одна кнопка-переключатель режима (или/или): показывает текущий режим, тап — меняет */
|
||||||
flex: 1; background: none; border: 0; color: #8b93a7; cursor: pointer;
|
.m-mode {
|
||||||
padding: 9px 0 11px; font-size: 11px; font-family: inherit;
|
display: inline-flex; align-items: center; justify-content: center; gap: 10px;
|
||||||
display: flex; flex-direction: column; align-items: center; gap: 3px;
|
min-width: 190px; background: #1d2230; color: #e6e9ef; border: 1px solid #272d3a;
|
||||||
|
border-radius: 10px; padding: 12px 28px; cursor: pointer;
|
||||||
|
font: 600 15px/1 inherit; letter-spacing: .3px;
|
||||||
}
|
}
|
||||||
.m-tab .i { font-size: 22px; line-height: 1; }
|
.m-mode:active { background: #232a3a; }
|
||||||
.m-tab.active { color: #fff; }
|
.m-mode .i { font-size: 18px; color: #c0392b; }
|
||||||
.m-tab.active .i { color: #c0392b; }
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ async function api(url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const M = {
|
const M = {
|
||||||
cams: [], liveId: null, archId: null, date: null,
|
cams: [], liveId: null, archId: null, date: null, view: "live",
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
let data;
|
let data;
|
||||||
@@ -44,15 +44,16 @@ const M = {
|
|||||||
else if (lv.webkitEnterFullscreen) lv.webkitEnterFullscreen(); // iOS
|
else if (lv.webkitEnterFullscreen) lv.webkitEnterFullscreen(); // iOS
|
||||||
});
|
});
|
||||||
|
|
||||||
document.querySelectorAll(".m-tab").forEach((tb) => {
|
// одна кнопка снизу — переключатель режима (или/или): Live ⇄ Архив
|
||||||
tb.onclick = () => this.showView(tb.dataset.view);
|
document.getElementById("m-mode").onclick = () =>
|
||||||
});
|
this.showView(this.view === "live" ? "arch" : "live");
|
||||||
|
|
||||||
this.showView("live");
|
this.showView("live");
|
||||||
},
|
},
|
||||||
|
|
||||||
showView(v) {
|
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-live").hidden = v !== "live";
|
||||||
document.getElementById("view-arch").hidden = v !== "arch";
|
document.getElementById("view-arch").hidden = v !== "arch";
|
||||||
if (v === "live") { this.stopArch(); this.startLive(); }
|
if (v === "live") { this.stopArch(); this.startLive(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user