Top bar layout, adaptive sidebar menu and custom logo
- logo and DSP choice on the left, menu and buttons on the right - the menu becomes a sidebar when it no longer fits in the top bar (measured, so it works for every language and device name); phones keep the bottom bar with short labels - custom logo in the settings: any PNG/JPG/WebP/SVG is scaled to a 128x128 PNG, shown top left and as the browser icon, stored by the server and in the backup Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a85f62225
commit
cf0adc01fe
6 files changed
+151
-10
No files matched your search
@@ -40,6 +40,8 @@ Control both devices at the same time from your phone, tablet or computer – ov
|
|||||||
of channels on all connected DSPs
|
of channels on all connected DSPs
|
||||||
* **Channel colours** – pick a colour per channel in the settings (line and lightly tinted name in the mixer, channel view,
|
* **Channel colours** – pick a colour per channel in the settings (line and lightly tinted name in the mixer, channel view,
|
||||||
routing and curve overlays); linked channels share one colour, every colour is used once per DSP
|
routing and curve overlays); linked channels share one colour, every colour is used once per DSP
|
||||||
|
* **Custom logo** – your own logo top left and as the browser icon (settings → Logo; PNG/JPG/WebP/SVG, ideally square, ≥ 64×64 px)
|
||||||
|
* **Fits every screen** – menu in the top bar on wide screens, a sidebar when the window gets narrow, a bottom bar on phones
|
||||||
* **Mute all** – one button mutes every channel of every connected DSP; releasing it unmutes only what was open before
|
* **Mute all** – one button mutes every channel of every connected DSP; releasing it unmutes only what was open before
|
||||||
* **Settings backup** – devices, amplifier data, SoundField plan, PIN and remote access in one file
|
* **Settings backup** – devices, amplifier data, SoundField plan, PIN and remote access in one file
|
||||||
* **Device lock** – DSPs locked with their 4-character code (e.g. `A1BA`) are detected on connect and the app asks
|
* **Device lock** – DSPs locked with their 4-character code (e.g. `A1BA`) are detected on connect and the app asks
|
||||||
|
|||||||
@@ -90,6 +90,15 @@ def clean_limiter(data: dict) -> dict:
|
|||||||
return {"amps": amps, "assign": assign, "ref": ref}
|
return {"amps": amps, "assign": assign, "ref": ref}
|
||||||
|
|
||||||
|
|
||||||
|
LOGO_MAX = 300_000 # characters of the data URL (the app sends a 128×128 PNG)
|
||||||
|
|
||||||
|
|
||||||
|
def clean_logo(v) -> str:
|
||||||
|
"""Custom logo as a PNG data URL, "" = the built-in one."""
|
||||||
|
v = str(v or "")
|
||||||
|
return v if v.startswith("data:image/png;base64,") and len(v) <= LOGO_MAX and re.fullmatch(r"[\w+/=]*", v[22:]) else ""
|
||||||
|
|
||||||
|
|
||||||
SF_ROLES = ("main", "sub", "delay", "fill")
|
SF_ROLES = ("main", "sub", "delay", "fill")
|
||||||
|
|
||||||
|
|
||||||
@@ -171,6 +180,7 @@ class App:
|
|||||||
self.failures: dict[str, tuple[int, float]] = {} # ip -> (failed attempts, locked until)
|
self.failures: dict[str, tuple[int, float]] = {} # ip -> (failed attempts, locked until)
|
||||||
self.limiter: dict = clean_limiter({})
|
self.limiter: dict = clean_limiter({})
|
||||||
self.soundfield: dict = clean_soundfield({})
|
self.soundfield: dict = clean_soundfield({})
|
||||||
|
self.logo = ""
|
||||||
# desktop app: its own window logs in with a one-time token, other devices need the PIN
|
# desktop app: its own window logs in with a one-time token, other devices need the PIN
|
||||||
self.app_token: str | None = None
|
self.app_token: str | None = None
|
||||||
self.app_sessions: set[str] = set()
|
self.app_sessions: set[str] = set()
|
||||||
@@ -217,6 +227,8 @@ class App:
|
|||||||
self.limiter = clean_limiter(cfg.get("limiter") or {})
|
self.limiter = clean_limiter(cfg.get("limiter") or {})
|
||||||
if "soundfield" in cfg:
|
if "soundfield" in cfg:
|
||||||
self.soundfield = clean_soundfield(cfg.get("soundfield"))
|
self.soundfield = clean_soundfield(cfg.get("soundfield"))
|
||||||
|
if "logo" in cfg:
|
||||||
|
self.logo = clean_logo(cfg.get("logo"))
|
||||||
r = cfg.get("remote") or {}
|
r = cfg.get("remote") or {}
|
||||||
self.remote = {"enabled": bool(r.get("enabled")), "port": int(_num(r.get("port"), 1, 65535, 8080))}
|
self.remote = {"enabled": bool(r.get("enabled")), "port": int(_num(r.get("port"), 1, 65535, 8080))}
|
||||||
for d in cfg.get("devices", [])[:20]:
|
for d in cfg.get("devices", [])[:20]:
|
||||||
@@ -230,7 +242,7 @@ class App:
|
|||||||
"""App backup: devices, PIN (hashed), amplifiers/limiter data, remote access - no logins."""
|
"""App backup: devices, PIN (hashed), amplifiers/limiter data, remote access - no logins."""
|
||||||
return {"format": CONFIG_FORMAT, "version": 1, "exported": time.strftime("%Y-%m-%dT%H:%M:%S"),
|
return {"format": CONFIG_FORMAT, "version": 1, "exported": time.strftime("%Y-%m-%dT%H:%M:%S"),
|
||||||
"devices": [d.config() for d in self.real_devices()], "auth": self.auth,
|
"devices": [d.config() for d in self.real_devices()], "auth": self.auth,
|
||||||
"limiter": self.limiter, "remote": self.remote, "soundfield": self.soundfield}
|
"limiter": self.limiter, "remote": self.remote, "soundfield": self.soundfield, "logo": self.logo}
|
||||||
|
|
||||||
async def restore_config(self, doc: dict, session: str):
|
async def restore_config(self, doc: dict, session: str):
|
||||||
if not isinstance(doc, dict) or doc.get("format") != CONFIG_FORMAT:
|
if not isinstance(doc, dict) or doc.get("format") != CONFIG_FORMAT:
|
||||||
@@ -248,6 +260,7 @@ class App:
|
|||||||
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
|
self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()})
|
||||||
self.broadcast({"type": "limiter", "data": self.limiter})
|
self.broadcast({"type": "limiter", "data": self.limiter})
|
||||||
self.broadcast({"type": "soundfield", "data": self.soundfield})
|
self.broadcast({"type": "soundfield", "data": self.soundfield})
|
||||||
|
self.broadcast({"type": "logo", "data": self.logo})
|
||||||
if self.app_token: # desktop app: (re)start or stop the LAN listener as restored
|
if self.app_token: # desktop app: (re)start or stop the LAN listener as restored
|
||||||
await self.start_remote()
|
await self.start_remote()
|
||||||
|
|
||||||
@@ -287,7 +300,7 @@ class App:
|
|||||||
sessions = {k: v for k, v in self.sessions.items() if k not in self.app_sessions}
|
sessions = {k: v for k, v in self.sessions.items() if k not in self.app_sessions}
|
||||||
cfg = {"devices": [d.config() for d in self.real_devices()], "auth": self.auth,
|
cfg = {"devices": [d.config() for d in self.real_devices()], "auth": self.auth,
|
||||||
"sessions": sessions, "limiter": self.limiter, "remote": self.remote, "locked": self.locked,
|
"sessions": sessions, "limiter": self.limiter, "remote": self.remote, "locked": self.locked,
|
||||||
"soundfield": self.soundfield,
|
"soundfield": self.soundfield, "logo": self.logo,
|
||||||
"mute_all": {"active": self.mute_all["active"],
|
"mute_all": {"active": self.mute_all["active"],
|
||||||
"restore": {k: v for k, v in self.mute_all["restore"].items() if k != "demo"}}}
|
"restore": {k: v for k, v in self.mute_all["restore"].items() if k != "demo"}}}
|
||||||
if self.lang:
|
if self.lang:
|
||||||
@@ -665,6 +678,15 @@ class App:
|
|||||||
return [d.snapshot() for d in self.devices.values()]
|
return [d.snapshot() for d in self.devices.values()]
|
||||||
if path == "/api/devices" and method == "POST":
|
if path == "/api/devices" and method == "POST":
|
||||||
return self.add_device(body).snapshot()
|
return self.add_device(body).snapshot()
|
||||||
|
if path == "/api/logo" and method == "PUT":
|
||||||
|
self.logo = clean_logo(body.get("logo"))
|
||||||
|
if body.get("logo") and not self.logo:
|
||||||
|
raise ValueError("The logo could not be read")
|
||||||
|
self.save()
|
||||||
|
self.broadcast({"type": "logo", "data": self.logo})
|
||||||
|
return {"logo": self.logo}
|
||||||
|
if path == "/api/logo":
|
||||||
|
return {"logo": self.logo}
|
||||||
if path == "/api/soundfield" and method == "PUT":
|
if path == "/api/soundfield" and method == "PUT":
|
||||||
self.soundfield = clean_soundfield(body)
|
self.soundfield = clean_soundfield(body)
|
||||||
self.save()
|
self.save()
|
||||||
@@ -951,7 +973,7 @@ class App:
|
|||||||
self.clients.add(q)
|
self.clients.add(q)
|
||||||
try:
|
try:
|
||||||
hello = {"type": "hello", "devices": [d.snapshot() for d in self.devices.values()], "limiter": self.limiter,
|
hello = {"type": "hello", "devices": [d.snapshot() for d in self.devices.values()], "limiter": self.limiter,
|
||||||
"demo": self.demo_info(), "muteall": self.mute_all_info(), "soundfield": self.soundfield}
|
"demo": self.demo_info(), "muteall": self.mute_all_info(), "soundfield": self.soundfield, "logo": self.logo}
|
||||||
writer.write(f"data: {json.dumps(hello)}\n\n".encode())
|
writer.write(f"data: {json.dumps(hello)}\n\n".encode())
|
||||||
await writer.drain()
|
await writer.drain()
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
+75
-3
@@ -249,7 +249,7 @@ async function saveFile(name, obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -> { name, b64, json } (json = parsed content if the file is JSON, else null), or null if cancelled
|
// -> { name, b64, json } (json = parsed content if the file is JSON, else null), or null if cancelled
|
||||||
async function openFile() {
|
async function openFile(accept = ".json,.bin,application/json,application/octet-stream") {
|
||||||
let name, bytes;
|
let name, bytes;
|
||||||
const papi = window.pywebview && window.pywebview.api;
|
const papi = window.pywebview && window.pywebview.api;
|
||||||
if (papi && papi.open_file) {
|
if (papi && papi.open_file) {
|
||||||
@@ -258,7 +258,7 @@ async function openFile() {
|
|||||||
name = f.name; bytes = Uint8Array.from(atob(f.data), c => c.charCodeAt(0));
|
name = f.name; bytes = Uint8Array.from(atob(f.data), c => c.charCodeAt(0));
|
||||||
} else {
|
} else {
|
||||||
const file = await new Promise(resolve => {
|
const file = await new Promise(resolve => {
|
||||||
const inp = h("input", { type: "file", accept: ".json,.bin,application/json,application/octet-stream", hidden: true });
|
const inp = h("input", { type: "file", accept, hidden: true });
|
||||||
inp.addEventListener("change", () => resolve(inp.files[0] || null));
|
inp.addEventListener("change", () => resolve(inp.files[0] || null));
|
||||||
document.body.append(inp); inp.click(); setTimeout(() => inp.remove(), 60000);
|
document.body.append(inp); inp.click(); setTimeout(() => inp.remove(), 60000);
|
||||||
});
|
});
|
||||||
@@ -572,6 +572,7 @@ function renderTabs() {
|
|||||||
b.classList.toggle("active", !S.settings && b.dataset.view === S.view);
|
b.classList.toggle("active", !S.settings && b.dataset.view === S.view);
|
||||||
b.disabled = testLock && b.dataset.view !== "test";
|
b.disabled = testLock && b.dataset.view !== "test";
|
||||||
});
|
});
|
||||||
|
fitNav(); // the DSP button's width changes with the name
|
||||||
}
|
}
|
||||||
// close the DSP menu on a click elsewhere or Escape
|
// close the DSP menu on a click elsewhere or Escape
|
||||||
document.addEventListener("pointerdown", e => { if (S.devMenu && !e.target.closest("#devtabs")) { S.devMenu = false; renderTabs(); } });
|
document.addEventListener("pointerdown", e => { if (S.devMenu && !e.target.closest("#devtabs")) { S.devMenu = false; renderTabs(); } });
|
||||||
@@ -1923,6 +1924,60 @@ function pinCard() {
|
|||||||
: t("The default PIN is 1234. After changing it only this device stays logged in.")));
|
: t("The default PIN is 1234. After changing it only this device stays logged in.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------ custom logo (top left and browser icon)
|
||||||
|
|
||||||
|
const LOGO_PX = 128, LOGO_MIN = 64;
|
||||||
|
const DEFAULT_LOGO = $(".brand").innerHTML;
|
||||||
|
function showLogo() {
|
||||||
|
const b = $(".brand");
|
||||||
|
b.replaceChildren();
|
||||||
|
if (S.logo) b.append(h("img", { src: S.logo, alt: "", width: 26, height: 26 }));
|
||||||
|
else b.innerHTML = DEFAULT_LOGO;
|
||||||
|
let icon = document.querySelector("link[rel=icon]");
|
||||||
|
if (!icon) { icon = h("link", { rel: "icon" }); document.head.append(icon); }
|
||||||
|
if (S.logo) icon.href = S.logo; else icon.removeAttribute("href");
|
||||||
|
}
|
||||||
|
|
||||||
|
// any picture -> 128×128 PNG, centred without distortion (transparent where it isn't square)
|
||||||
|
async function logoFromFile() {
|
||||||
|
const f = await openFile(".png,.jpg,.jpeg,.webp,.svg,.gif,image/*");
|
||||||
|
if (!f) return null;
|
||||||
|
const ext = (f.name.split(".").pop() || "").toLowerCase();
|
||||||
|
const mime = { png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", webp: "image/webp", gif: "image/gif", svg: "image/svg+xml" }[ext];
|
||||||
|
if (!mime) throw new Error(t("Please choose a PNG, JPG, WebP or SVG image"));
|
||||||
|
const img = new Image();
|
||||||
|
await new Promise((ok, bad) => { img.onload = ok; img.onerror = () => bad(new Error(t("The logo could not be read"))); img.src = `data:${mime};base64,${f.b64}`; });
|
||||||
|
const w = img.naturalWidth || LOGO_PX, hh = img.naturalHeight || LOGO_PX; // SVGs without a size count as fine
|
||||||
|
if (mime !== "image/svg+xml" && (w < LOGO_MIN || hh < LOGO_MIN)) throw new Error(t("The image is too small – at least {n}×{n} pixels", { n: LOGO_MIN }));
|
||||||
|
const cv = h("canvas", { width: LOGO_PX, height: LOGO_PX }), g = cv.getContext("2d"), sc = Math.min(LOGO_PX / w, LOGO_PX / hh);
|
||||||
|
g.imageSmoothingQuality = "high";
|
||||||
|
g.drawImage(img, (LOGO_PX - w * sc) / 2, (LOGO_PX - hh * sc) / 2, w * sc, hh * sc);
|
||||||
|
return { url: cv.toDataURL("image/png"), square: Math.abs(w - hh) <= Math.max(w, hh) * 0.02 };
|
||||||
|
}
|
||||||
|
|
||||||
|
function logoCard() {
|
||||||
|
const preview = h("div", { class: "logoprev" });
|
||||||
|
if (S.logo) preview.append(h("img", { src: S.logo, alt: "" })); else preview.innerHTML = DEFAULT_LOGO;
|
||||||
|
const set = async logo => {
|
||||||
|
try { S.logo = (await api("PUT", "/api/logo", { logo })).logo; showLogo(); render(); }
|
||||||
|
catch (e) { toast(t("Error: ") + trMsg(e.message)); }
|
||||||
|
};
|
||||||
|
return h("div", { class: "card" }, h("h3", {}, t("Logo")),
|
||||||
|
h("div", { class: "row logorow" }, preview,
|
||||||
|
h("div", { class: "grow" },
|
||||||
|
h("p", { class: "info" }, t("Your own logo top left (and as the browser icon). PNG, JPG, WebP or SVG, ideally square, at least 64×64 pixels, transparent background recommended. It is scaled to 128×128 pixels; other shapes are centred without distortion.")))),
|
||||||
|
h("div", { class: "actions" },
|
||||||
|
h("button", { class: "on", onclick: async () => {
|
||||||
|
try {
|
||||||
|
const r = await logoFromFile();
|
||||||
|
if (!r) return;
|
||||||
|
await set(r.url);
|
||||||
|
toast(r.square ? t("Logo replaced") : t("Logo replaced – the image was not square and has been centred"));
|
||||||
|
} catch (e) { toast(trMsg(e.message)); }
|
||||||
|
} }, t("Choose image…")),
|
||||||
|
S.logo ? h("button", { onclick: () => set("") }, t("Default logo")) : null));
|
||||||
|
}
|
||||||
|
|
||||||
// Language per device (stored in the browser); the desktop app also tells the server, for its own dialogs
|
// Language per device (stored in the browser); the desktop app also tells the server, for its own dialogs
|
||||||
function langCard() {
|
function langCard() {
|
||||||
const set = async lang => {
|
const set = async lang => {
|
||||||
@@ -1938,7 +1993,7 @@ function langCard() {
|
|||||||
|
|
||||||
function viewSettings() {
|
function viewSettings() {
|
||||||
return [
|
return [
|
||||||
h("div", { class: "cards" }, langCard(), demoCard()),
|
h("div", { class: "cards" }, langCard(), demoCard(), logoCard()),
|
||||||
h("h2", { class: "section" }, t("Devices")),
|
h("h2", { class: "section" }, t("Devices")),
|
||||||
h("div", { class: "cards" }, ...S.order.filter(id => !S.devices[id].demo).map(id => deviceForm(S.devices[id])), deviceForm(null)),
|
h("div", { class: "cards" }, ...S.order.filter(id => !S.devices[id].demo).map(id => deviceForm(S.devices[id])), deviceForm(null)),
|
||||||
h("p", { class: "info" }, t("Both DSPs can be connected at the same time – switch between them at the top. "),
|
h("p", { class: "info" }, t("Both DSPs can be connected at the same time – switch between them at the top. "),
|
||||||
@@ -2000,6 +2055,20 @@ document.querySelectorAll("#viewtabs button").forEach(b => b.addEventListener("c
|
|||||||
}));
|
}));
|
||||||
$("#btn-settings").addEventListener("click", () => { if (testOn(dev())) return; S.settings = !S.settings; render(); window.scrollTo(0, 0); });
|
$("#btn-settings").addEventListener("click", () => { if (testOn(dev())) return; S.settings = !S.settings; render(); window.scrollTo(0, 0); });
|
||||||
|
|
||||||
|
// menu at the top while it fits next to the DSP choice, otherwise a sidebar on the left (phones: bottom bar)
|
||||||
|
function fitNav() {
|
||||||
|
const top = $("#top"), b = document.body;
|
||||||
|
if (window.innerWidth < 760) { b.classList.remove("navside"); return; }
|
||||||
|
b.classList.remove("navside"); // measure the one-row layout (no paint happens in between)
|
||||||
|
const kids = [...top.children].filter(el => !el.hidden && getComputedStyle(el).display !== "none");
|
||||||
|
const cs = getComputedStyle(top), gap = parseFloat(cs.columnGap) || 0;
|
||||||
|
// natural widths: the DSP button may be squeezed by flexbox, so take its content width
|
||||||
|
const need = kids.reduce((w, el) => w + (el.id === "devtabs" ? el.scrollWidth : el.getBoundingClientRect().width), 0)
|
||||||
|
+ gap * (kids.length - 1) + parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight);
|
||||||
|
if (need > top.clientWidth + 1) b.classList.add("navside");
|
||||||
|
}
|
||||||
|
window.addEventListener("resize", fitNav);
|
||||||
|
|
||||||
// header / status bar heights -> CSS vars (sticky channel bar, fader height that fits the screen)
|
// header / status bar heights -> CSS vars (sticky channel bar, fader height that fits the screen)
|
||||||
new ResizeObserver(() => {
|
new ResizeObserver(() => {
|
||||||
document.documentElement.style.setProperty("--hdr", $("#top").offsetHeight + "px");
|
document.documentElement.style.setProperty("--hdr", $("#top").offsetHeight + "px");
|
||||||
@@ -2074,6 +2143,7 @@ function connectEvents() {
|
|||||||
if (ev.demo) S.demo = ev.demo;
|
if (ev.demo) S.demo = ev.demo;
|
||||||
if (ev.muteall) { S.muteAll = ev.muteall.active; showMuteAll(); }
|
if (ev.muteall) { S.muteAll = ev.muteall.active; showMuteAll(); }
|
||||||
if (ev.soundfield) S.sf = ev.soundfield;
|
if (ev.soundfield) S.sf = ev.soundfield;
|
||||||
|
if ("logo" in ev) { S.logo = ev.logo; showLogo(); }
|
||||||
if (S.demo.enabled && S.devices.demo && !S.devices[S.cur]?.demo) S.cur = "demo";
|
if (S.demo.enabled && S.devices.demo && !S.devices[S.cur]?.demo) S.cur = "demo";
|
||||||
S.order.forEach(id => maybeAskUnlock(S.devices[id]));
|
S.order.forEach(id => maybeAskUnlock(S.devices[id]));
|
||||||
if (!S.order.length) S.settings = true;
|
if (!S.order.length) S.settings = true;
|
||||||
@@ -2103,6 +2173,8 @@ function connectEvents() {
|
|||||||
}
|
}
|
||||||
case "soundfield":
|
case "soundfield":
|
||||||
sfOnRemote(ev.data); break;
|
sfOnRemote(ev.data); break;
|
||||||
|
case "logo":
|
||||||
|
S.logo = ev.data; showLogo(); if (S.settings) render(); break;
|
||||||
case "muteall":
|
case "muteall":
|
||||||
S.muteAll = ev.data.active; showMuteAll(); break;
|
S.muteAll = ev.data.active; showMuteAll(); break;
|
||||||
case "demo":
|
case "demo":
|
||||||
|
|||||||
@@ -455,6 +455,17 @@ const DE = {
|
|||||||
"Sub with a top on a distance pole": "Sub mit Top auf Distanzstange",
|
"Sub with a top on a distance pole": "Sub mit Top auf Distanzstange",
|
||||||
"Add a DSP…": "DSP hinzufügen…",
|
"Add a DSP…": "DSP hinzufügen…",
|
||||||
"simulated": "simuliert",
|
"simulated": "simuliert",
|
||||||
|
// logo
|
||||||
|
"Logo": "Logo",
|
||||||
|
"Your own logo top left (and as the browser icon). PNG, JPG, WebP or SVG, ideally square, at least 64×64 pixels, transparent background recommended. It is scaled to 128×128 pixels; other shapes are centred without distortion.": "Eigenes Logo oben links (und als Browser-Symbol). PNG, JPG, WebP oder SVG, am besten quadratisch, mindestens 64×64 Pixel, transparenter Hintergrund empfohlen. Es wird auf 128×128 Pixel skaliert; andere Formate werden unverzerrt zentriert.",
|
||||||
|
"Choose image…": "Bild wählen…",
|
||||||
|
"Default logo": "Standard-Logo",
|
||||||
|
"Logo replaced": "Logo ersetzt",
|
||||||
|
"Logo replaced – the image was not square and has been centred": "Logo ersetzt – das Bild war nicht quadratisch und wurde zentriert",
|
||||||
|
"Please choose a PNG, JPG, WebP or SVG image": "Bitte ein PNG-, JPG-, WebP- oder SVG-Bild wählen",
|
||||||
|
"The logo could not be read": "Das Logo konnte nicht gelesen werden",
|
||||||
|
"The image is too small – at least {n}×{n} pixels": "Das Bild ist zu klein – mindestens {n}×{n} Pixel",
|
||||||
|
"Test": "Test",
|
||||||
};
|
};
|
||||||
|
|
||||||
const DE_PATTERNS = [
|
const DE_PATTERNS = [
|
||||||
|
|||||||
+2
-2
@@ -25,8 +25,8 @@
|
|||||||
<button data-view="routing"><svg viewBox="0 0 24 24"><path d="M4 6h16M4 12h16M4 18h16M8 3v18M16 3v18"/><circle cx="8" cy="6" r="2.2" class="f"/><circle cx="16" cy="12" r="2.2" class="f"/><circle cx="8" cy="18" r="2.2" class="f"/></svg><span>Routing</span></button>
|
<button data-view="routing"><svg viewBox="0 0 24 24"><path d="M4 6h16M4 12h16M4 18h16M8 3v18M16 3v18"/><circle cx="8" cy="6" r="2.2" class="f"/><circle cx="16" cy="12" r="2.2" class="f"/><circle cx="8" cy="18" r="2.2" class="f"/></svg><span>Routing</span></button>
|
||||||
<button data-view="link"><svg viewBox="0 0 24 24"><path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1"/><path d="M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/></svg><span>Link</span></button>
|
<button data-view="link"><svg viewBox="0 0 24 24"><path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1"/><path d="M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/></svg><span>Link</span></button>
|
||||||
<button data-view="limiter"><svg viewBox="0 0 24 24"><path d="M2 7h20" stroke-dasharray="2.5 2.5"/><path d="M2 14c2 0 3-7 5-7h3c2 0 3 11 6 11s3-5 6-5"/></svg><span>Limiter</span></button>
|
<button data-view="limiter"><svg viewBox="0 0 24 24"><path d="M2 7h20" stroke-dasharray="2.5 2.5"/><path d="M2 14c2 0 3-7 5-7h3c2 0 3 11 6 11s3-5 6-5"/></svg><span>Limiter</span></button>
|
||||||
<button data-view="soundfield"><svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M8 7l-2 2 2 2M16 7l2 2-2 2"/><path d="M7 15.5a7 7 0 0 1 10 0" stroke-dasharray="2 2"/><circle cx="12" cy="18" r="1.2" class="f"/></svg><span>SoundField</span></button>
|
<button data-view="soundfield"><svg viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M8 7l-2 2 2 2M16 7l2 2-2 2"/><path d="M7 15.5a7 7 0 0 1 10 0" stroke-dasharray="2 2"/><circle cx="12" cy="18" r="1.2" class="f"/></svg><span>SoundField</span><span class="short">Field</span></button>
|
||||||
<button data-view="test"><svg viewBox="0 0 24 24"><path d="M4 9v6h4l5 4V5L8 9z"/><path d="M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12"/></svg><span data-t="Audio test">Audio test</span></button>
|
<button data-view="test"><svg viewBox="0 0 24 24"><path d="M4 9v6h4l5 4V5L8 9z"/><path d="M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12"/></svg><span data-t="Audio test">Audio test</span><span class="short" data-t="Test">Test</span></button>
|
||||||
</nav>
|
</nav>
|
||||||
<button id="btn-muteall" class="icon" aria-label="Mute all" title="Mute all"></button>
|
<button id="btn-muteall" class="icon" aria-label="Mute all" title="Mute all"></button>
|
||||||
<button id="btn-lock" class="icon" hidden aria-label="Lock" title="Lock"></button>
|
<button id="btn-lock" class="icon" hidden aria-label="Lock" title="Lock"></button>
|
||||||
|
|||||||
+36
-2
@@ -79,7 +79,8 @@ label.inline { display: flex; align-items: center; gap: 8px; font-size: 13px; co
|
|||||||
.dot.error { background: var(--bad); }
|
.dot.error { background: var(--bad); }
|
||||||
@keyframes blink { 50% { opacity: .3; } }
|
@keyframes blink { 50% { opacity: .3; } }
|
||||||
|
|
||||||
#viewtabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 3px; flex: none; }
|
#viewtabs { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 3px; flex: none;
|
||||||
|
margin-left: auto; } /* logo + DSP choice on the left, menu and buttons on the right */
|
||||||
#viewtabs button { border: 0; background: none; min-height: 36px; padding: 6px 14px; color: var(--dim); border-radius: 8px; }
|
#viewtabs button { border: 0; background: none; min-height: 36px; padding: 6px 14px; color: var(--dim); border-radius: 8px; }
|
||||||
#viewtabs button svg { width: 18px; height: 18px; }
|
#viewtabs button svg { width: 18px; height: 18px; }
|
||||||
#viewtabs button svg .f { fill: currentColor; stroke: none; }
|
#viewtabs button svg .f { fill: currentColor; stroke: none; }
|
||||||
@@ -100,7 +101,8 @@ body[data-view=settings] #viewtabs button.active { background: none; color: var(
|
|||||||
/* phones: view switcher becomes a bottom navigation bar */
|
/* phones: view switcher becomes a bottom navigation bar */
|
||||||
@media (max-width: 759px) {
|
@media (max-width: 759px) {
|
||||||
:root { --bnav: calc(62px + env(safe-area-inset-bottom)); }
|
:root { --bnav: calc(62px + env(safe-area-inset-bottom)); }
|
||||||
.brand { display: none; }
|
.brand img, .brand svg { width: 24px; height: 24px; }
|
||||||
|
#btn-muteall { margin-left: auto; } /* the menu moved to the bottom bar: buttons stay on the right */
|
||||||
/* backdrop-filter would make the header the containing block of the fixed bottom bar */
|
/* backdrop-filter would make the header the containing block of the fixed bottom bar */
|
||||||
#top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
|
#top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
|
||||||
#viewtabs {
|
#viewtabs {
|
||||||
@@ -607,3 +609,35 @@ button.devitem .dn { flex: 1; text-align: left; overflow: hidden; text-overflow:
|
|||||||
button.devitem .where { font-size: 11px; color: var(--dim); }
|
button.devitem .where { font-size: 11px; color: var(--dim); }
|
||||||
button.devitem small { font-size: 11px; color: var(--dim); background: var(--panel3); border-radius: 5px; padding: 1px 5px; }
|
button.devitem small { font-size: 11px; color: var(--dim); background: var(--panel3); border-radius: 5px; padding: 1px 5px; }
|
||||||
button.devitem.paused, button.devitem:disabled { opacity: .45; cursor: not-allowed; }
|
button.devitem.paused, button.devitem:disabled { opacity: .45; cursor: not-allowed; }
|
||||||
|
|
||||||
|
/* ---- custom logo */
|
||||||
|
.brand img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; display: block; }
|
||||||
|
.logorow { align-items: flex-start; gap: 14px; }
|
||||||
|
.logoprev { width: 72px; height: 72px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 12px;
|
||||||
|
background: repeating-conic-gradient(#ffffff10 0 25%, transparent 0 50%) 0 0 / 14px 14px, var(--panel2); border: 1px solid var(--line); }
|
||||||
|
.logoprev img, .logoprev svg { width: 56px; height: 56px; object-fit: contain; }
|
||||||
|
|
||||||
|
/* ---- menu as a sidebar when the top bar is too narrow (tablets, small windows) */
|
||||||
|
:root { --side: 92px; }
|
||||||
|
@media (min-width: 760px) {
|
||||||
|
body.navside #viewtabs { position: fixed; top: var(--hdr); left: 0; bottom: 0; width: var(--side); z-index: 15; margin: 0;
|
||||||
|
flex-direction: column; gap: 4px; padding: 8px 6px max(8px, env(safe-area-inset-bottom)); overflow-y: auto;
|
||||||
|
border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--panel); }
|
||||||
|
body.navside #viewtabs button { flex-direction: column; gap: 4px; width: 100%; min-height: 60px; padding: 8px 4px; font-size: 11px;
|
||||||
|
line-height: 1.15; text-align: center; white-space: normal; }
|
||||||
|
body.navside #viewtabs button svg { width: 22px; height: 22px; }
|
||||||
|
body.navside #statusbar, body.navside #main { margin-left: var(--side); }
|
||||||
|
body.navside #main { max-width: none; }
|
||||||
|
body.navside #btn-muteall { margin-left: auto; }
|
||||||
|
/* backdrop-filter would make the header the containing block of the fixed sidebar */
|
||||||
|
body.navside #top { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
|
||||||
|
}
|
||||||
|
/* phones: all menu items fit in the bottom bar, long labels are shortened */
|
||||||
|
@media (max-width: 759px) {
|
||||||
|
#viewtabs button { min-width: 0; font-size: 10px; letter-spacing: 0; }
|
||||||
|
#viewtabs button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||||
|
#viewtabs button:has(.short) > span:not(.short) { display: none; } /* long labels: short form in the bottom bar */
|
||||||
|
#viewtabs button span.short { display: inline; }
|
||||||
|
}
|
||||||
|
#viewtabs button .short { display: none; }
|
||||||
|
.logorow + .actions { margin-top: 12px; }
|
||||||
Reference in new issue
Block a user