diff --git a/static/app.js b/static/app.js index c392fce..72056a8 100644 --- a/static/app.js +++ b/static/app.js @@ -1532,10 +1532,13 @@ function viewRouting(d) { h("span", { class: "chev" }, open ? "▴" : "▾"))); ins.forEach((_, i) => { const on = oc.matrix >> i & 1; - grid.append(h("button", { class: "xp" + (on ? " on" : ""), style: `--cc:${inColor(d, i)}`, + const fx = S.xpFx === `${d.id}|${o}|${i}`; // just switched: short animation, once + if (fx) S.xpFx = null; + grid.append(h("button", { class: "xp" + (on ? " on" : "") + (fx ? " fx" : ""), style: `--cc:${inColor(d, i)}`, "aria-label": `${chLabel("in", i)} → ${chLabel("out", o)}`, "aria-pressed": String(!!on), onclick: () => { const m = chans(dev(), "out")[o].matrix ^ (1 << i); + S.xpFx = `${d.id}|${o}|${i}`; setParam("out", o, "matrix", m); render(); } }, h("span", { class: "node" }), on ? h("small", { title: `${sign(gainDb(oc.mix[i]))} dB` }, gainDb(oc.mix[i]) === 0 ? "0" : sign(gainDb(oc.mix[i]))) : null)); }); @@ -2239,13 +2242,12 @@ function backupCard() { } // Desktop app only: let phones/tablets on the LAN use this PC as server (they need the PIN) -function lockOptionCard() { +function lockOption() { const box = h("input", { type: "checkbox", checked: !!S.lockDash, onchange: async () => { try { S.lockDash = (await api("POST", "/api/lock-dash", { enabled: box.checked })).enabled; } catch (e) { box.checked = !!S.lockDash; toast(t("Error: ") + trMsg(e.message)); } } }); - return h("div", { class: "card" }, h("h3", {}, t("Lock")), - h("label", { class: "chk" }, box, t("Only show dashboard while locked")), + return h("div", { class: "lockopt" }, h("label", { class: "chk" }, box, t("Only show dashboard while locked")), h("p", { class: "info" }, t("With the lock on, this window then shows just your dashboard, until it is unlocked with the PIN."))); } @@ -2297,7 +2299,8 @@ function pinCard() { S.isApp ? null : h("button", { onclick: logout }, svgIcon(ICON.logout), t(" Log out")))), h("p", { class: "info" }, S.isApp ? t("This app needs no PIN. The default is 1234; changing it logs out all phones.") - : 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.")), + S.isApp ? lockOption() : null); } // ------------------------------------------------------------------ custom logo (top left and browser icon) @@ -2414,7 +2417,7 @@ function viewSettings() { ["devices", t("Devices"), t("Several DSPs can be connected at the same time – pick one at the top. A DSP accepts only one connection: close the Thomann editor first."), "wide", [...S.order.filter(id => !S.devices[id].demo).map(id => deviceForm(S.devices[id])), scanCard(), addDeviceCard()]], ["access", S.isApp ? t("Remote access") : t("Security"), S.isApp ? t("Let phones and tablets in your network control this computer – they log in with the PIN.") : t("Who may use this web interface."), - "wide", [S.isApp ? remoteCard() : null, S.isApp ? lockOptionCard() : null, pinCard()]], + "wide", [S.isApp ? remoteCard() : null, pinCard()]], ["backup", t("Backup"), t("Save and restore the settings of this app."), "wide", [backupCard()]], ]; const nav = h("nav", { class: "setnav", "aria-label": t("Settings") }, sections.map(([id, title]) => diff --git a/static/style.css b/static/style.css index 5bbdca7..1054a01 100644 --- a/static/style.css +++ b/static/style.css @@ -964,6 +964,18 @@ body.dashonly .dlink { cursor: default; } } @media (prefers-reduced-motion: reduce) { .xp.on::before, .xp.on::after { animation: none; } } /* level of a connection inside its point */ -.xp.on .node { width: 36px; height: 36px; border-width: 2px; transform: none; } +.xp.on .node { width: 36px; height: 36px; border-width: 2px; transform: none; background: color-mix(in srgb, var(--cc) 62%, #0b0c0f); border-color: var(--cc); } .xp.on small { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; - font-size: 10px; font-weight: 700; letter-spacing: -.02em; color: #0b0c0f; } + font-size: 10px; font-weight: 700; letter-spacing: -.02em; color: #fff; } +/* routing switched: the point pops in or sinks away, a soft ring spreads once */ +.xp.fx .node { position: relative; } +.xp.fx .node::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--cc); opacity: 0; pointer-events: none; animation: xpring .5s ease-out; } +.xp.fx.on .node { animation: xpin .28s cubic-bezier(.3, 1.4, .5, 1); } +.xp.fx:not(.on) .node { animation: xpoff .3s ease-out; } +.xp.fx.on small { animation: xptext .3s ease-out; } +@keyframes xpring { from { transform: scale(1); opacity: .55; } to { transform: scale(1.8); opacity: 0; } } +@keyframes xpin { from { transform: scale(.6); } } +@keyframes xpoff { from { transform: scale(1.45); background: color-mix(in srgb, var(--cc) 45%, var(--bg)); border-color: var(--cc); } } +@keyframes xptext { from { opacity: 0; } } +@media (prefers-reduced-motion: reduce) { .xp.fx .node, .xp.fx .node::after, .xp.fx.on small { animation: none; } } +.lockopt { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }