Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e57b9d0cd | ||
|
|
0c9cae5b11 | ||
|
|
a79c134838 |
No files matched your search
@@ -107,7 +107,7 @@ final class Settings: @unchecked Sendable {
|
||||
|
||||
private static let keys = [
|
||||
"servers", "plexUrl", "plexToken", "plexUser", "plexMachineId", "musicSection", "musicSectionTitle",
|
||||
"stemUrl", "stemToken", "plexAccountToken", "stemRoots", "theme", "accent", "albumColorNowPlaying", "highRefreshRate",
|
||||
"stemUrl", "stemToken", "plexAccountToken", "stemRoots", "theme", "accent", "albumTheme", "albumColorNowPlaying", "highRefreshRate",
|
||||
"stemQuality", "cacheLimitGb", "downloadsWifiOnly", "downloadSort", "keepStemMix", "masterVolume", "tabLayout",
|
||||
"karaokeVocals", "karaokeSoftDb", "playbackSpeed", "stemsOnly", "noStems", "precacheCount", "hiddenNowPlaying", "presets", "presetOrder", "hiddenPresets", "lockedPreset", "webStations", "lockScreenMix", "swipeUpQueue", "acapella", "crossfadeSec", "sweetFades", "foldedArtLeft",
|
||||
]
|
||||
@@ -219,6 +219,8 @@ final class Settings: @unchecked Sendable {
|
||||
/// Swipe up on Now Playing opens Playing Next.
|
||||
var swipeUpQueue: Bool { get { read(\.swipeUpQueue, "swipeUpQueue", true) } set { write(\.swipeUpQueue, "swipeUpQueue", newValue, true) } }
|
||||
var lockScreenMix: Bool { get { read(\.lockScreenMix, "lockScreenMix", false) } set { write(\.lockScreenMix, "lockScreenMix", newValue, false) } }
|
||||
/// The whole app takes its accent and surface tint from the playing track's art.
|
||||
var albumTheme: Bool { get { read(\.albumTheme, "albumTheme", false) } set { write(\.albumTheme, "albumTheme", newValue, false) } }
|
||||
var albumColorNowPlaying: Bool { get { read(\.albumColorNowPlaying, "albumColorNowPlaying", false) } set { write(\.albumColorNowPlaying, "albumColorNowPlaying", newValue, false) } }
|
||||
/// Folded iPhone Duo: Now Playing's art sits at the left instead of centred.
|
||||
var foldedArtLeft: Bool { get { read(\.foldedArtLeft, "foldedArtLeft", false) } set { write(\.foldedArtLeft, "foldedArtLeft", newValue, false) } }
|
||||
|
||||
@@ -6,11 +6,13 @@ import UIKit
|
||||
/// (or the stems, queue and lyrics deck) on the other, and the tabs stay in the system's own bar.
|
||||
struct RootView: View {
|
||||
@State private var ui = Ui(overlays: Overlays())
|
||||
@State private var art: ArtHue?
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
var body: some View {
|
||||
let s = g.settings
|
||||
let p = Palette.of(s.theme, s.accent)
|
||||
let base = Palette.of(s.theme, s.accent)
|
||||
let p = s.albumTheme ? art.map { base.art($0, mode: s.theme) } ?? base : base
|
||||
bar
|
||||
.modifier(GlassMiniPlayerHost())
|
||||
// Folded on the Duo the app stays upright (the window's trailing inset gives the Duo away).
|
||||
@@ -33,6 +35,11 @@ struct RootView: View {
|
||||
.environment(\.palette, p)
|
||||
.preferredColorScheme(s.theme == .White ? .light : .dark)
|
||||
.tint(p.accent)
|
||||
.task(id: "\(g.playback.current?.track.thumb ?? "")|\(s.albumTheme)") {
|
||||
guard s.albumTheme, let thumb = g.playback.current?.track.thumb else { art = nil; return }
|
||||
let a = await artHue(thumb)
|
||||
withAnimation(.easeInOut(duration: 0.4)) { art = a }
|
||||
}
|
||||
}
|
||||
|
||||
@Environment(\.verticalSizeClass) private var vSize
|
||||
|
||||
@@ -33,7 +33,7 @@ private func albumColor(_ thumb: String?, dark: Bool) async -> Color? {
|
||||
}
|
||||
|
||||
/// Roughly Palette's vibrant swatch: the average hue of the most saturated, mid-bright pixels.
|
||||
private func vibrant(_ cg: CGImage) -> (CGFloat, CGFloat, CGFloat)? {
|
||||
func vibrant(_ cg: CGImage) -> (CGFloat, CGFloat, CGFloat)? {
|
||||
let n = 24
|
||||
var px = [UInt8](repeating: 0, count: n * n * 4)
|
||||
guard let ctx = CGContext(data: &px, width: n, height: n, bitsPerComponent: 8, bytesPerRow: n * 4,
|
||||
|
||||
@@ -1025,6 +1025,11 @@ struct AppearanceScreen: View {
|
||||
.padding(.vertical, 8)
|
||||
.themedRow()
|
||||
} header: { Header(text: "Accent") }
|
||||
Section {
|
||||
Toggle(isOn: $s.albumTheme) { Text("Match Album Art").foregroundStyle(c.label) }
|
||||
.tint(Color(hex: 0x34C759))
|
||||
.themedRow()
|
||||
}
|
||||
Section {
|
||||
Toggle(isOn: $s.albumColorNowPlaying) { Text("Album Colour Background").foregroundStyle(c.label) }
|
||||
.tint(Color(hex: 0x34C759))
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
extension Color {
|
||||
init(hex: UInt32, alpha: Double = 1) {
|
||||
@@ -84,3 +85,44 @@ private struct ThemedRow: ViewModifier {
|
||||
content.listRowBackground(grouped ? p.cell : p.bg).listRowSeparatorTint(p.separator)
|
||||
}
|
||||
}
|
||||
|
||||
// ---- album art theme ----------------------------------------------------------------------------
|
||||
|
||||
/// One hue taken from the album art (see vibrant in NowPlayingScreen).
|
||||
struct ArtHue: Equatable { var h, s, v: CGFloat }
|
||||
|
||||
@MainActor
|
||||
func artHue(_ thumb: String?) async -> ArtHue? {
|
||||
guard let url = AppGraph.shared.plex.artUrl(thumb, px: 120) else { return nil }
|
||||
let img: UIImage? = if let c = ArtLoader.shared.cached(url) { c } else { await ArtLoader.shared.image(url) }
|
||||
guard let cg = img?.cgImage else { return nil }
|
||||
return await Task.detached { () -> ArtHue? in
|
||||
guard let (h, s, v) = vibrant(cg), s >= 0.12 else { return nil }
|
||||
return ArtHue(h: h, s: s, v: v)
|
||||
}.value
|
||||
}
|
||||
|
||||
extension Palette {
|
||||
/// The theme recoloured around the art's hue: lightly tinted surfaces and an accent in the art's colour.
|
||||
/// Black keeps its true-black background for OLED.
|
||||
func art(_ a: ArtHue, mode: ThemeMode) -> Palette {
|
||||
var c = self
|
||||
let s = min(a.s, 0.9), t = min(s * 0.5, 0.3)
|
||||
func hsb(_ sat: CGFloat, _ b: CGFloat) -> Color { Color(hue: a.h, saturation: sat, brightness: b) }
|
||||
switch mode {
|
||||
case .White:
|
||||
c.bg = hsb(t * 0.25, 1); c.groupedBg = hsb(t * 0.45, 0.965); c.cell = hsb(t * 0.2, 1)
|
||||
c.fill = hsb(t * 0.5, 0.94); c.fillStrong = hsb(t * 0.6, 0.89); c.separator = hsb(t * 0.6, 0.86)
|
||||
c.accent = hsb(max(s, 0.6), min(max(a.v, 0.5), 0.62))
|
||||
case .Dark:
|
||||
c.bg = hsb(t, 0.11); c.groupedBg = c.bg; c.cell = hsb(t, 0.17)
|
||||
c.fill = c.cell; c.fillStrong = hsb(t, 0.27); c.separator = hsb(t, 0.22)
|
||||
c.accent = hsb(max(s, 0.5), max(a.v, 0.85))
|
||||
case .Black:
|
||||
c.cell = hsb(t, 0.11); c.fill = c.cell; c.fillStrong = hsb(t, 0.22); c.separator = hsb(t, 0.17)
|
||||
c.accent = hsb(max(s, 0.5), max(a.v, 0.85))
|
||||
}
|
||||
c.placeholder = c.fill
|
||||
return c
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,16 @@
|
||||
"tintColor": "#FA2D48",
|
||||
"category": "entertainment",
|
||||
"versions": [
|
||||
{
|
||||
"version": "0.10.0",
|
||||
"marketingVersion": "0.10.0",
|
||||
"buildVersion": "40",
|
||||
"date": "2026-11-19T22:26:40-08:00",
|
||||
"localizedDescription": "## iOS\n\n- New app icon: glowing stem-colored capsules on a night gradient.\n- Plays straight from Plex when the stem server is off or can't be reached. Stems come back once it's reachable again.\n- Picks the Plex server address again after a network change, when the app returns to the foreground, and when a stream fails.\n- Folded Now Playing uses the space at the bottom and shows bigger art.\n- iPhone Duo:\n - Folded is portrait only, and unfolded is landscape only.\n - Left-aligned art applies only when folded.\n - Unfolded stem bars are full width with roomier rows.\n - Deck stems fill the pane down to the hinge and the bottom edge.\n - Tab bar slots stay put across fold and unfold.\n\n## Web player\n\n- New layout: icon sidebar, blurred-art album headers, track table with an album column, play on card hover.\n- Graphite is the new default theme.\n- Album art can expand into a tile in the sidebar.\n- The mixer has vertical channel strips with live level meters. Drag anywhere on a strip, or use the wheel or arrow keys.\n- Save mix and Add to playlist buttons sit under the mixer.\n- The queue button moved to the right side of the player bar.\n- Tracks without stems are tagged NO STEMS.\n- Explanatory text is gone, and the playlist list is gone from the sidebar.\n- Assets are cache-busted, so a plain reload picks up new versions.",
|
||||
"downloadURL": "https://git.iamchrisama.com/cdnutter/stemify/releases/download/ios-v0.10.0/stemify-0.10.0.ipa",
|
||||
"size": 3124915,
|
||||
"minOSVersion": "17.0"
|
||||
},
|
||||
{
|
||||
"version": "0.9.0",
|
||||
"marketingVersion": "0.9.0",
|
||||
|
||||
+130
-69
@@ -28,8 +28,55 @@ const inkFor = hex => {
|
||||
const n = parseInt(hex.slice(1), 16), l = (0.299 * (n >> 16) + 0.587 * (n >> 8 & 255) + 0.114 * (n & 255)) / 255;
|
||||
return l > 0.6 ? "#141414" : "#ffffff";
|
||||
};
|
||||
// Theme from the playing track's art: one hue taken from the art, laid over the chosen theme's lightness.
|
||||
const hex = (h, s, l) => {
|
||||
const f = n => { const k = (n + h * 12) % 12, c = l - s * Math.min(l, 1 - l) * Math.max(-1, Math.min(k - 3, 9 - k, 1)); return Math.round(c * 255).toString(16).padStart(2, "0"); };
|
||||
return "#" + f(0) + f(8) + f(4);
|
||||
};
|
||||
function artPalette([h, s0, v], base) {
|
||||
const s = Math.min(s0, 0.9), tint = Math.min(s * 0.55, 0.32), clamp = (x, a, b) => Math.max(a, Math.min(b, x));
|
||||
if (base.light) return { bg: hex(h, tint, .955), panel: hex(h, tint, .985), raised: hex(h, tint, .9), line: hex(h, tint, .85),
|
||||
text: hex(h, .2, .1), muted: hex(h, .08, .42), accent: hex(h, Math.max(s, .55), clamp(v * .45, .32, .42)), light: true };
|
||||
const black = base.bg === "#000000";
|
||||
return { bg: black ? "#000000" : hex(h, tint, .09), panel: black ? "#000000" : hex(h, tint, .06), raised: hex(h, tint, black ? .085 : .145), line: hex(h, tint, black ? .12 : .18),
|
||||
text: hex(h, .15, .93), muted: hex(h, .1, .66), accent: hex(h, Math.max(s, .55), clamp(v * .7, .58, .7)) };
|
||||
}
|
||||
// Roughly a vibrant swatch: the circular mean hue of the most colourful mid-bright pixels.
|
||||
function vibrant(bm) {
|
||||
const n = 24, cv = new OffscreenCanvas(n, n), cx = cv.getContext("2d", { willReadFrequently: true });
|
||||
cx.drawImage(bm, 0, 0, n, n);
|
||||
const d = cx.getImageData(0, 0, n, n).data, px = [];
|
||||
for (let i = 0; i < d.length; i += 4) {
|
||||
const r = d[i] / 255, g = d[i + 1] / 255, b = d[i + 2] / 255, mx = Math.max(r, g, b), mn = Math.min(r, g, b), c = mx - mn;
|
||||
const h = !c ? 0 : mx === r ? ((g - b) / c + 6) % 6 / 6 : mx === g ? ((b - r) / c + 2) / 6 : ((r - g) / c + 4) / 6, s = mx ? c / mx : 0;
|
||||
px.push([h, s, mx, s * (1 - Math.abs(mx - 0.55) * 1.4)]);
|
||||
}
|
||||
const top = px.sort((a, b) => b[3] - a[3]).slice(0, px.length / 6);
|
||||
let x = 0, y = 0, s = 0, v = 0;
|
||||
for (const p of top) { x += Math.cos(p[0] * 2 * Math.PI); y += Math.sin(p[0] * 2 * Math.PI); s += p[1]; v += p[2]; }
|
||||
return s / top.length < 0.12 ? null : [(Math.atan2(y, x) / (2 * Math.PI) + 1) % 1, s / top.length, v / top.length];
|
||||
}
|
||||
const ArtTheme = {
|
||||
url: "", hsv: null, seq: 0, cache: new Map(),
|
||||
async set(url) {
|
||||
if (!S.artTheme) url = "";
|
||||
if (url === this.url) return;
|
||||
this.url = url;
|
||||
const n = ++this.seq;
|
||||
let hsv = url ? this.cache.get(url) : null;
|
||||
if (url && !this.cache.has(url)) {
|
||||
try {
|
||||
const r = await fetch(url, { signal: AbortSignal.timeout(8000) });
|
||||
hsv = vibrant(await createImageBitmap(await r.blob()));
|
||||
this.cache.set(url, hsv);
|
||||
} catch { hsv = null; }
|
||||
if (n !== this.seq) return;
|
||||
}
|
||||
this.hsv = hsv; applyTheme();
|
||||
},
|
||||
};
|
||||
function applyTheme() {
|
||||
const t = THEMES[S.theme] || THEMES.graphite, a = S.accent || t.accent;
|
||||
const base = THEMES[S.theme] || THEMES.graphite, t = ArtTheme.hsv ? artPalette(ArtTheme.hsv, base) : base, a = ArtTheme.hsv ? t.accent : S.accent || t.accent;
|
||||
$("#theme").textContent = `:root{--bg:${t.bg};--panel:${t.panel};--raised:${t.raised};--line:${t.line};--text:${t.text};--muted:${t.muted};` +
|
||||
`--accent:${a};--accent-ink:${inkFor(a)};--glass:${t.panel}ee;--hover:${t.text}0d;--shadow:${t.light ? "#0003" : "#0009"};` +
|
||||
`--wave:${t.text}44;--wave-ghost:${t.text}14;color-scheme:${t.light ? "light" : "dark"}}`;
|
||||
@@ -174,7 +221,7 @@ const UI = {
|
||||
$("#np-title").textContent = st.name;
|
||||
$("#np-sub").textContent = "Web Radio";
|
||||
$("#np-art").removeAttribute("src");
|
||||
$("#b-art").hidden = true; SideArt.fill();
|
||||
$("#b-art").hidden = true; SideArt.fill(); ArtTheme.set("");
|
||||
document.title = `${st.name} · Stemify`;
|
||||
if ("mediaSession" in navigator) navigator.mediaSession.metadata = new MediaMetadata({ title: st.name, artist: "Web Radio" });
|
||||
return;
|
||||
@@ -185,7 +232,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; SideArt.fill();
|
||||
$("#b-art").hidden = !art; SideArt.fill(); ArtTheme.set(artOf(t, 64));
|
||||
document.title = t ? `${t.title} · Stemify` : "Stemify";
|
||||
if ("mediaSession" in navigator) {
|
||||
navigator.mediaSession.metadata = t ? new MediaMetadata({
|
||||
@@ -1105,92 +1152,98 @@ const SECTIONS = [["plex", "Plex"], ["stems", "Stem server"], ["stemopts", "Stem
|
||||
["offline", "Offline"], ["backup", "Backup"], ["keys", "Keys"], ["about", "About"]];
|
||||
const BAR = [["speed", "Speed"], ["mixer", "Mixer"], ["lyrics", "Lyrics"], ["queue", "Queue"]];
|
||||
|
||||
// Settings rows: label on the left, control on the right, grouped into cards.
|
||||
const srow = (title, ctrl, sub = "") => `<div class="sr"><div class="sl"><span>${title}</span>${sub ? `<small>${sub}</small>` : ""}</div><div class="sc">${ctrl}</div></div>`;
|
||||
const stog = (title, input, sub = "") => `<label class="sr"><div class="sl"><span>${title}</span>${sub ? `<small>${sub}</small>` : ""}</div><div class="sc">${input}</div></label>`;
|
||||
const sw = (attrs, on) => `<input type="checkbox" class="sw" ${attrs} ${on ? "checked" : ""}>`;
|
||||
|
||||
function presetEditor() {
|
||||
const ps = presets(), lock = S.lockedPreset && allPresets().find(p => p.id === S.lockedPreset);
|
||||
return `<h3>Locked</h3>
|
||||
${lock ? `<div class="prow"><span class="pn">${ICON.lock}${esc(presetLabel(lock.name))}</span><span class="grow"></span><button class="btn small" data-plock="${esc(lock.id)}">Unlock</button></div>` : `<p class="note">Nothing locked.</p>`}
|
||||
<h3>Mixer Bar</h3><div class="plist">${ps.map((p, i) => `<div class="prow"><span class="pn">${esc(presetLabel(p.name))}${p.custom ? ' <span class="tag">CUSTOM</span>' : ""}</span><span class="grow"></span>
|
||||
<button class="btn small ${lock?.id === p.id ? "on" : ""}" data-plock="${esc(p.id)}" title="${lock?.id === p.id ? "Unlock" : "Lock"}">${ICON.lock}</button>
|
||||
<button class="btn small" data-pmove="${esc(p.id)}" data-pdir="-1" ${i ? "" : "disabled"} title="Move up">↑</button>
|
||||
<button class="btn small" data-pmove="${esc(p.id)}" data-pdir="1" ${i < ps.length - 1 ? "" : "disabled"} title="Move down">↓</button>
|
||||
<button class="btn small" data-pdel="${esc(p.id)}" ${p.id === "b:Full Mix" ? "disabled" : ""} title="Delete">×</button></div>`).join("")}</div>
|
||||
<h3>Stems</h3><div class="row">
|
||||
<button class="btn small" data-padd ${mixNames().length ? "" : "disabled"} title="Play a song with stems to save its mix">Save the current mix as a preset</button>
|
||||
<button class="btn small" data-prestore ${S.hiddenPresets.length ? "" : "disabled"}>Restore Deleted Presets</button>
|
||||
<button class="btn small" data-pclear ${S.customPresets.length ? "" : "disabled"}>Delete All Custom Presets</button></div>`;
|
||||
return `<div class="sg">${srow("Locked preset", lock
|
||||
? `<span class="val">${ICON.lock}${esc(presetLabel(lock.name))}</span><button class="btn small" data-plock="${esc(lock.id)}">Unlock</button>`
|
||||
: `<span class="val dim">None</span>`)}</div>
|
||||
<h3 class="sgh">Mixer bar</h3>
|
||||
<div class="sg">${ps.map((p, i) => `<div class="sr"><div class="sl"><span>${esc(presetLabel(p.name))}${p.custom ? ' <span class="tag">CUSTOM</span>' : ""}</span></div><div class="sc ibs">
|
||||
<button class="ib ${lock?.id === p.id ? "on" : ""}" data-plock="${esc(p.id)}" title="${lock?.id === p.id ? "Unlock" : "Lock"}">${ICON.lock}</button>
|
||||
<button class="ib" data-pmove="${esc(p.id)}" data-pdir="-1" ${i ? "" : "disabled"} title="Move up">${ICON.up}</button>
|
||||
<button class="ib" data-pmove="${esc(p.id)}" data-pdir="1" ${i < ps.length - 1 ? "" : "disabled"} title="Move down">${ICON.down}</button>
|
||||
<button class="ib bad" data-pdel="${esc(p.id)}" ${p.id === "b:Full Mix" ? "disabled" : ""} title="Delete">${ICON.x}</button></div></div>`).join("")}</div>
|
||||
<div class="sg">
|
||||
<button class="sr act" data-padd ${mixNames().length ? "" : "disabled"}>Save current mix as preset</button>
|
||||
<button class="sr act" data-prestore ${S.hiddenPresets.length ? "" : "disabled"}>Restore deleted presets</button>
|
||||
<button class="sr act bad" data-pclear ${S.customPresets.length ? "" : "disabled"}>Delete all custom presets</button></div>`;
|
||||
}
|
||||
on("presets", () => { const el = $("#pedit"); if (el) el.innerHTML = presetEditor(); });
|
||||
const FORMATS = [["opus96", "Opus 96 kbps"], ["opus160", "Opus 160 kbps"], ["opus256", "Opus 256 kbps"], ["flac", "FLAC (original)"]];
|
||||
|
||||
function serverHtml(srv) {
|
||||
const dup = srv.mid && S.servers.find(o => o !== srv && o.mid === srv.mid && S.servers.indexOf(o) < S.servers.indexOf(srv));
|
||||
return `<div class="srv"><div class="row"><b>${esc(srv.name || srv.url)}</b>
|
||||
<span class="note">${srv.env ? "through this stemserve (PLEX_URL)" : esc(srv.url)}</span><span class="grow"></span>
|
||||
const secs = srv.sections || [];
|
||||
return `<div class="sr srv"><div class="sl"><span>${esc(srv.name || srv.url)}</span><small>${srv.env ? "Through stemserve" : esc(srv.url)}</small></div><div class="sc">
|
||||
<button class="btn small" data-refsrv="${esc(srv.id)}">Refresh</button>
|
||||
${srv.env ? "" : `<button class="btn small" data-rmsrv="${esc(srv.id)}">Remove</button>`}</div>
|
||||
${dup ? `<p class="note">Same Plex server as ${esc(dup.name)}, which is used instead.</p>`
|
||||
: (srv.sections || []).length ? `<div class="secs">${srv.sections.map(sec => `<label class="check"><input type="checkbox" data-sec="${esc(srv.id)}|${esc(sec.key)}" ${sec.on ? "checked" : ""}>${esc(sec.title)}</label>`).join("")}</div>`
|
||||
: `<p class="note">No music libraries found. Try Refresh.</p>`}</div>`;
|
||||
<div class="libs">${dup ? `<small>Duplicate of ${esc(dup.name)}</small>`
|
||||
: secs.length ? secs.map(sec => `<label class="lib"><input type="checkbox" data-sec="${esc(srv.id)}|${esc(sec.key)}" ${sec.on ? "checked" : ""}>${esc(sec.title)}</label>`).join("")
|
||||
: `<small>No music libraries</small>`}</div></div>`;
|
||||
}
|
||||
|
||||
const KEYS = [["Space", "Play / pause"], ["← →", "Seek 5 s"], ["⇧ ← →", "Seek 30 s"], ["S", "Shuffle"], ["R", "Repeat"], ["[ ]", "Speed"],
|
||||
["M", "Mixer"], ["L", "Lyrics"], ["Q", "Queue"], ["K", "Karaoke"], ["P", "Next preset"]];
|
||||
|
||||
function renderSettings() {
|
||||
const theme = THEMES[S.theme] || THEMES.graphite;
|
||||
const theme = THEMES[S.theme] || THEMES.graphite, nMix = Object.keys(songMixes).length;
|
||||
view.innerHTML = `<div class="settings"><nav class="toc">${SECTIONS.map(([id, l]) => `<a href="#/settings" data-jump="${id}">${l}</a>`).join("")}</nav><div class="panes">
|
||||
<h1>Settings</h1>
|
||||
<section id="set-plex"><h2>Plex</h2>
|
||||
<div id="srvs">${S.servers.map(serverHtml).join("") || `<p class="note">No servers yet.</p>`}</div>
|
||||
<div class="row"><button class="btn primary" id="signin">Sign in with Plex</button><span class="note" id="sstatus"></span></div>
|
||||
<details><summary class="note">Add a server by URL and token</summary><div class="form">
|
||||
<label>Server URL<input type="url" id="purl" placeholder="http://10.0.0.2:32400"></label>
|
||||
<label>Token<input type="password" id="ptok"></label>
|
||||
<div class="row"><button class="btn" id="padd">Add server</button></div></div></details>
|
||||
<div class="sg">${S.servers.map(serverHtml).join("") || srow(`<span class="dim">No servers</span>`, "")}
|
||||
${srow(`<span class="dim" id="sstatus"></span>`, `<button class="btn primary small" id="signin">Sign in with Plex</button>`)}</div>
|
||||
<details class="sg"><summary class="sr"><div class="sl"><span>Add by URL and token</span></div><div class="sc chev">${ICON.down}</div></summary>
|
||||
${srow("Server URL", `<input type="url" id="purl" placeholder="http://10.0.0.2:32400">`)}
|
||||
${srow("Token", `<input type="password" id="ptok">`)}
|
||||
<div class="sr end"><button class="btn small" id="padd">Add server</button></div></details>
|
||||
</section>
|
||||
<section id="set-stems"><h2>Stem server</h2><div class="form">
|
||||
<p class="note" id="stem-info">Checking stemserve…</p>
|
||||
<label>URL (blank = this page's server)<input type="url" id="surl" placeholder="${esc(location.origin)}" value="${esc(S.stemUrl)}"></label>
|
||||
<label>Token (if stemserve has TOKEN set)<input type="password" id="stok" value="${esc(S.stemToken)}"></label>
|
||||
<div class="row"><button class="btn" id="ssave">Save and reconnect</button></div></div>
|
||||
<section id="set-stems"><h2>Stem server</h2><div class="sg">
|
||||
${srow("Status", `<span class="stat" id="stem-info">Checking…</span>`)}
|
||||
${srow("URL", `<input type="url" id="surl" placeholder="${esc(location.origin)}" value="${esc(S.stemUrl)}">`)}
|
||||
${srow("Token", `<input type="password" id="stok" value="${esc(S.stemToken)}" placeholder="None">`)}
|
||||
<div class="sr end"><button class="btn small" id="ssave">Save and reconnect</button></div></div>
|
||||
</section>
|
||||
<section id="set-stemopts"><h2>Stems</h2><div class="form">
|
||||
<label>Stem format<select id="fmt">${FORMATS.map(([v, l]) => `<option value="${v}" ${S.fmt === v ? "selected" : ""}>${l}</option>`).join("")}</select></label>
|
||||
<label>Cache Ahead<div class="row"><input type="range" id="precache" min="0" max="50" step="1" value="${S.precache}"><input type="number" id="precachen" min="0" max="50" value="${S.precache}"> songs</div></label>
|
||||
<label class="check"><input type="checkbox" id="keepmix" ${S.keepMix ? "checked" : ""}>Keep Stem Mix Between Songs</label>
|
||||
<div class="row"><span class="note">${plural(Object.keys(songMixes).length, "saved song mix")}</span>${Object.keys(songMixes).length ? `<button class="btn small" id="forgetall">Forget all</button>` : ""}</div></div>
|
||||
<section id="set-stemopts"><h2>Stems</h2><div class="sg">
|
||||
${srow("Format", `<select id="fmt">${FORMATS.map(([v, l]) => `<option value="${v}" ${S.fmt === v ? "selected" : ""}>${l}</option>`).join("")}</select>`)}
|
||||
${srow("Cache ahead", `<input type="range" id="precache" min="0" max="50" step="1" value="${S.precache}"><input type="number" id="precachen" min="0" max="50" value="${S.precache}"><span class="dim">songs</span>`)}
|
||||
${stog("Keep mix between songs", sw(`id="keepmix"`, S.keepMix))}
|
||||
${srow("Saved song mixes", `<span class="val">${nMix}</span>${nMix ? `<button class="btn small" id="forgetall">Forget all</button>` : ""}`)}</div>
|
||||
</section>
|
||||
<section id="set-presets"><h2>Stem Editor</h2><div id="pedit">${presetEditor()}</div></section>
|
||||
<section id="set-karaoke"><h2>Karaoke</h2><div class="form">
|
||||
<label class="check"><input type="checkbox" id="kon" ${S.karaoke ? "checked" : ""}>Karaoke on (K)</label>
|
||||
<label>Vocals in karaoke<select id="kmode">${[["off", "Off"], ["soft", "Soft"], ["on", "Left on (lyrics only)"]].map(([v, l]) => `<option value="${v}" ${S.karaokeMode === v ? "selected" : ""}>${l}</option>`).join("")}</select></label>
|
||||
<label>Soft vocal level: <span id="kdbv">${S.softDb} dB</span><input type="range" id="kdb" min="-30" max="-3" step="1" value="${S.softDb}"></label></div>
|
||||
<section id="set-karaoke"><h2>Karaoke</h2><div class="sg">
|
||||
${stog(`Karaoke <kbd>K</kbd>`, sw(`id="kon"`, S.karaoke))}
|
||||
${srow("Vocals", `<select id="kmode">${[["off", "Off"], ["soft", "Soft"], ["on", "Left on (lyrics only)"]].map(([v, l]) => `<option value="${v}" ${S.karaokeMode === v ? "selected" : ""}>${l}</option>`).join("")}</select>`)}
|
||||
${srow("Soft vocal level", `<input type="range" id="kdb" min="-30" max="-3" step="1" value="${S.softDb}"><span class="val num" id="kdbv">${S.softDb} dB</span>`)}</div>
|
||||
</section>
|
||||
<section id="set-look"><h2>Appearance</h2><div class="form">
|
||||
<div class="themes">${Object.entries(THEMES).map(([k, t]) => `<button class="swatch ${S.theme === k ? "on" : ""}" data-theme="${k}" style="background:${t.bg};color:${t.text};border-color:${t.line}"><i style="background:${t.accent}"></i>${k[0].toUpperCase() + k.slice(1)}</button>`).join("")}</div>
|
||||
<div class="row"><label class="check">Accent <input type="color" id="accent" value="${S.accent || theme.accent}"></label>${S.accent ? `<button class="btn small" id="accentreset">Use the theme's</button>` : ""}</div>
|
||||
<label class="check"><input type="checkbox" id="acapella" ${S.acapella ? "checked" : ""}>Spell the vocals-only preset “Acapella”</label>
|
||||
<div class="row"><span class="note">Player bar</span>${BAR.map(([k, l]) => `<label class="check"><input type="checkbox" data-bar="${k}" ${S.bar[k] ? "checked" : ""}>${l}</label>`).join("")}</div>
|
||||
<label>Custom CSS<textarea id="css" rows="8" spellcheck="false" placeholder=":root { --accent: #7cf; --radius: 4px; }\n.card img { border-radius: 0; }">${esc(S.css)}</textarea></label>
|
||||
<p class="note">--bg --panel --raised --line --text --muted --accent --accent-ink --radius --wave --wave-ghost</p></div>
|
||||
<section id="set-look"><h2>Appearance</h2>
|
||||
<div class="sg"><div class="sr col"><div class="sl"><span>Theme</span></div>
|
||||
<div class="themes">${Object.entries(THEMES).map(([k, t]) => `<button class="swatch ${S.theme === k ? "on" : ""}" data-theme="${k}" style="background:${t.bg};color:${t.text};border-color:${t.line}"><i style="background:${t.accent}"></i>${k[0].toUpperCase() + k.slice(1)}</button>`).join("")}</div></div>
|
||||
${srow("Accent", `${S.accent ? `<button class="btn small" id="accentreset">Reset</button>` : ""}<input type="color" id="accent" value="${S.accent || theme.accent}">`)}
|
||||
${stog("Match album art", sw(`id="arttheme"`, S.artTheme))}
|
||||
${stog("Call the vocals-only preset “Acapella”", sw(`id="acapella"`, S.acapella))}</div>
|
||||
<h3 class="sgh">Player bar</h3>
|
||||
<div class="sg">${BAR.map(([k, l]) => stog(l, sw(`data-bar="${k}"`, S.bar[k]))).join("")}</div>
|
||||
<h3 class="sgh">Custom CSS</h3>
|
||||
<div class="sg"><div class="sr col"><textarea id="css" rows="7" spellcheck="false" placeholder=":root { --accent: #7cf; --radius: 4px; }\n.card img { border-radius: 0; }">${esc(S.css)}</textarea>
|
||||
<small class="mono">--bg --panel --raised --line --text --muted --accent --accent-ink --radius --wave --wave-ghost</small></div></div>
|
||||
</section>
|
||||
<section id="set-offline"><h2>Offline</h2>
|
||||
<p class="note" id="storage-info">${plural(Offline.ids.size, "track")} downloaded. <a class="link" href="#/downloads">Manage downloads</a></p>
|
||||
${isSecureContext && navigator.storage?.persist ? `<div class="row"><button class="btn small" id="persist">Ask the browser to keep downloads</button></div>` : ""}
|
||||
<section id="set-offline"><h2>Offline</h2><div class="sg">
|
||||
${srow("Downloads", `<span class="val" id="storage-info">${plural(Offline.ids.size, "track")}</span><a class="btn small" href="#/downloads">Manage</a>`)}
|
||||
${isSecureContext && navigator.storage?.persist ? srow("Keep downloads", `<button class="btn small" id="persist">Ask browser</button>`) : ""}</div>
|
||||
</section>
|
||||
<section id="set-backup"><h2>Backup</h2>
|
||||
<p class="note">Includes your Plex tokens.</p>
|
||||
<div class="row"><button class="btn" id="export">Export</button><label class="btn">Import<input type="file" id="import" accept="application/json" hidden></label></div>
|
||||
<section id="set-backup"><h2>Backup</h2><div class="sg">
|
||||
${srow("Settings, mixes and playlists", `<button class="btn small" id="export">Export</button><label class="btn small">Import<input type="file" id="import" accept="application/json" hidden></label>`, "Includes your Plex tokens")}</div>
|
||||
</section>
|
||||
<section id="set-keys"><h2>Keys</h2><p class="note">Space play/pause · ←/→ seek 5s (shift 30s) · S shuffle · R repeat · [ ] speed · M mixer · L lyrics · Q queue · K karaoke · P next preset · hold Next to skip the album · right-click a song or album for more</p></section>
|
||||
<section id="set-about"><h2>About</h2>
|
||||
<p><b>Stemify</b> <span class="note" id="about-ver"></span></p>
|
||||
<p class="note">Your Plex and Jellyfin music, split into stems you can mix.</p>
|
||||
<div class="people">
|
||||
<div class="person"><b>Chris Nutter</b><span class="note">Stemify WebUI and the iOS app</span><div class="row">
|
||||
<a class="btn small" href="https://iamchrisama.com" target="_blank" rel="noopener">iamchrisama.com</a>
|
||||
<a class="btn small" href="https://buymeacoffee.com/cdnutter" target="_blank" rel="noopener">Buy Me a Coffee</a></div></div>
|
||||
<div class="person"><b>Kevin Viers</b><span class="note">stemd and the Android app</span><div class="row">
|
||||
<a class="btn small" href="https://github.com/kevinViers/" target="_blank" rel="noopener">GitHub</a>
|
||||
<a class="btn small" href="https://venmo.com/code?user_id=2910252785729536546&created=1792897467" target="_blank" rel="noopener">Venmo</a></div></div>
|
||||
</div>
|
||||
<p class="note">Stemify is free. A tip goes straight to the person you pick.</p>
|
||||
<section id="set-keys"><h2>Keys</h2><div class="sg"><div class="keys">${KEYS.map(([k, l]) => `<div><span>${l}</span>${k.split(" ").map(x => `<kbd>${x}</kbd>`).join("")}</div>`).join("")}</div></div></section>
|
||||
<section id="set-about"><h2>About</h2><div class="sg">
|
||||
${srow("Stemify", `<span class="val dim" id="about-ver"></span>`, "Your Plex and Jellyfin music, split into stems you can mix")}
|
||||
${srow("Chris Nutter", `<a class="btn small" href="https://iamchrisama.com" target="_blank" rel="noopener">Website</a><a class="btn small" href="https://buymeacoffee.com/cdnutter" target="_blank" rel="noopener">Buy Me a Coffee</a>`, "Web UI and iOS app")}
|
||||
${srow("Kevin Viers", `<a class="btn small" href="https://github.com/kevinViers/" target="_blank" rel="noopener">GitHub</a><a class="btn small" href="https://venmo.com/code?user_id=2910252785729536546&created=1792897467" target="_blank" rel="noopener">Venmo</a>`, "stemd and Android app")}</div>
|
||||
</section>
|
||||
</div></div>`;
|
||||
|
||||
@@ -1199,9 +1252,16 @@ function renderSettings() {
|
||||
const el = $("#stem-info");
|
||||
const v = $("#about-ver");
|
||||
if (v && info) v.textContent = `stemserve v${info.version}`;
|
||||
if (el) el.textContent = info ? `stemserve v${info.version} at ${stemBase()}, ${info.tracks} tracks with stems${info.ffmpeg ? ", Opus available" : ""}.` : `Can't reach stemserve at ${stemBase()}.`;
|
||||
if (el) { el.textContent = info ? `v${info.version} · ${info.tracks} tracks${info.ffmpeg ? " · Opus" : ""}` : "Unreachable"; el.classList.add(info ? "ok" : "bad"); }
|
||||
});
|
||||
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(() => {});
|
||||
navigator.storage?.estimate?.().then(e => { const el = $("#storage-info"); if (el && e?.quota) el.insertAdjacentText("beforeend", ` · ${fmtBytes(e.usage)} of ${fmtBytes(e.quota)}`); }).catch(() => {});
|
||||
|
||||
// The section in view lights up in the side list.
|
||||
const toc = [...view.querySelectorAll(".toc a")];
|
||||
const spy = new IntersectionObserver(es => {
|
||||
for (const e of es) if (e.isIntersecting) for (const a of toc) a.classList.toggle("on", "set-" + a.dataset.jump === e.target.id);
|
||||
}, { root: view, rootMargin: "0px 0px -70% 0px" });
|
||||
view.querySelectorAll(".panes section").forEach(s => spy.observe(s));
|
||||
|
||||
const again = () => { if (location.hash.startsWith("#/settings")) renderSettings(); };
|
||||
const plexChanged = () => { genreCache = null; save(); };
|
||||
@@ -1226,6 +1286,7 @@ function renderSettings() {
|
||||
const ahead = v => { S.precache = Math.max(0, Math.min(50, Math.round(+v || 0))); $("#precache").value = $("#precachen").value = S.precache; save(); };
|
||||
$("#precache").oninput = ev => ahead(ev.target.value);
|
||||
$("#precachen").onchange = ev => ahead(ev.target.value);
|
||||
$("#arttheme").onchange = ev => { S.artTheme = ev.target.checked; save(); ArtTheme.set(S.artTheme ? artOf(Q.cur(), 64) : ""); };
|
||||
$("#acapella").onchange = ev => { S.acapella = ev.target.checked; save(); emit("presets"); emit("mix"); };
|
||||
if ($("#forgetall")) $("#forgetall").onclick = () => { for (const k of Object.keys(songMixes)) forgetSongMix(k); again(); };
|
||||
$("#kon").onchange = ev => setKaraoke(ev.target.checked);
|
||||
@@ -1257,7 +1318,7 @@ function renderSettings() {
|
||||
const b = ev.target.closest("[data-jump], [data-theme], [data-refsrv], [data-rmsrv], [data-plock], [data-pmove], [data-pdel], [data-padd], [data-prestore], [data-pclear]");
|
||||
if (!b) return;
|
||||
const ds = b.dataset;
|
||||
if (ds.jump) { ev.preventDefault(); $("#set-" + ds.jump).scrollIntoView({ behavior: "smooth" }); }
|
||||
if (ds.jump) { ev.preventDefault(); $("#set-" + ds.jump).scrollIntoView({ behavior: "smooth", block: "start" }); }
|
||||
else if (ds.theme) { S.theme = ds.theme; S.accent = ""; applyTheme(); save(); again(); }
|
||||
else if (ds.refsrv) { try { await refreshServer(server(ds.refsrv)); toast("Refreshed"); } catch (e) { toast(e.message); } plexChanged(); again(); }
|
||||
else if (ds.rmsrv && confirm("Remove this server?")) { S.servers = S.servers.filter(s => s.id !== ds.rmsrv); plexChanged(); again(); }
|
||||
|
||||
+1
-1
@@ -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: "", sideArt: false,
|
||||
theme: "graphite", accent: "", css: "", sideArt: false, artTheme: false,
|
||||
}, load(KEY) || {});
|
||||
|
||||
if (!S.clientId) S.clientId = uuid();
|
||||
|
||||
+80
-17
@@ -8,7 +8,7 @@
|
||||
--accent: #3a81ed;
|
||||
--accent-ink: #ffffff;
|
||||
--radius: 6px;
|
||||
--player-h: 90px;
|
||||
--player-h: 100px;
|
||||
--nav-w: 240px;
|
||||
--glass: #101010ee;
|
||||
--hover: #e7e7e70d;
|
||||
@@ -182,21 +182,79 @@ body.no-stems .tracks:not(:has(tbody tr.nostem)) ~ .only-nostems { display: bloc
|
||||
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
|
||||
.check { display: flex !important; gap: 8px; align-items: center; color: var(--text) !important; font-size: 14px !important; }
|
||||
textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; resize: vertical; color: var(--text); }
|
||||
.settings { display: grid; grid-template-columns: 150px 1fr; gap: 32px; align-items: start; }
|
||||
.toc { position: sticky; top: 0; display: grid; gap: 2px; }
|
||||
.toc a { padding: 6px 10px; border-radius: 8px; color: var(--muted); }
|
||||
.settings { display: grid; grid-template-columns: 168px minmax(0, 680px); gap: 40px; align-items: start; }
|
||||
.settings h1 { margin-bottom: 18px; }
|
||||
.toc { position: sticky; top: 0; display: grid; gap: 2px; padding-top: 52px; }
|
||||
.toc a { position: relative; padding: 7px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13px; transition: color .12s, background-color .12s; }
|
||||
.toc a:hover { color: var(--text); background: var(--hover); }
|
||||
.panes section { max-width: 640px; padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); scroll-margin-top: 10px; }
|
||||
.panes section h2 { margin-top: 0; }
|
||||
.srv { padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
|
||||
.srv .row { margin: 0; }
|
||||
.secs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
|
||||
details summary { cursor: pointer; margin: 12px 0; }
|
||||
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
|
||||
.swatch { border: 1px solid; border-radius: 10px; padding: 10px; text-align: left; font-weight: 600; display: flex; gap: 8px; align-items: center; }
|
||||
.toc a.on { color: var(--text); background: var(--raised); }
|
||||
.toc a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
|
||||
.panes section { scroll-margin-top: 8px; margin-bottom: 34px; }
|
||||
.panes section h2 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
|
||||
.sgh { margin: 18px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
|
||||
.sg { display: block; margin-bottom: 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
|
||||
.sr { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 52px; padding: 10px 16px; text-align: left; }
|
||||
.sr + .sr { border-top: 1px solid var(--line); }
|
||||
label.sr { cursor: pointer; }
|
||||
.sl { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
|
||||
.sl > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
|
||||
.sl small, .libs small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.sc { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; max-width: 62%; }
|
||||
.sc input[type=url], .sc input[type=password], .sc select { width: 260px; max-width: 100%; height: 32px; border-radius: 6px; }
|
||||
.sc input[type=range] { width: 160px; }
|
||||
.sc input[type=number]#precachen { width: 56px; height: 32px; border-radius: 6px; }
|
||||
.sr.col { flex-direction: column; align-items: stretch; gap: 12px; }
|
||||
.sr.end { justify-content: flex-end; }
|
||||
.sg .val { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-variant-numeric: tabular-nums; }
|
||||
.sg .val svg { width: 15px; height: 15px; fill: currentColor; }
|
||||
.val.num { min-width: 48px; justify-content: flex-end; }
|
||||
.dim { color: var(--muted); }
|
||||
.sr.act { justify-content: flex-start; color: var(--accent); font-weight: 500; font-size: 14px; transition: background-color .12s; }
|
||||
.sr.act:not(:disabled):hover { background: var(--hover); }
|
||||
.sr.act.bad { color: #ff453a; }
|
||||
.ibs { gap: 2px; }
|
||||
.ib { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); transition: color .12s, background-color .12s; }
|
||||
.ib svg { width: 16px; height: 16px; fill: currentColor; }
|
||||
.ib:not(:disabled):hover { color: var(--text); background: var(--hover); }
|
||||
.ib.on { color: var(--accent); }
|
||||
.ib.bad:not(:disabled):hover { color: #ff453a; }
|
||||
.sw { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 40px; height: 24px; margin: 0; border-radius: 12px; cursor: pointer;
|
||||
background: color-mix(in srgb, var(--text) 18%, transparent); transition: background-color .18s; }
|
||||
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
|
||||
transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
|
||||
.sw:checked { background: var(--accent); }
|
||||
.sw:checked::after { transform: translateX(16px); }
|
||||
.sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.stat { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
|
||||
.stat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .5; }
|
||||
.stat.ok::before { background: #30d158; opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, #30d158 22%, transparent); }
|
||||
.stat.bad::before { background: #ff453a; opacity: 1; }
|
||||
.sr.srv { flex-wrap: wrap; }
|
||||
.libs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.lib { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted);
|
||||
background: var(--raised); transition: color .12s, background-color .12s; }
|
||||
.lib input { display: none; }
|
||||
.lib:has(:checked) { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--raised)); }
|
||||
details.sg > summary { list-style: none; cursor: pointer; }
|
||||
details.sg > summary::-webkit-details-marker { display: none; }
|
||||
.chev svg { width: 18px; height: 18px; fill: var(--muted); transition: transform .2s; }
|
||||
details[open] .chev svg { transform: rotate(180deg); }
|
||||
.sg textarea { min-height: 120px; border-radius: 6px; }
|
||||
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--muted); line-height: 1.6; }
|
||||
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 5px; font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
|
||||
color: var(--text); background: var(--raised); box-shadow: inset 0 -1px 0 var(--line), 0 0 0 1px var(--line); }
|
||||
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
|
||||
.keys > div { display: flex; align-items: center; gap: 4px; min-height: 42px; padding: 8px 16px; font-size: 13px; border-top: 1px solid var(--line); margin-top: -1px; }
|
||||
.keys > div > span { flex: 1; color: var(--muted); }
|
||||
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
|
||||
.swatch { border: 1px solid; border-radius: 8px; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: center; transition: transform .12s; }
|
||||
.swatch:hover { transform: translateY(-1px); }
|
||||
.swatch i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
|
||||
.swatch.on { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
|
||||
input[type=color] { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
|
||||
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
|
||||
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
|
||||
input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }
|
||||
.note { color: var(--muted); font-size: 13px; }
|
||||
|
||||
#drawer { width: 320px; background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 22px 20px; }
|
||||
@@ -272,6 +330,7 @@ input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var
|
||||
.q-item .x { color: var(--muted); font-size: 18px; padding: 0 4px; opacity: 0; }
|
||||
.q-item:hover .x { opacity: 1; }
|
||||
|
||||
body, #nav, #player, .sg { transition: background-color .5s; }
|
||||
#player { position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h); background: var(--bg);
|
||||
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; }
|
||||
@@ -289,7 +348,7 @@ input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var
|
||||
.np-text { min-width: 0; }
|
||||
#np-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
#np-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
||||
.center { display: grid; gap: 4px; }
|
||||
.center { display: grid; gap: 10px; }
|
||||
.transport { display: flex; justify-content: center; align-items: center; gap: 20px; font-size: 18px; }
|
||||
.transport button { color: #c5c5c5; }
|
||||
.transport button:hover { color: #fff; }
|
||||
@@ -316,7 +375,7 @@ input[type=color] { width: 40px; height: 28px; padding: 0; border: 1px solid var
|
||||
input[type=range] { accent-color: var(--accent); }
|
||||
|
||||
@media (max-width: 860px) {
|
||||
:root { --player-h: 150px; }
|
||||
:root { --player-h: 162px; }
|
||||
#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; }
|
||||
@@ -326,8 +385,12 @@ input[type=range] { accent-color: var(--accent); }
|
||||
#nav a { min-height: 32px; }
|
||||
#search input { margin: 0; width: 120px; }
|
||||
#live { margin: 0; white-space: nowrap; }
|
||||
.settings { grid-template-columns: 1fr; }
|
||||
.toc { position: static; display: flex; flex-wrap: wrap; }
|
||||
.settings { grid-template-columns: 1fr; gap: 0; }
|
||||
.toc { display: none; }
|
||||
.sr:not(.col) { flex-wrap: wrap; gap: 8px 16px; }
|
||||
.sc { max-width: 100%; }
|
||||
.sc input[type=url], .sc input[type=password], .sc select { width: 100%; }
|
||||
.sr:has(input[type=url], input[type=password], select, input[type=range]) .sc { flex: 1 1 100%; }
|
||||
.tracks .acts button { opacity: 1; }
|
||||
.tracks .al, .tracks .off { display: none; }
|
||||
.tracks .n { width: 34px; }
|
||||
|
||||
@@ -36,6 +36,8 @@ export const ICON = {
|
||||
save: '<svg viewBox="0 0 24 24"><path d="M6 3h10l4 4v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm0 2v14h12V7.8L15.2 5H15v4H7V5H6zm3 0v2h4V5H9zm3 7a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',
|
||||
check: '<svg viewBox="0 0 24 24"><path d="M9.5 16.2L5.3 12l-1.4 1.4 5.6 5.6L20.1 8.4 18.7 7z"/></svg>',
|
||||
pladd: '<svg viewBox="0 0 24 24"><path d="M3 5h13v2H3zm0 5h13v2H3zm0 5h8v2H3zm15-2h2v3h3v2h-3v3h-2v-3h-3v-2h3z"/></svg>',
|
||||
up: '<svg viewBox="0 0 24 24"><path d="M12 7.6l7.7 7.7-1.4 1.4-6.3-6.3-6.3 6.3-1.4-1.4z"/></svg>',
|
||||
down: '<svg viewBox="0 0 24 24"><path d="M12 16.4L4.3 8.7l1.4-1.4 6.3 6.3 6.3-6.3 1.4 1.4z"/></svg>',
|
||||
x: '<svg viewBox="0 0 24 24"><path d="M6.4 5L12 10.6 17.6 5 19 6.4 13.4 12l5.6 5.6-1.4 1.4-5.6-5.6L6.4 19 5 17.6 10.6 12 5 6.4z"/></svg>',
|
||||
lock: '<svg viewBox="0 0 24 24"><path d="M7 10V7a5 5 0 0 1 10 0v3h.5A1.5 1.5 0 0 1 19 11.5v8a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 5 19.5v-8A1.5 1.5 0 0 1 6.5 10H7zm2 0h6V7a3 3 0 0 0-6 0v3z"/></svg>',
|
||||
play: '<svg viewBox="0 0 24 24"><path d="M7 4.5v15a1 1 0 0 0 1.5.86l12.5-7.5a1 1 0 0 0 0-1.72L8.5 3.64A1 1 0 0 0 7 4.5z"/></svg>',
|
||||
|
||||
Reference in new issue
Block a user