diff --git a/web/app.js b/web/app.js index 6a4abc2..6a120c0 100644 --- a/web/app.js +++ b/web/app.js @@ -148,19 +148,20 @@ let drawer = null; // "mixer" | "lyrics" | "queue" const Lyr = { id: null, data: null, idx: -1 }; const artOf = (t, size) => t?.srv ? img(t.srv, t.thumb, size) : ""; -// Full-size album art over the content area, opened from the art in the player bar. -const Big = { - el: null, - open() { if (!Q.cur() || Radio.station) return; this.el.hidden = false; this.fill(); }, - close() { if (this.el) this.el.hidden = true; }, +// Feishin-style big art at the foot of the sidebar, opened from the art in the player bar. +const wide = matchMedia("(min-width: 861px)"); +const SideArt = { + src: "", + show(on) { S.sideArt = on; save(); this.fill(); }, fill() { - const o = this.el; - if (!o || o.hidden) return; - const t = Q.cur(), src = artOf(t, 1000); - if (!src) return this.close(); - if (o.dataset.src !== src) { o.dataset.src = src; o.querySelector("img").src = src; o.querySelector(".bg").style.backgroundImage = `url("${src}")`; } - o.querySelector(".t").textContent = t.title; - o.querySelector(".s").textContent = [t.artist, t.album].filter(Boolean).join(" · "); + const t = Radio.station ? null : Q.cur(), src = artOf(t, 640), on = !!(S.sideArt && src && wide.matches); + $("#app").classList.toggle("sideart", on); + $("#player").classList.toggle("sideart", on); + if (!on || src === this.src) return; + // Swap only once the new art has decoded, so it never flashes empty between tracks. + this.src = src; + const im = new Image(); im.src = src; + im.decode().catch(() => {}).then(() => { if (this.src === src) $("#sideart img").src = src; }); }, }; const UI = { @@ -173,7 +174,7 @@ const UI = { $("#np-title").textContent = st.name; $("#np-sub").textContent = "Web Radio"; $("#np-art").removeAttribute("src"); - $("#b-art").hidden = true; Big.close(); + $("#b-art").hidden = true; SideArt.fill(); document.title = `${st.name} · Stemify`; if ("mediaSession" in navigator) navigator.mediaSession.metadata = new MediaMetadata({ title: st.name, artist: "Web Radio" }); return; @@ -184,7 +185,7 @@ const UI = { $("#np-sub").textContent = t ? [t.artist, t.album].filter(Boolean).join(" · ") : ""; const art = artOf(t, 120); if (art) $("#np-art").src = art; else $("#np-art").removeAttribute("src"); - $("#b-art").hidden = !art; Big.fill(); + $("#b-art").hidden = !art; SideArt.fill(); document.title = t ? `${t.title} · Stemify` : "Stemify"; if ("mediaSession" in navigator) { navigator.mediaSession.metadata = t ? new MediaMetadata({ @@ -206,6 +207,7 @@ const UI = { for (const d of ["mixer", "lyrics", "queue"]) $(`#b-${d}`).classList.toggle("on", drawer === d); $("#b-mixer").classList.toggle("dot", S.karaoke); if ("mediaSession" in navigator) navigator.mediaSession.playbackState = playing ? "playing" : "paused"; + if (drawer === "mixer") Meter.start(); }, progress() { $("#t-pos").textContent = E.loading ? `${Math.round(E.loadFrac * 100)}%` : fmtTime(E.position()); @@ -225,6 +227,7 @@ const UI = { d.innerHTML = tabs + `
${drawer === "mixer" ? mixerHtml() : drawer === "queue" ? queueHtml() : lyricsShell()}
`; if (drawer === "lyrics") loadLyrics(); if (drawer === "queue") $(".q-item.cur", d)?.scrollIntoView({ block: "center" }); + d.classList.toggle("mixing", drawer === "mixer"); } this.transport(); }, @@ -262,14 +265,15 @@ function mixerHtml() { if (!names.length) return `

${E.loading ? "Loading stems…" : Q.cur() ? "This track has no stems yet. Right-click it and pick Stem Now." : "Play something with stems to mix it."}

`; return `
${presetsHtml(names)}
- ${names.map(n => { +
${names.map(n => { const s = setting(n); return `
-
- ${esc(n)}${pct(s.level)}
- -
`; - }).join("")} +
${pct(s.level)}
+
+
+
${esc(n)}
+
`; + }).join("")}
${mixFoot(names)}
`; } // Updates the open mixer in place, so taps answer at once and the slider being dragged keeps @@ -292,9 +296,30 @@ function syncMixer() { } const paintFader = (f, v) => { - const p = pct(v); - if (f.style.getPropertyValue("--v") === p) return; - f.style.setProperty("--v", p); f.setAttribute("aria-valuenow", Math.round(v * 100)); f.querySelector(".pct").textContent = p; + if (f.style.getPropertyValue("--v") === String(v)) return; + f.style.setProperty("--v", v); f.setAttribute("aria-valuenow", Math.round(v * 100)); f.parentNode.querySelector(".pct").textContent = pct(v); +}; +// Live meters: each stem's bar rises and falls with its audio (pre-fader peak, shown under the +// fader's level like the iOS mixer). Runs on animation frames only while the mixer is open and +// playing or still falling, and writes nothing but transforms. +const Meter = { + raf: 0, rows: null, box: null, shown: new Map(), + start() { if (!this.raf) this.raf = requestAnimationFrame(this.tick); }, + tick: () => { + const M = Meter, box = $("#mixer"); + M.raf = 0; + if (!box || drawer !== "mixer" || document.hidden) return; + if (M.box !== box) { M.box = box; M.rows = [...box.querySelectorAll(".stem")].map(r => ({ n: r.dataset.stem, el: r.querySelector(".mtr") })); M.shown.clear(); } + const playing = E.playing && !E.buffering, names = mixNames(); + let moving = false; + for (const r of M.rows) { + const st = setting(r.n), live = playing && stemGain(r.n, names) ? E.meter(r.n) * st.level : 0; + const prev = M.shown.get(r.n) || 0, v = live >= prev ? live : Math.max(live, prev - 0.025); + if (Math.abs(v - prev) > 0.002 || (v === 0 && prev !== 0)) { r.el.style.transform = `scaleY(${v.toFixed(3)})`; M.shown.set(r.n, v); } + if (v > 0) moving = true; + } + if (playing || moving) M.start(); + }, }; // Sets a stem's level live; the save and mixer refresh wait until the gesture settles. let levelSave = 0; @@ -362,30 +387,27 @@ d$.addEventListener("click", ev => { else if (ds.q) Q.jump(+ds.q); else if (ds.li) E.seek(Lyr.data.lines[+ds.li].t); }); -// Faders: a mouse sets the level where it presses and drags from there. A finger has to move -// sideways first (or tap) so scrolling the drawer never changes a level. +// Faders: vertical. Grabbing the cap (or any touch) moves it from where it is; a mouse press +// elsewhere on the track jumps there first. Touches never scroll the drawer from a fader. { let drag = null; - const at = (f, x) => { const r = f.getBoundingClientRect(); setLevel(f.dataset.fader, (x - r.left) / r.width); }; + const span = r => r.height - 8, val = (r, y) => (r.bottom - 4 - y) / span(r); d$.addEventListener("pointerdown", ev => { const f = ev.target.closest(".fader"); if (!f || ev.button) return; - drag = { f, id: ev.pointerId, x0: ev.clientX, y0: ev.clientY, on: ev.pointerType === "mouse" }; - if (drag.on) { ev.preventDefault(); f.setPointerCapture(ev.pointerId); f.classList.add("drag"); at(f, ev.clientX); } + ev.preventDefault(); + const n = f.dataset.fader, r = f.getBoundingClientRect(), v = setting(n).level; + const onCap = Math.abs(ev.clientY - (r.bottom - 4 - v * span(r))) < 14; + drag = { f, n, id: ev.pointerId, y0: ev.clientY, v0: v, r, rel: onCap || ev.pointerType !== "mouse" }; + f.setPointerCapture(ev.pointerId); f.classList.add("drag"); + if (!drag.rel) setLevel(n, val(r, ev.clientY)); }); d$.addEventListener("pointermove", ev => { if (!drag || ev.pointerId !== drag.id) return; - if (!drag.on) { - const dx = Math.abs(ev.clientX - drag.x0), dy = Math.abs(ev.clientY - drag.y0); - if (dy > 8 && dy > dx) { drag = null; return; } - if (dx < 6) return; - drag.on = true; drag.f.setPointerCapture(ev.pointerId); drag.f.classList.add("drag"); - } - at(drag.f, ev.clientX); + setLevel(drag.n, drag.rel ? drag.v0 + (drag.y0 - ev.clientY) / span(drag.r) : val(drag.r, ev.clientY)); }); const end = ev => { if (!drag || ev.pointerId !== drag.id) return; - if (!drag.on && ev.type === "pointerup") at(drag.f, ev.clientX); drag.f.classList.remove("drag"); drag = null; }; d$.addEventListener("pointerup", end); @@ -395,7 +417,7 @@ d$.addEventListener("click", ev => { const f = ev.target.closest(".fader"); if (!f) return; ev.preventDefault(); - setLevel(f.dataset.fader, setting(f.dataset.fader).level - Math.sign(ev.deltaY || -ev.deltaX) * 0.02); + setLevel(f.dataset.fader, setting(f.dataset.fader).level - Math.sign(ev.deltaY || ev.deltaX) * 0.02); }, { passive: false }); d$.addEventListener("keydown", ev => { const f = ev.target.closest(".fader"); @@ -477,9 +499,10 @@ function applyBar() { $("#speed").style.display = S.bar.speed ? "" : "none"; for (const k of ["mixer", "lyrics", "queue"]) $(`#b-${k}`).style.display = S.bar[k] ? "" : "none"; } -Big.el = $("#bigart"); -Big.el.onclick = () => Big.close(); -$("#b-art").onclick = ev => { ev.stopPropagation(); Big.open(); }; +$("#b-art").onclick = ev => { if (wide.matches) { ev.stopPropagation(); SideArt.show(true); } }; +$("#sideart .sa-col").onclick = () => SideArt.show(false); +$("#sideart .sa-img").onclick = () => { const t = Q.cur(); if (t?.albumKey) location.hash = `#/album/${t.srv}:${t.albumKey}`; }; +wide.addEventListener("change", () => SideArt.fill()); $(".np").onclick = () => { const t = Q.cur(); if (t?.albumKey) location.hash = `#/album/${t.srv}:${t.albumKey}`; }; if ("mediaSession" in navigator) { @@ -492,7 +515,7 @@ if ("mediaSession" in navigator) { } document.addEventListener("keydown", ev => { - if (ev.key === "Escape") { Big.close(); return Menu.close(); } + if (ev.key === "Escape") return Menu.close(); if (ev.target.closest("input, select, textarea") || ev.metaKey || ev.ctrlKey || ev.altKey) return; const k = ev.key.toLowerCase(); if (k === " ") { ev.preventDefault(); togglePlay(); } @@ -897,7 +920,7 @@ const routes = { if (my !== seq) return; pls = st.random ? pls.sort(() => Math.random() - 0.5) : pls.sort(comparator(st.param)); count(pls.length + playlists.length, "playlist"); - navPls = [...pls].sort((a, b) => a.title.localeCompare(b.title)); navPlaylists(); + navPls = [...pls].sort((a, b) => (a.title || "").localeCompare(b.title || "")); navState = "ok"; navPlaylists(); $("#plexpl").innerHTML = pls.length ? `
${pls.map(p => card({ href: `#/playlist/${p._srv}:${p.ratingKey}`, img: img(p._srv, p.thumb || p.composite), fb: p.composite && rawImg(p._srv, p.composite), t: p.title, s: plural(p.leafCount || 0, "track"), kind: "playlist", srv: p._srv, key: p.ratingKey })).join("")}
` : `

No music playlists.

`; }, @@ -985,15 +1008,22 @@ const routes = { // Sidebar playlist list: stem playlists, then Plex ones (fetched at start and on the Playlists page). let navPls = [], navHtml = ""; +let navState = "loading"; +const STEMDOT = ''; function navPlaylists() { - const box = $("#nav-pl"), html = playlists.map(p => `${esc(p.title)}`).join("") - + navPls.map(p => `${esc(p.title)}`).join(""); + const box = $("#nav-pl"), html = playlists.map(p => `${esc(p.title)}${STEMDOT}`).join("") + + navPls.map(p => `${esc(p.title)}`).join("") + || ``; if (html !== navHtml) { navHtml = html; box.innerHTML = html; } for (const a of box.children) a.classList.toggle("on", a.getAttribute("href") === location.hash); } async function loadNavPlaylists() { - if (!liveServers().length) return; - try { navPls = (await everything(liveServers().map(srv => ({ srv })), "/playlists", { playlistType: "audio" })).sort((a, b) => a.title.localeCompare(b.title)); } catch {} + await connecting; + if (!liveServers().length) navState = "none"; + else { + try { navPls = (await everything(liveServers().map(srv => ({ srv })), "/playlists", { playlistType: "audio" })).sort((a, b) => (a.title || "").localeCompare(b.title || "")); } catch {} + navState = "ok"; + } navPlaylists(); } @@ -1207,7 +1237,7 @@ function renderSettings() { navigator.storage?.estimate?.().then(e => { const el = $("#storage-info"); if (el && e?.quota) el.insertAdjacentText("afterbegin", `${fmtBytes(e.usage)} of ${fmtBytes(e.quota)} used. `); }).catch(() => {}); const again = () => { if (location.hash.startsWith("#/settings")) renderSettings(); }; - const plexChanged = () => { genreCache = null; save(); }; + const plexChanged = () => { genreCache = null; save(); loadNavPlaylists(); }; $("#signin").onclick = async () => { const st = $("#sstatus"); try { const ok = await signIn(m => { st.textContent = m; }); plexChanged(); toast(`Added ${plural(ok.length, "server")}`); again(); } @@ -1305,16 +1335,18 @@ async function connect() { save(); } +let connecting = null; (async () => { applyTheme(); applyStemFilter(); applyBar(); await Offline.init(); - await Promise.race([connect(), new Promise(r => setTimeout(r, 5000))]); + connecting = connect(); + await Promise.race([connecting, new Promise(r => setTimeout(r, 5000))]); Q.restore(); UI.all(); route(); loadNavPlaylists(); Live.poll(); - setInterval(() => { if (!document.hidden) Stems.refresh(); }, 5 * 60 * 1000); + setInterval(() => { if (!document.hidden) { Stems.refresh(); loadNavPlaylists(); } }, 5 * 60 * 1000); })(); diff --git a/web/index.html b/web/index.html index 0b097a3..23a589e 100644 --- a/web/index.html +++ b/web/index.html @@ -22,10 +22,13 @@ Playlists Downloads Web Radio - - - Settings + + +
@@ -33,7 +36,7 @@ - diff --git a/web/player.js b/web/player.js index f4f7ac8..3f5b0ff 100644 --- a/web/player.js +++ b/web/player.js @@ -193,7 +193,7 @@ const Pre = { // ---- engine ----------------------------------------------------------------------------------- export const E = { - els: [], names: [], gains: [], urls: [], ctx: null, master: null, + els: [], names: [], gains: [], meters: [], urls: [], ctx: null, master: null, mbuf: new Float32Array(1024), want: false, stalled: false, loading: false, loadFrac: 0, pendingPos: 0, entry: null, offline: null, ctl: null, gen: 0, @@ -262,13 +262,15 @@ export const E = { el.src = s.url; el.playbackRate = el.defaultPlaybackRate = S.speed; if (this.pendingPos) el.currentTime = this.pendingPos; - let gain = null; + let gain = null, meter = null; if (graph) { gain = this.ctx.createGain(); - this.ctx.createMediaElementSource(el).connect(gain).connect(this.master); + meter = this.ctx.createAnalyser(); + meter.fftSize = 1024; + this.ctx.createMediaElementSource(el).connect(meter).connect(gain).connect(this.master); } if (s.blob) this.urls.push(s.url); - this.els.push(el); this.gains.push(gain); this.names.push(s.name); + this.els.push(el); this.gains.push(gain); this.meters.push(meter); this.names.push(s.name); } this.graph = graph; const lead = this.els[0]; @@ -284,10 +286,21 @@ export const E = { this.ctl?.abort(); this.ctl = null; for (const el of this.els) { el.pause(); el.removeAttribute("src"); el.load(); } for (const u of this.urls) URL.revokeObjectURL(u); - this.els = []; this.names = []; this.gains = []; this.urls = []; + this.els = []; this.names = []; this.gains = []; this.meters = []; this.urls = []; this.loading = false; }, + // A stem's live peak before its fader, 0..1 over a 48 dB range (0 without Web Audio). + meter(name) { + const a = this.meters[this.names.indexOf(name)]; + if (!a) return 0; + const b = this.mbuf; + a.getFloatTimeDomainData(b); + let p = 0; + for (let i = 0; i < b.length; i++) { const v = b[i] < 0 ? -b[i] : b[i]; if (v > p) p = v; } + return p < 0.004 ? 0 : Math.min(1, (20 * Math.log10(p) + 48) / 48); + }, + applyGains() { const named = this.names.filter(Boolean); this.els.forEach((el, i) => { diff --git a/web/store.js b/web/store.js index 2135a72..9f029b7 100644 --- a/web/store.js +++ b/web/store.js @@ -24,7 +24,7 @@ export const S = Object.assign({ acapella: false, // spell "A Cappella" as "Acapella" bar: { speed: true, mixer: true, lyrics: true, queue: true }, // player bar buttons stations: [], // web radio: [{id, name, url}] - theme: "graphite", accent: "", css: "", + theme: "graphite", accent: "", css: "", sideArt: false, }, load(KEY) || {}); if (!S.clientId) S.clientId = uuid(); diff --git a/web/style.css b/web/style.css index 7f98dd2..a217cd1 100644 --- a/web/style.css +++ b/web/style.css @@ -9,6 +9,7 @@ --accent-ink: #ffffff; --radius: 6px; --player-h: 90px; + --nav-w: 240px; --glass: #101010ee; --hover: #e7e7e70d; --shadow: #0009; @@ -30,20 +31,36 @@ button { background: none; border: 0; cursor: pointer; padding: 0; } a { color: inherit; text-decoration: none; } svg { width: 1em; height: 1em; fill: currentColor; display: block; } -#app { display: grid; grid-template-columns: 200px 1fr auto; height: calc(100% - var(--player-h)); } -#nav { background: var(--panel); padding: 16px 10px 10px; display: flex; flex-direction: column; gap: 1px; min-height: 0; } +#app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); height: calc(100% - var(--player-h)); } +#nav { background: var(--panel); padding: 16px 10px 0; display: flex; flex-direction: column; gap: 1px; min-height: 0; overflow-y: auto; overflow-x: hidden; } +#nav > * { flex: none; } .brand { white-space: nowrap; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; padding: 0 10px 6px; } .brand::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 3px; } -#nav a { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 4px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +#nav a { display: flex; align-items: center; gap: 12px; min-height: 34px; padding: 0 10px; border-radius: 4px; color: var(--muted); font-weight: 500; white-space: nowrap; transition: color .12s, background-color .12s; } +#nav a > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; } #nav a svg { width: 18px; height: 18px; flex: none; } -#nav a:hover { color: var(--text); } +#nav a:hover { color: var(--text); background: var(--hover); } #nav a.on { background: var(--raised); color: var(--text); } #search input { width: 100%; margin: 10px 0; padding: 7px 10px; background: var(--raised); border: 1px solid transparent; border-radius: 4px; outline: none; } #search input:focus { border-color: var(--accent); } -.nav-h { margin: 16px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); opacity: .7; } -#nav-pl { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; margin: 0 -4px; padding: 0 4px; } -#nav-pl a { display: block; padding: 5px 10px; font-weight: 400; } -.settings-link { margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 10px !important; } +.nav-sec { flex: 1 1 0 !important; min-height: 150px; display: flex; flex-direction: column; margin: 10px -10px 0; padding: 6px 10px 8px; border-top: 1px solid var(--line); } +#nav .nav-h { flex: none; min-height: 30px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: none; } +#nav .nav-h:hover { background: none; } +#nav-pl { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 1px; margin: 0 -6px; padding: 0 6px; } +#nav-pl a { flex: none; min-height: 32px; font-weight: 400; gap: 8px; justify-content: space-between; } +#nav-pl a svg { width: 13px; height: 13px; opacity: .55; } +.nav-empty { margin: 4px 10px; color: var(--muted); opacity: .7; font-size: 12px; } +.settings-link { margin-top: 2px; } +#sideart { display: none; position: relative; margin: 0 -10px; aspect-ratio: 1; background: var(--raised); overflow: hidden; } +#app.sideart #sideart { display: block; animation: sain .26s cubic-bezier(.2, .8, .2, 1); } +@keyframes sain { from { opacity: 0; transform: translateY(24px); } } +#sideart .sa-img { display: block; width: 100%; height: 100%; padding: 0; cursor: pointer; } +#sideart img { display: block; width: 100%; height: 100%; object-fit: cover; } +#sideart img:not([src]) { visibility: hidden; } +#sideart .sa-col { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; + background: rgba(0, 0, 0, .62); color: #fff; font-size: 18px; opacity: 0; transform: scale(.9); transition: opacity .15s, transform .15s; } +#sideart:hover .sa-col, #sideart .sa-col:focus-visible { opacity: 1; transform: none; } +#sideart .sa-col:hover { background: rgba(0, 0, 0, .85); } #view { overflow-y: auto; padding: 24px 32px 48px; background: var(--bg); } h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; } @@ -189,6 +206,7 @@ input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var #drawer h2 { margin: 0 0 14px; } #drawer { display: flex; flex-direction: column; padding-top: 12px; } #drawer[hidden] { display: none; } +#drawer.mixing { width: 340px; } .tabs { display: flex; gap: 4px; margin-bottom: 16px; position: sticky; top: -12px; background: var(--panel); padding: 6px 0; z-index: 1; } .tabs button { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; } .tabs button.on { background: var(--raised); color: var(--text); } @@ -210,20 +228,26 @@ input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var .chip { background: var(--raised); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 500; } .chip.on { background: var(--accent); color: var(--accent-ink); } .chip:disabled { opacity: .35; cursor: default; } -.stem { --c: #8e8e93; display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: stretch; margin-bottom: 8px; } -.fader { position: relative; height: 54px; border-radius: 10px; overflow: hidden; cursor: ew-resize; touch-action: pan-y; user-select: none; -webkit-user-select: none; - background: color-mix(in srgb, var(--c) 12%, var(--raised)); display: flex; align-items: center; justify-content: space-between; padding: 0 14px; outline: none; } -.fader::before { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--v)); will-change: transform; - background: linear-gradient(90deg, color-mix(in srgb, var(--c) 45%, transparent), color-mix(in srgb, var(--c) 75%, transparent)); pointer-events: none; } -.fader::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: clamp(2px, calc(var(--v) - 3px), calc(100% - 5px)); width: 3px; border-radius: 2px; background: var(--c); box-shadow: 0 0 8px var(--c); pointer-events: none; } -.fader:focus-visible { box-shadow: 0 0 0 2px var(--c); } -.fader.drag::after { width: 4px; } -.fader .name, .fader .pct { position: relative; z-index: 1; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .55); } -.fader .name { text-transform: capitalize; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.fader .pct { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; } -.stem.silent .fader { filter: saturate(.15); opacity: .55; } -.ms { width: 44px; height: auto; border-radius: 8px; background: var(--raised); font-size: 12px; font-weight: 800; color: var(--muted); +.strips { display: flex; gap: 8px; justify-content: center; margin: 4px 0 6px; --fh: clamp(170px, calc(100vh - var(--player-h) - 470px), 320px); } +.stem { --c: #8e8e93; flex: 1 1 0; min-width: 0; max-width: 58px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; } +.stem .pct { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; } +.stem .name { text-align: center; text-transform: capitalize; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.fader { position: relative; height: var(--fh); border-radius: 12px; overflow: hidden; cursor: ns-resize; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; + background: color-mix(in srgb, var(--c) 9%, var(--raised)); contain: strict; } +.fader i { position: absolute; display: block; pointer-events: none; } +.fader .lvl, .fader .mtr { inset: 0; transform-origin: bottom; will-change: transform; } +.fader .lvl { transform: scaleY(var(--v)); background: linear-gradient(to top, color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 46%, transparent)); } +.fader .mtr { transform: scaleY(0); background: linear-gradient(to top, color-mix(in srgb, var(--c) 82%, #000), var(--c)); } +.fader .cap { left: 0; right: 0; top: 4px; bottom: 4px; transform: translateY(calc((1 - var(--v)) * 100%)); will-change: transform; } +.fader .cap b { position: absolute; left: 6px; right: 6px; top: -3px; height: 6px; border-radius: 3px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); transition: transform .1s; } +.fader:hover .cap b, .fader.drag .cap b { transform: scaleY(1.35); } +.fader:focus-visible { box-shadow: inset 0 0 0 2px var(--c); } +.stem.silent .fader, .stem.silent .name { opacity: .4; } +.stem.silent .mtr { visibility: hidden; } +.msrow { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; } +.ms { height: 26px; min-width: 0; border-radius: 6px; background: var(--raised); font-size: 11px; font-weight: 800; color: var(--muted); transition: transform .08s, background-color .12s, color .12s; touch-action: manipulation; -webkit-tap-highlight-color: transparent; } +.ms:hover { color: var(--text); } .ms:active { transform: scale(.88); } .ms.mute.on { background: #ff453a; color: #fff; } .ms.solo.on { background: #ffcc00; color: #1a1400; } @@ -245,22 +269,13 @@ input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var border-top: 1px solid rgba(50, 50, 50, .7); display: grid; grid-template-columns: minmax(180px, 1fr) minmax(320px, 1.6fr) minmax(180px, 1fr); align-items: center; gap: 20px; padding: 0 20px; } #player.empty .center, #player.empty .right, #player.empty #b-art { opacity: .35; pointer-events: none; } .left { display: flex; align-items: center; gap: 10px; min-width: 0; } -#b-art { position: relative; flex: none; width: 60px; height: 60px; padding: 0; border-radius: 4px; overflow: hidden; cursor: zoom-in; } +#b-art { position: relative; flex: none; width: 60px; height: 60px; padding: 0; border-radius: 4px; overflow: hidden; } #b-art[hidden] { display: none; } -#b-art .exp { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .15s; } -#b-art .exp svg { width: 22px; height: 22px; fill: #fff; } -#b-art:hover .exp, #b-art:focus-visible .exp { opacity: 1; } -#bigart { position: fixed; inset: 0 0 var(--player-h) 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; - padding: 32px 16px; background: #000; overflow: hidden; cursor: zoom-out; animation: bigin .18s ease-out; } -#bigart[hidden] { display: none; } -#bigart .bg { position: absolute; inset: -80px; background-size: cover; background-position: center; filter: blur(70px) brightness(.4) saturate(1.3); transform: translateZ(0); } -#bigart img { position: relative; width: min(68vh, 88vw, 760px); aspect-ratio: 1; object-fit: cover; border-radius: 8px; box-shadow: 0 24px 70px rgba(0, 0, 0, .65); } -#bigart .cap { position: relative; text-align: center; max-width: 88vw; } -#bigart .t { font-size: clamp(20px, 3vw, 30px); font-weight: 800; } -#bigart .s { color: rgba(255, 255, 255, .7); margin-top: 4px; } -#bigart .x { position: absolute; top: 14px; right: 18px; font-size: 28px; color: #fff; opacity: .7; } -#bigart .x:hover { opacity: 1; } -@keyframes bigin { from { opacity: 0; } } +#b-art .exp { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .7); + opacity: 0; transform: scale(.85); transition: opacity .15s, transform .15s; } +#b-art .exp svg { width: 15px; height: 15px; fill: #fff; } +#b-art:hover .exp, #b-art:focus-visible .exp { opacity: 1; transform: none; } +#player.sideart #b-art { display: none; } .np { display: flex; gap: 12px; align-items: center; min-width: 0; } #np-art { width: 60px; height: 60px; border-radius: 4px; object-fit: cover; background: var(--raised); flex: none; } #np-art:not([src]) { display: none; } @@ -295,12 +310,13 @@ input[type=range] { accent-color: var(--accent); } @media (max-width: 860px) { :root { --player-h: 150px; } - #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } + #app { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); } #nav { flex-direction: row; overflow-x: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); align-items: center; } .brand { padding: 0 8px 0 4px; } #nav a { white-space: nowrap; overflow: visible; } - #nav a svg, .nav-h, #nav-pl { display: none; } - .settings-link { border-top: 0; padding-top: 7px !important; border-radius: 4px !important; } + #nav a svg, .nav-sec, #sideart, #b-art .exp { display: none !important; } + #nav { overflow-y: hidden; } + #nav a { min-height: 32px; } #search input { margin: 0; width: 120px; } #live { margin: 0; white-space: nowrap; } .settings { grid-template-columns: 1fr; } @@ -311,7 +327,7 @@ input[type=range] { accent-color: var(--accent); } .tracks th { top: -20px; } .settings-link { margin-top: 0; } #view { padding: 20px 16px 40px; } - #drawer { position: fixed; inset: auto 0 var(--player-h) 0; width: auto; max-height: 60vh; border-left: 0; border-top: 1px solid var(--line); z-index: 5; } + #drawer, #drawer.mixing { position: fixed; inset: auto 0 var(--player-h) 0; width: auto; max-height: 60vh; border-left: 0; border-top: 1px solid var(--line); z-index: 5; } #player { grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 8px 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); } .center { grid-column: 1 / -1; grid-row: 2; } .right #volume { display: none; } @@ -321,6 +337,8 @@ input[type=range] { accent-color: var(--accent); } .cplay { opacity: 1; transform: none; width: 36px; height: 36px; font-size: 14px; } .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; } .card { padding: 6px; } + .strips { --fh: clamp(140px, 24vh, 220px); } + .stem { max-width: 64px; } } /* presets */