From 22cce807a0a2437cd38091dc70f7ae2b9d21e831 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 12 Jul 2026 19:14:40 +0200 Subject: [PATCH 1/7] feat(glass): variable-drive the glass system + dev GlassTuner (Phase 0/0b) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Foundation for the app-wide glass-consistency epic: - index.css: every look-driving value (blur/saturate/dark-brightness/panel-card- menu opacity/border/inset/edge/scrim/ambient + mosaic) is now a CSS custom property defaulting to the historical hard-coded value — one-place tunable, no visual change until a value is bumped. - GlassTuner.tsx: dev-only (localhost-gated) always-on corner panel that live- drives those vars, with treatment presets (Adaptive/Gradient+/Edge+scrim), per-scheme palette editor, muted thumbnail-mosaic toggle, localStorage persist, and Copy-CSS export. Deleted once the tuned finals are baked in. - MosaicBackdrop.tsx: opt-in muted (blur+darken+desaturate) mosaic of on-screen thumbnails so dark glass has real content to refract. --- frontend/src/App.tsx | 4 + frontend/src/components/GlassTuner.tsx | 374 +++++++++++++++++++++ frontend/src/components/MosaicBackdrop.tsx | 58 ++++ frontend/src/index.css | 104 ++++-- 4 files changed, 520 insertions(+), 20 deletions(-) create mode 100644 frontend/src/components/GlassTuner.tsx create mode 100644 frontend/src/components/MosaicBackdrop.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4f0892a..4d178b4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -50,6 +50,7 @@ import Header from "./components/Header"; import NavSidebar from "./components/NavSidebar"; import Sidebar from "./components/Sidebar"; import BackToTop from "./components/BackToTop"; +import GlassTuner from "./components/GlassTuner"; import ChatDock from "./components/ChatDock"; import Toaster from "./components/Toaster"; import ErrorDialog from "./components/ErrorDialog"; @@ -903,6 +904,9 @@ export default function App() { {/* Re-binds to the active page's scroll container on navigation (page or channel change). */} + {/* DEV-ONLY live appearance tuner (localhost-gated; self-returns null on prod). Delete when + the glass-consistency epic bakes the final values into index.css. */} + ); } diff --git a/frontend/src/components/GlassTuner.tsx b/frontend/src/components/GlassTuner.tsx new file mode 100644 index 0000000..a51a99e --- /dev/null +++ b/frontend/src/components/GlassTuner.tsx @@ -0,0 +1,374 @@ +import { useEffect, useMemo, useState } from "react"; +import MosaicBackdrop from "./MosaicBackdrop"; + +/** + * DEV-ONLY live appearance tuner. Mounted at the App root so it stays reachable on every page. + * It writes the glass CSS custom properties (index.css `:root`) inline on for instant, + * build-free feedback, and persists to localStorage so tweaks survive an F5 during UAT. + * + * Gated to localhost/127.0.0.1 so it renders on the :8080 UAT build and :5173 HMR but NEVER on + * prod (siftlode.b1fr0st.eu). It is a scaffold for the glass-consistency epic: dial in values + * here, hit "Copy CSS", hand them over to bake into index.css — then this component is deleted. + */ +const DEV_TUNER = + typeof window !== "undefined" && /^(localhost|127\.0\.0\.1)$/.test(window.location.hostname); + +const LS_KEY = "siftlode.devGlassTuner"; + +type Slider = { + k: string; + label: string; + min: number; + max: number; + step: number; + unit: string; + def: number; +}; + +const SLIDERS: Slider[] = [ + { k: "--glass-blur", label: "Blur radius", min: 0, max: 40, step: 1, unit: "px", def: 30 }, + { k: "--glass-saturate", label: "Saturation", min: 1, max: 2.5, step: 0.05, unit: "", def: 1.8 }, + { k: "--glass-dark-bright", label: "Dark brightness", min: 1, max: 2, step: 0.05, unit: "", def: 1.4 }, + { k: "--glass-surface-alpha", label: "Panel opacity", min: 40, max: 100, step: 1, unit: "%", def: 78 }, + { k: "--glass-card-alpha", label: "Card opacity", min: 40, max: 100, step: 1, unit: "%", def: 84 }, + { k: "--glass-menu-alpha", label: "Menu opacity", min: 60, max: 100, step: 1, unit: "%", def: 92 }, + { k: "--glass-border-alpha", label: "Border opacity", min: 20, max: 100, step: 1, unit: "%", def: 78 }, + { k: "--glass-edge", label: "Edge-light rim", min: 0, max: 60, step: 1, unit: "%", def: 0 }, + { k: "--glass-inset", label: "Top highlight", min: 0, max: 40, step: 1, unit: "%", def: 16 }, + { k: "--glass-scrim", label: "Under-text scrim", min: 0, max: 85, step: 1, unit: "%", def: 0 }, + { k: "--ambient", label: "Ambient intensity", min: 0, max: 2, step: 0.05, unit: "", def: 1 }, +]; + +const MOSAIC_SLIDERS: Slider[] = [ + { k: "--mosaic-blur", label: "Mosaic blur", min: 20, max: 100, step: 1, unit: "px", def: 64 }, + { k: "--mosaic-sat", label: "Mosaic saturation", min: 0, max: 1.5, step: 0.05, unit: "", def: 0.7 }, + { k: "--mosaic-bright", label: "Mosaic brightness", min: 0.2, max: 1, step: 0.05, unit: "", def: 0.5 }, + { k: "--mosaic-opacity", label: "Mosaic opacity", min: 0, max: 1, step: 0.05, unit: "", def: 0.5 }, +]; + +const PALETTE: { k: string; label: string }[] = [ + { k: "--bg", label: "Background" }, + { k: "--surface", label: "Surface" }, + { k: "--card", label: "Card" }, + { k: "--border", label: "Border" }, + { k: "--fg", label: "Text" }, + { k: "--muted", label: "Muted" }, + { k: "--accent", label: "Accent" }, +]; + +// Each preset resets every slider to its default, then applies these overrides. +const PRESETS: { id: string; name: string; hint: string; over: Record }[] = [ + { id: "current", name: "Current", hint: "The shipped defaults", over: {} }, + { + id: "adaptive", + name: "Adaptive (rec.)", + hint: "Solid-enough dark glass", + over: { + "--glass-surface-alpha": 94, + "--glass-card-alpha": 94, + "--glass-menu-alpha": 98, + "--glass-scrim": 14, + "--glass-edge": 10, + "--ambient": 1.1, + "--glass-dark-bright": 1.25, + "--glass-blur": 20, + }, + }, + { id: "gradient", name: "Gradient+", hint: "Stronger accent pools", over: { "--ambient": 1.6, "--glass-scrim": 6 } }, + { + id: "wcag", + name: "Edge + scrim", + hint: "Max readability", + over: { "--glass-edge": 42, "--glass-scrim": 45, "--glass-surface-alpha": 84, "--glass-card-alpha": 90 }, + }, +]; + +const ALL = [...SLIDERS, ...MOSAIC_SLIDERS]; +const root = () => document.documentElement; +const readVar = (k: string) => getComputedStyle(root()).getPropertyValue(k).trim(); + +type Saved = { + vars?: Record; + palette?: Record; + mosaic?: boolean; + open?: boolean; +}; + +function loadSaved(): Saved { + try { + return JSON.parse(localStorage.getItem(LS_KEY) || "{}") as Saved; + } catch { + return {}; + } +} + +export default function GlassTuner() { + const initial = useMemo(loadSaved, []); + const [vars, setVars] = useState>(() => { + const base: Record = {}; + ALL.forEach((s) => (base[s.k] = s.def)); + return { ...base, ...(initial.vars || {}) }; + }); + const [palette, setPalette] = useState>(() => initial.palette || {}); + const [mosaic, setMosaic] = useState(() => Boolean(initial.mosaic)); + const [open, setOpen] = useState(() => initial.open ?? true); + const [tab, setTab] = useState<"glass" | "palette">("glass"); + const [copied, setCopied] = useState(false); + // Seed the colour pickers from the live scheme for display (without forcing them onto ). + const [swatches, setSwatches] = useState>({}); + + // Apply saved var overrides (and any saved palette edits) once on mount. + useEffect(() => { + Object.entries(initial.vars || {}).forEach(([k, v]) => { + const unit = ALL.find((s) => s.k === k)?.unit ?? ""; + root().style.setProperty(k, v + unit); + }); + Object.entries(initial.palette || {}).forEach(([k, v]) => root().style.setProperty(k, v)); + const sw: Record = {}; + PALETTE.forEach((p) => { + const v = (initial.palette?.[p.k] || readVar(p.k)).trim(); + sw[p.k] = /^#[0-9a-fA-F]{6}$/.test(v) ? v : "#000000"; + }); + setSwatches(sw); + }, [initial]); + + function persist(next: Partial) { + const cur = loadSaved(); + localStorage.setItem(LS_KEY, JSON.stringify({ ...cur, ...next })); + } + + function setVar(k: string, value: number) { + const unit = ALL.find((s) => s.k === k)?.unit ?? ""; + root().style.setProperty(k, value + unit); + setVars((prev) => { + const next = { ...prev, [k]: value }; + persist({ vars: next }); + return next; + }); + } + + function setColor(k: string, hex: string) { + root().style.setProperty(k, hex); + setSwatches((s) => ({ ...s, [k]: hex })); + setPalette((prev) => { + const next = { ...prev, [k]: hex }; + persist({ palette: next }); + return next; + }); + } + + function applyPreset(over: Record) { + const next: Record = { ...vars }; + SLIDERS.forEach((s) => { + const v = over[s.k] ?? s.def; + next[s.k] = v; + root().style.setProperty(s.k, v + s.unit); + }); + setVars(next); + persist({ vars: next }); + } + + function toggleMosaic(v: boolean) { + setMosaic(v); + persist({ mosaic: v }); + } + + function reset() { + [...ALL, ...PALETTE].forEach((s) => root().style.removeProperty(s.k)); + const base: Record = {}; + ALL.forEach((s) => (base[s.k] = s.def)); + setVars(base); + setPalette({}); + toggleMosaic(false); + localStorage.removeItem(LS_KEY); + const sw: Record = {}; + PALETTE.forEach((p) => { + const v = readVar(p.k); + sw[p.k] = /^#[0-9a-fA-F]{6}$/.test(v) ? v : "#000000"; + }); + setSwatches(sw); + } + + // Export only what differs from the shipped defaults, ready to paste into index.css. + const cssOut = useMemo(() => { + const lines: string[] = []; + ALL.forEach((s) => { + if (vars[s.k] !== s.def) lines.push(` ${s.k}: ${vars[s.k]}${s.unit};`); + }); + PALETTE.forEach((p) => { + if (palette[p.k]) lines.push(` ${p.k}: ${palette[p.k]};`); + }); + return lines.length ? `:root {\n${lines.join("\n")}\n}` : "/* all values at defaults */"; + }, [vars, palette]); + + function copy() { + navigator.clipboard?.writeText(cssOut).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 1200); + }); + } + + function persistOpen(v: boolean) { + setOpen(v); + persist({ open: v }); + } + + if (!DEV_TUNER) return null; + + return ( + <> + {mosaic && } +
+ {!open && ( + + )} + {open && ( +
+
+ ◐ Glass Tuner + dev + +
+ +
+ {/* Treatment presets */} +
+
Dark treatment
+
+ {PRESETS.map((p) => ( + + ))} +
+
+ + {/* Mosaic toggle */} + + + {/* Tab switch */} +
+ {(["glass", "palette"] as const).map((t) => ( + + ))} +
+ + {tab === "glass" && ( +
+ {SLIDERS.map((s) => ( + setVar(s.k, v)} /> + ))} + {mosaic && ( +
+ {MOSAIC_SLIDERS.map((s) => ( + setVar(s.k, v)} /> + ))} +
+ )} +
+ )} + + {tab === "palette" && ( +
+

+ Overrides the live scheme (inline on <html>). Reset clears these back to the scheme. +

+ {PALETTE.map((p) => ( + + ))} +
+ )} + + {/* Export */} +
+
Export → bake in
+
+ + +
+
+                  {cssOut}
+                
+
+
+
+ )} +
+ + ); +} + +function Ctl({ s, value, onChange }: { s: Slider; value: number; onChange: (v: number) => void }) { + return ( +
+ + onChange(Number(e.target.value))} + className="w-16 text-right text-[11px] tabular-nums rounded bg-card border border-border px-1.5 py-0.5 text-accent" + /> + onChange(Number(e.target.value))} + className="col-span-2 w-full accent-accent" + /> +
+ ); +} diff --git a/frontend/src/components/MosaicBackdrop.tsx b/frontend/src/components/MosaicBackdrop.tsx new file mode 100644 index 0000000..05b8c1e --- /dev/null +++ b/frontend/src/components/MosaicBackdrop.tsx @@ -0,0 +1,58 @@ +import { useEffect, useMemo, useState } from "react"; + +/** + * DEV-ONLY, OPT-IN backdrop: a heavily blurred + darkened + desaturated mosaic of the real + * thumbnails currently on screen, so dark "glass" surfaces have actual content to refract. + * Deliberately muted (see the --mosaic-* vars in index.css) — a soft texture, never a collage. + * + * Thumbnails are sampled straight from the rendered DOM (the feed/channel image tags), so it + * needs no data wiring and works on whatever page mounts it. Looks richest on the feed; on a + * thumbnail-less page it simply falls back to the plain background. + * + * Toggled by the GlassTuner. Not shipped to prod (the tuner that mounts it is localhost-gated). + */ +export default function MosaicBackdrop({ cols = 8, rows = 6 }: { cols?: number; rows?: number }) { + const [srcs, setSrcs] = useState([]); + + // Snapshot the on-screen thumbnails once per mount (toggling the tuner off/on re-samples on a + // content-rich page). Looks richest on the feed; elsewhere it just falls back to the plain bg. + useEffect(() => { + const found = new Set(); + document.querySelectorAll("img").forEach((img) => { + const s = img.currentSrc || img.src; + if (!s) return; + // YouTube thumbnails / channel avatars — skip our own tiny UI icons/data URIs. + if (/ytimg\.com|ggpht\.com|googleusercontent\.com/.test(s)) found.add(s); + }); + setSrcs([...found]); + }, []); + + useEffect(() => { + document.documentElement.dataset.mosaic = "1"; + return () => { + delete document.documentElement.dataset.mosaic; + }; + }, []); + + const tiles = useMemo(() => { + const n = cols * rows; + if (srcs.length === 0) return []; + return Array.from({ length: n }, (_, i) => srcs[i % srcs.length]); + }, [srcs, cols, rows]); + + return ( + + ); +} diff --git a/frontend/src/index.css b/frontend/src/index.css index d66cc3e..e735122 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -4,6 +4,29 @@ :root { --font-scale: 1.06; + + /* ===== Glass tunables — every value that materially drives the look lives here so it can be + tuned in ONE place (and live-driven by the dev GlassTuner during UAT). Defaults below equal + the historical hard-coded values, so nothing changes until a value is bumped. When the user + signs off on tuned values, bake the finals right here. ===== */ + --glass-blur: 30px; /* backdrop blur radius (2026 sweet spot is ~8–16px; 30 is heavy) */ + --glass-saturate: 1.8; /* backdrop saturation */ + --glass-dark-bright: 1.4; /* extra brightness lift applied to .glass/.glass-menu in dark mode only */ + --glass-surface-alpha: 78%; /* .glass panel translucency (higher = more solid = "adaptive") */ + --glass-card-alpha: 84%; /* .glass-card translucency */ + --glass-menu-alpha: 92%; /* .glass-menu translucency */ + --glass-border-alpha: 78%; /* .glass border opacity */ + --glass-inset: 16%; /* top specular highlight strength (#fff N%) */ + --glass-edge: 0%; /* extra edge-light mixed into the TOP border (#fff N%) — 0 = off */ + --glass-scrim: 0%; /* under-content scrim: darkens surfaces toward --bg for text contrast — 0 = off */ + --ambient: 1; /* multiplier on the ambient accent backdrop pools */ + + /* Optional muted thumbnail-mosaic backdrop (off unless mounts). Conservative + defaults: heavy blur + low saturation + darkened so it reads as subtle texture, never a rainbow. */ + --mosaic-blur: 64px; + --mosaic-sat: 0.7; + --mosaic-bright: 0.5; + --mosaic-opacity: 0.5; } /* Make native controls (date picker, scrollbars) follow the theme. */ @@ -26,9 +49,9 @@ body { subtle but a touch richer (three soft pools, incl. a bottom glow) now that the nav, header and dialogs are all frosted glass and refract it. */ background: - radial-gradient(1100px 620px at 10% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%), - radial-gradient(1000px 720px at 115% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%), - radial-gradient(900px 640px at 50% 118%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 60%), + radial-gradient(1100px 620px at 10% -10%, color-mix(in srgb, var(--accent) calc(20% * var(--ambient)), transparent), transparent 60%), + radial-gradient(1000px 720px at 115% 10%, color-mix(in srgb, var(--accent) calc(14% * var(--ambient)), transparent), transparent 55%), + radial-gradient(900px 640px at 50% 118%, color-mix(in srgb, var(--accent) calc(11% * var(--ambient)), transparent), transparent 60%), var(--bg); background-attachment: fixed; } @@ -37,34 +60,44 @@ body { .glass { /* Frosted overlay surface: translucent enough that the blurred backdrop shows through (the glassy look), opaque enough that the background isn't distracting. - The strong blur turns whatever is behind into soft colour, not a sharp image. */ - background: color-mix(in srgb, var(--surface) 78%, transparent); - backdrop-filter: blur(30px) saturate(1.8); - -webkit-backdrop-filter: blur(30px) saturate(1.8); - border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); + The strong blur turns whatever is behind into soft colour, not a sharp image. + Layer 1 (top) = the optional scrim; layer 2 = the translucent surface tint. */ + background: + linear-gradient(color-mix(in srgb, var(--bg) var(--glass-scrim), transparent), color-mix(in srgb, var(--bg) var(--glass-scrim), transparent)), + color-mix(in srgb, var(--surface) var(--glass-surface-alpha), transparent); + backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)); + -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)); + border: 1px solid color-mix(in srgb, var(--border) var(--glass-border-alpha), transparent); + border-top-color: color-mix(in srgb, #fff var(--glass-edge), color-mix(in srgb, var(--border) var(--glass-border-alpha), transparent)); box-shadow: - inset 0 1px 0 color-mix(in srgb, #fff 16%, transparent), + inset 0 1px 0 color-mix(in srgb, #fff var(--glass-inset), transparent), 0 18px 44px -16px rgba(0, 0, 0, 0.6); } .glass-card { /* No backdrop-filter here: cards render in bulk (feed grid) over a solid background where blur adds almost nothing visually but is GPU-expensive and triggers reflow. Translucency + border + depth keep the look; blur is reserved for .glass overlays. */ - background: color-mix(in srgb, var(--card) 84%, transparent); + background: + linear-gradient(color-mix(in srgb, var(--bg) var(--glass-scrim), transparent), color-mix(in srgb, var(--bg) var(--glass-scrim), transparent)), + color-mix(in srgb, var(--card) var(--glass-card-alpha), transparent); border: 1px solid color-mix(in srgb, var(--border) 65%, transparent); + border-top-color: color-mix(in srgb, #fff var(--glass-edge), color-mix(in srgb, var(--border) 65%, transparent)); box-shadow: - inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent), + inset 0 1px 0 color-mix(in srgb, #fff calc(var(--glass-inset) / 2), transparent), 0 8px 22px -14px rgba(0, 0, 0, 0.45); } .glass-menu { /* Floating menus/popovers hover over undimmed content (no backdrop scrim like dialogs), so they must be near-opaque to stay readable — only a hint of translucency + the blur. */ - background: color-mix(in srgb, var(--surface) 92%, transparent); - backdrop-filter: blur(30px) saturate(1.8); - -webkit-backdrop-filter: blur(30px) saturate(1.8); + background: + linear-gradient(color-mix(in srgb, var(--bg) var(--glass-scrim), transparent), color-mix(in srgb, var(--bg) var(--glass-scrim), transparent)), + color-mix(in srgb, var(--surface) var(--glass-menu-alpha), transparent); + backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)); + -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)); border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); + border-top-color: color-mix(in srgb, #fff var(--glass-edge), color-mix(in srgb, var(--border) 80%, transparent)); box-shadow: - inset 0 1px 0 color-mix(in srgb, #fff 14%, transparent), + inset 0 1px 0 color-mix(in srgb, #fff calc(var(--glass-inset) - 2%), transparent), 0 18px 44px -16px rgba(0, 0, 0, 0.6); } .glass-hover:hover { @@ -80,9 +113,9 @@ body { (The full "videos behind glass everywhere" effect is Phase 2 / end-of-project polish.) */ html[data-theme="dark"] body { background: - radial-gradient(1100px 620px at 10% -10%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%), - radial-gradient(1000px 720px at 115% 10%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 55%), - radial-gradient(900px 640px at 50% 118%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%), + radial-gradient(1100px 620px at 10% -10%, color-mix(in srgb, var(--accent) calc(34% * var(--ambient)), transparent), transparent 60%), + radial-gradient(1000px 720px at 115% 10%, color-mix(in srgb, var(--accent) calc(24% * var(--ambient)), transparent), transparent 55%), + radial-gradient(900px 640px at 50% 118%, color-mix(in srgb, var(--accent) calc(18% * var(--ambient)), transparent), transparent 60%), var(--bg); background-attachment: fixed; } @@ -90,8 +123,8 @@ html[data-theme="dark"] body { the frosted sheen shows even over dark UI (over colourful content it just looks richer). */ html[data-theme="dark"] .glass, html[data-theme="dark"] .glass-menu { - backdrop-filter: blur(30px) saturate(1.7) brightness(1.4); - -webkit-backdrop-filter: blur(30px) saturate(1.7) brightness(1.4); + backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(var(--glass-dark-bright)); + -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate)) brightness(var(--glass-dark-bright)); } /* Toasts surface bottom-left (by the nav's notification bell), off the conventional top-right; a brighter rim draws the eye there. Most needed in dark mode, where the @@ -100,6 +133,37 @@ html[data-theme="dark"] .toast-card { border-color: color-mix(in srgb, #fff 50%, transparent); } +/* ===== Optional muted thumbnail-mosaic backdrop (mounted by ) ===== + Gives dark glass real content to refract. Kept conservative: heavy blur + low saturation + + darkened, so it reads as a soft texture behind everything, never a colourful collage. When it + is present, the ambient accent pools on are dimmed so the two don't fight. */ +.mosaic-backdrop { + position: fixed; + inset: 0; + z-index: -1; + overflow: hidden; + pointer-events: none; +} +.mosaic-backdrop .mosaic-tiles { + position: absolute; + inset: -10%; + display: grid; + gap: 0; + filter: blur(var(--mosaic-blur)) saturate(var(--mosaic-sat)) brightness(var(--mosaic-bright)); + opacity: var(--mosaic-opacity); +} +.mosaic-backdrop .mosaic-tiles > span { + display: block; + background-size: cover; + background-position: center; +} +html[data-mosaic="1"] body { + background: var(--bg); +} +html[data-perf="1"] .mosaic-backdrop { + display: none; +} + /* Performance mode (Settings → Appearance) drops the expensive blur + soft shadows. */ html[data-perf="1"] .glass, html[data-perf="1"] .glass-menu, From dc51aeeae9a46664aeea6d6453919fad8c2e0b79 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 12 Jul 2026 20:12:25 +0200 Subject: [PATCH 2/7] feat(glass): bake two-tier defaults (Adaptive chrome + media scope), add Starship/Matrix schemes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From UAT: glass reads strongest where there's content behind it, so split the look into two tiers instead of one global compromise. - index.css: global :root defaults are now the 'Adaptive' baseline (solid-enough dark glass for content-less chrome). New .glass-media scope class carries the UAT-tuned translucent values (blur 10 / surface 50% / card 60% / scrim 30% / edge 25%) for surfaces that float over real artwork. - Apply .glass-media to the art-backed Plex detail views (PlexInfo page variant, PlexShowView, PlexSeasonView) and drop PlexInfo's hard-coded inline 55% overrides so those panels are scope-driven and consistent (hero no longer reads solid while the season strips are translucent). - Two new colour schemes: Starship (deep-space blue, azure accent) and Matrix (near-black, phosphor green), each with dark+light tokens + swatches. - Remove the thumbnail-mosaic backdrop (did nothing usefully; its home is the future 'videos behind glass' phase) — deletes MosaicBackdrop, mosaic vars/CSS, and the tuner's mosaic controls. GlassTuner presets resynced to the new baseline (Current / Media / Max-readable). --- frontend/src/components/GlassTuner.tsx | 90 ++++++---------- frontend/src/components/MosaicBackdrop.tsx | 58 ---------- frontend/src/components/PlexBrowse.tsx | 4 +- frontend/src/components/PlexInfo.tsx | 5 +- frontend/src/index.css | 120 ++++++++++++--------- frontend/src/lib/theme.ts | 4 +- 6 files changed, 108 insertions(+), 173 deletions(-) delete mode 100644 frontend/src/components/MosaicBackdrop.tsx diff --git a/frontend/src/components/GlassTuner.tsx b/frontend/src/components/GlassTuner.tsx index a51a99e..5b899c5 100644 --- a/frontend/src/components/GlassTuner.tsx +++ b/frontend/src/components/GlassTuner.tsx @@ -1,5 +1,4 @@ import { useEffect, useMemo, useState } from "react"; -import MosaicBackdrop from "./MosaicBackdrop"; /** * DEV-ONLY live appearance tuner. Mounted at the App root so it stays reachable on every page. @@ -25,25 +24,19 @@ type Slider = { def: number; }; +// def = the BAKED baseline in index.css (:root). "Current" preset + the export diff both key off it. const SLIDERS: Slider[] = [ - { k: "--glass-blur", label: "Blur radius", min: 0, max: 40, step: 1, unit: "px", def: 30 }, + { k: "--glass-blur", label: "Blur radius", min: 0, max: 40, step: 1, unit: "px", def: 20 }, { k: "--glass-saturate", label: "Saturation", min: 1, max: 2.5, step: 0.05, unit: "", def: 1.8 }, - { k: "--glass-dark-bright", label: "Dark brightness", min: 1, max: 2, step: 0.05, unit: "", def: 1.4 }, - { k: "--glass-surface-alpha", label: "Panel opacity", min: 40, max: 100, step: 1, unit: "%", def: 78 }, - { k: "--glass-card-alpha", label: "Card opacity", min: 40, max: 100, step: 1, unit: "%", def: 84 }, - { k: "--glass-menu-alpha", label: "Menu opacity", min: 60, max: 100, step: 1, unit: "%", def: 92 }, + { k: "--glass-dark-bright", label: "Dark brightness", min: 1, max: 2, step: 0.05, unit: "", def: 1.25 }, + { k: "--glass-surface-alpha", label: "Panel opacity", min: 40, max: 100, step: 1, unit: "%", def: 94 }, + { k: "--glass-card-alpha", label: "Card opacity", min: 40, max: 100, step: 1, unit: "%", def: 94 }, + { k: "--glass-menu-alpha", label: "Menu opacity", min: 60, max: 100, step: 1, unit: "%", def: 98 }, { k: "--glass-border-alpha", label: "Border opacity", min: 20, max: 100, step: 1, unit: "%", def: 78 }, - { k: "--glass-edge", label: "Edge-light rim", min: 0, max: 60, step: 1, unit: "%", def: 0 }, + { k: "--glass-edge", label: "Edge-light rim", min: 0, max: 60, step: 1, unit: "%", def: 10 }, { k: "--glass-inset", label: "Top highlight", min: 0, max: 40, step: 1, unit: "%", def: 16 }, - { k: "--glass-scrim", label: "Under-text scrim", min: 0, max: 85, step: 1, unit: "%", def: 0 }, - { k: "--ambient", label: "Ambient intensity", min: 0, max: 2, step: 0.05, unit: "", def: 1 }, -]; - -const MOSAIC_SLIDERS: Slider[] = [ - { k: "--mosaic-blur", label: "Mosaic blur", min: 20, max: 100, step: 1, unit: "px", def: 64 }, - { k: "--mosaic-sat", label: "Mosaic saturation", min: 0, max: 1.5, step: 0.05, unit: "", def: 0.7 }, - { k: "--mosaic-bright", label: "Mosaic brightness", min: 0.2, max: 1, step: 0.05, unit: "", def: 0.5 }, - { k: "--mosaic-opacity", label: "Mosaic opacity", min: 0, max: 1, step: 0.05, unit: "", def: 0.5 }, + { k: "--glass-scrim", label: "Under-text scrim", min: 0, max: 85, step: 1, unit: "%", def: 14 }, + { k: "--ambient", label: "Ambient intensity", min: 0, max: 2, step: 0.05, unit: "", def: 1.1 }, ]; const PALETTE: { k: string; label: string }[] = [ @@ -58,39 +51,39 @@ const PALETTE: { k: string; label: string }[] = [ // Each preset resets every slider to its default, then applies these overrides. const PRESETS: { id: string; name: string; hint: string; over: Record }[] = [ - { id: "current", name: "Current", hint: "The shipped defaults", over: {} }, + { id: "current", name: "Current", hint: "The baked baseline", over: {} }, { - id: "adaptive", - name: "Adaptive (rec.)", - hint: "Solid-enough dark glass", + id: "media", + name: "Media (glassy)", + hint: "For art-backed pages", over: { - "--glass-surface-alpha": 94, - "--glass-card-alpha": 94, - "--glass-menu-alpha": 98, - "--glass-scrim": 14, - "--glass-edge": 10, - "--ambient": 1.1, - "--glass-dark-bright": 1.25, - "--glass-blur": 20, + "--glass-blur": 10, + "--glass-saturate": 1.6, + "--glass-dark-bright": 1.2, + "--glass-surface-alpha": 50, + "--glass-card-alpha": 60, + "--glass-menu-alpha": 66, + "--glass-border-alpha": 80, + "--glass-edge": 25, + "--glass-inset": 15, + "--glass-scrim": 30, }, }, - { id: "gradient", name: "Gradient+", hint: "Stronger accent pools", over: { "--ambient": 1.6, "--glass-scrim": 6 } }, { - id: "wcag", - name: "Edge + scrim", - hint: "Max readability", - over: { "--glass-edge": 42, "--glass-scrim": 45, "--glass-surface-alpha": 84, "--glass-card-alpha": 90 }, + id: "readable", + name: "Max readable", + hint: "Solid + strong scrim", + over: { "--glass-edge": 42, "--glass-scrim": 45, "--glass-surface-alpha": 96, "--glass-card-alpha": 96 }, }, ]; -const ALL = [...SLIDERS, ...MOSAIC_SLIDERS]; +const ALL = SLIDERS; const root = () => document.documentElement; const readVar = (k: string) => getComputedStyle(root()).getPropertyValue(k).trim(); type Saved = { vars?: Record; palette?: Record; - mosaic?: boolean; open?: boolean; }; @@ -110,7 +103,6 @@ export default function GlassTuner() { return { ...base, ...(initial.vars || {}) }; }); const [palette, setPalette] = useState>(() => initial.palette || {}); - const [mosaic, setMosaic] = useState(() => Boolean(initial.mosaic)); const [open, setOpen] = useState(() => initial.open ?? true); const [tab, setTab] = useState<"glass" | "palette">("glass"); const [copied, setCopied] = useState(false); @@ -168,18 +160,12 @@ export default function GlassTuner() { persist({ vars: next }); } - function toggleMosaic(v: boolean) { - setMosaic(v); - persist({ mosaic: v }); - } - function reset() { [...ALL, ...PALETTE].forEach((s) => root().style.removeProperty(s.k)); const base: Record = {}; ALL.forEach((s) => (base[s.k] = s.def)); setVars(base); setPalette({}); - toggleMosaic(false); localStorage.removeItem(LS_KEY); const sw: Record = {}; PALETTE.forEach((p) => { @@ -216,9 +202,7 @@ export default function GlassTuner() { if (!DEV_TUNER) return null; return ( - <> - {mosaic && } -
+
{!open && (
- {/* Mosaic toggle */} - - {/* Tab switch */}
{(["glass", "palette"] as const).map((t) => ( @@ -291,13 +269,6 @@ export default function GlassTuner() { {SLIDERS.map((s) => ( setVar(s.k, v)} /> ))} - {mosaic && ( -
- {MOSAIC_SLIDERS.map((s) => ( - setVar(s.k, v)} /> - ))} -
- )}
)} @@ -342,8 +313,7 @@ export default function GlassTuner() { )} - - + ); } diff --git a/frontend/src/components/MosaicBackdrop.tsx b/frontend/src/components/MosaicBackdrop.tsx deleted file mode 100644 index 05b8c1e..0000000 --- a/frontend/src/components/MosaicBackdrop.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { useEffect, useMemo, useState } from "react"; - -/** - * DEV-ONLY, OPT-IN backdrop: a heavily blurred + darkened + desaturated mosaic of the real - * thumbnails currently on screen, so dark "glass" surfaces have actual content to refract. - * Deliberately muted (see the --mosaic-* vars in index.css) — a soft texture, never a collage. - * - * Thumbnails are sampled straight from the rendered DOM (the feed/channel image tags), so it - * needs no data wiring and works on whatever page mounts it. Looks richest on the feed; on a - * thumbnail-less page it simply falls back to the plain background. - * - * Toggled by the GlassTuner. Not shipped to prod (the tuner that mounts it is localhost-gated). - */ -export default function MosaicBackdrop({ cols = 8, rows = 6 }: { cols?: number; rows?: number }) { - const [srcs, setSrcs] = useState([]); - - // Snapshot the on-screen thumbnails once per mount (toggling the tuner off/on re-samples on a - // content-rich page). Looks richest on the feed; elsewhere it just falls back to the plain bg. - useEffect(() => { - const found = new Set(); - document.querySelectorAll("img").forEach((img) => { - const s = img.currentSrc || img.src; - if (!s) return; - // YouTube thumbnails / channel avatars — skip our own tiny UI icons/data URIs. - if (/ytimg\.com|ggpht\.com|googleusercontent\.com/.test(s)) found.add(s); - }); - setSrcs([...found]); - }, []); - - useEffect(() => { - document.documentElement.dataset.mosaic = "1"; - return () => { - delete document.documentElement.dataset.mosaic; - }; - }, []); - - const tiles = useMemo(() => { - const n = cols * rows; - if (srcs.length === 0) return []; - return Array.from({ length: n }, (_, i) => srcs[i % srcs.length]); - }, [srcs, cols, rows]); - - return ( - - ); -} diff --git a/frontend/src/components/PlexBrowse.tsx b/frontend/src/components/PlexBrowse.tsx index 4409b5a..3f112a1 100644 --- a/frontend/src/components/PlexBrowse.tsx +++ b/frontend/src/components/PlexBrowse.tsx @@ -905,7 +905,7 @@ function PlexShowView({ } return ( -
+
{q.isLoading || !d || !show ? ( @@ -1103,7 +1103,7 @@ function PlexSeasonView({ } return ( -
+
{q.isLoading || !d || !se ? ( diff --git a/frontend/src/components/PlexInfo.tsx b/frontend/src/components/PlexInfo.tsx index 1c8a28a..f05bcdf 100644 --- a/frontend/src/components/PlexInfo.tsx +++ b/frontend/src/components/PlexInfo.tsx @@ -90,12 +90,11 @@ export default function PlexInfo({ t(`plex.info.stripSource.${src}`, { defaultValue: src.toUpperCase() }); return ( -
+
{/* Hero block: floats as a frosted glass panel over the fixed art backdrop (page variant). */}
{/* Header: close (overlay) / customize */}
@@ -302,7 +301,6 @@ export default function PlexInfo({ {cast.length > 0 && (

{t("plex.info.cast")} @@ -365,7 +363,6 @@ export default function PlexInfo({

{col.title}

diff --git a/frontend/src/index.css b/frontend/src/index.css index e735122..d0618c4 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -6,27 +6,38 @@ --font-scale: 1.06; /* ===== Glass tunables — every value that materially drives the look lives here so it can be - tuned in ONE place (and live-driven by the dev GlassTuner during UAT). Defaults below equal - the historical hard-coded values, so nothing changes until a value is bumped. When the user - signs off on tuned values, bake the finals right here. ===== */ - --glass-blur: 30px; /* backdrop blur radius (2026 sweet spot is ~8–16px; 30 is heavy) */ + tuned in ONE place (and live-driven by the dev GlassTuner during UAT). ===== */ + /* GLOBAL baseline = "Adaptive": solid-enough dark glass that reads well on content-less chrome + (nav/header/dialogs/filters/settings — where there's nothing behind the glass to refract). + Baked from UAT 2026-07-12. Rich-backdrop surfaces override these via `.glass-media` below. */ + --glass-blur: 20px; /* backdrop blur radius */ --glass-saturate: 1.8; /* backdrop saturation */ - --glass-dark-bright: 1.4; /* extra brightness lift applied to .glass/.glass-menu in dark mode only */ - --glass-surface-alpha: 78%; /* .glass panel translucency (higher = more solid = "adaptive") */ - --glass-card-alpha: 84%; /* .glass-card translucency */ - --glass-menu-alpha: 92%; /* .glass-menu translucency */ + --glass-dark-bright: 1.25; /* extra brightness lift applied to .glass/.glass-menu in dark mode only */ + --glass-surface-alpha: 94%; /* .glass panel translucency (higher = more solid = "adaptive") */ + --glass-card-alpha: 94%; /* .glass-card translucency */ + --glass-menu-alpha: 98%; /* .glass-menu translucency */ --glass-border-alpha: 78%; /* .glass border opacity */ --glass-inset: 16%; /* top specular highlight strength (#fff N%) */ - --glass-edge: 0%; /* extra edge-light mixed into the TOP border (#fff N%) — 0 = off */ - --glass-scrim: 0%; /* under-content scrim: darkens surfaces toward --bg for text contrast — 0 = off */ - --ambient: 1; /* multiplier on the ambient accent backdrop pools */ + --glass-edge: 10%; /* extra edge-light mixed into the TOP border (#fff N%) — 0 = off */ + --glass-scrim: 14%; /* under-content scrim: darkens surfaces toward --bg for text contrast — 0 = off */ + --ambient: 1.1; /* multiplier on the ambient accent backdrop pools */ +} - /* Optional muted thumbnail-mosaic backdrop (off unless mounts). Conservative - defaults: heavy blur + low saturation + darkened so it reads as subtle texture, never a rainbow. */ - --mosaic-blur: 64px; - --mosaic-sat: 0.7; - --mosaic-bright: 0.5; - --mosaic-opacity: 0.5; +/* ===== Rich-backdrop scope: surfaces that float over real imagery (Plex art hero/detail, and + later channel-page banners) want MORE translucency so the picture shows through — the "glass + over content" look. Put `.glass-media` on such a page root; every .glass* inside inherits these + (UAT-tuned 2026-07-12). Global chrome stays solid via the :root defaults above. ===== */ +.glass-media { + --glass-blur: 10px; + --glass-saturate: 1.6; + --glass-dark-bright: 1.2; + --glass-surface-alpha: 50%; + --glass-card-alpha: 60%; + --glass-menu-alpha: 66%; + --glass-border-alpha: 80%; + --glass-edge: 25%; + --glass-inset: 15%; + --glass-scrim: 30%; } /* Make native controls (date picker, scrollbars) follow the theme. */ @@ -133,37 +144,6 @@ html[data-theme="dark"] .toast-card { border-color: color-mix(in srgb, #fff 50%, transparent); } -/* ===== Optional muted thumbnail-mosaic backdrop (mounted by ) ===== - Gives dark glass real content to refract. Kept conservative: heavy blur + low saturation + - darkened, so it reads as a soft texture behind everything, never a colourful collage. When it - is present, the ambient accent pools on are dimmed so the two don't fight. */ -.mosaic-backdrop { - position: fixed; - inset: 0; - z-index: -1; - overflow: hidden; - pointer-events: none; -} -.mosaic-backdrop .mosaic-tiles { - position: absolute; - inset: -10%; - display: grid; - gap: 0; - filter: blur(var(--mosaic-blur)) saturate(var(--mosaic-sat)) brightness(var(--mosaic-bright)); - opacity: var(--mosaic-opacity); -} -.mosaic-backdrop .mosaic-tiles > span { - display: block; - background-size: cover; - background-position: center; -} -html[data-mosaic="1"] body { - background: var(--bg); -} -html[data-perf="1"] .mosaic-backdrop { - display: none; -} - /* Performance mode (Settings → Appearance) drops the expensive blur + soft shadows. */ html[data-perf="1"] .glass, html[data-perf="1"] .glass-menu, @@ -316,6 +296,50 @@ html[data-scheme="youtube"][data-theme="light"] { --accent-fg: #ffffff; } +/* Starship — deep space blue-black with a bright azure "LCARS/computer" accent */ +html[data-scheme="starship"][data-theme="dark"] { + --bg: #050b16; + --surface: #0b1728; + --card: #101f36; + --border: #1f3557; + --fg: #dfeaff; + --muted: #8aa6cc; + --accent: #38b6ff; + --accent-fg: #04101f; +} +html[data-scheme="starship"][data-theme="light"] { + --bg: #eef4fb; + --surface: #ffffff; + --card: #ffffff; + --border: #d3e0f0; + --fg: #0b1b30; + --muted: #4a5f7d; + --accent: #0b6bd6; + --accent-fg: #ffffff; +} + +/* Matrix — near-black with a phosphor-green terminal accent */ +html[data-scheme="matrix"][data-theme="dark"] { + --bg: #030a06; + --surface: #08130d; + --card: #0b1c12; + --border: #163d27; + --fg: #d6ffe4; + --muted: #6fae86; + --accent: #2fe36e; + --accent-fg: #02160a; +} +html[data-scheme="matrix"][data-theme="light"] { + --bg: #f0f7f1; + --surface: #ffffff; + --card: #ffffff; + --border: #cfe6d6; + --fg: #08130b; + --muted: #4c6b56; + --accent: #12a150; + --accent-fg: #ffffff; +} + /* Toast auto-dismiss countdown bar (shrinks left-to-right to zero) */ @keyframes toastbar { from { diff --git a/frontend/src/lib/theme.ts b/frontend/src/lib/theme.ts index db8caac..f9aa5ed 100644 --- a/frontend/src/lib/theme.ts +++ b/frontend/src/lib/theme.ts @@ -1,13 +1,15 @@ import { LS, readAccountMerged, writeAccount } from "./storage"; type Mode = "dark" | "light"; -export type Scheme = "midnight" | "forest" | "slate" | "youtube"; +export type Scheme = "midnight" | "forest" | "slate" | "youtube" | "starship" | "matrix"; export const SCHEMES: { id: Scheme; name: string; swatch: string }[] = [ { id: "midnight", name: "Midnight", swatch: "#6d8cff" }, { id: "forest", name: "Forest", swatch: "#2dd4bf" }, { id: "slate", name: "Slate", swatch: "#e8913c" }, { id: "youtube", name: "YouTube", swatch: "#ff3b46" }, + { id: "starship", name: "Starship", swatch: "#38b6ff" }, + { id: "matrix", name: "Matrix", swatch: "#2fe36e" }, ]; export interface ThemePrefs { From c1ba5229c36790bc973f5f6fab2927a27bc719a8 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 12 Jul 2026 20:27:37 +0200 Subject: [PATCH 3/7] =?UTF-8?q?fix(glass):=20soften=20the=20Matrix=20schem?= =?UTF-8?q?e=20accent=20(neon=20phosphor=20=E2=86=92=20muted=20emerald)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UAT: #2fe36e read as too vivid/stabby. Drop to #46b87c (lower saturation) + slightly less green-tinted fg; update the swatch to match. --- frontend/src/index.css | 8 ++++---- frontend/src/lib/theme.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/index.css b/frontend/src/index.css index d0618c4..2ed21a0 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -318,16 +318,16 @@ html[data-scheme="starship"][data-theme="light"] { --accent-fg: #ffffff; } -/* Matrix — near-black with a phosphor-green terminal accent */ +/* Matrix — near-black with a muted terminal-green accent (softened from neon phosphor) */ html[data-scheme="matrix"][data-theme="dark"] { --bg: #030a06; --surface: #08130d; --card: #0b1c12; --border: #163d27; - --fg: #d6ffe4; + --fg: #cfe8d6; --muted: #6fae86; - --accent: #2fe36e; - --accent-fg: #02160a; + --accent: #46b87c; + --accent-fg: #04170c; } html[data-scheme="matrix"][data-theme="light"] { --bg: #f0f7f1; diff --git a/frontend/src/lib/theme.ts b/frontend/src/lib/theme.ts index f9aa5ed..a6d080c 100644 --- a/frontend/src/lib/theme.ts +++ b/frontend/src/lib/theme.ts @@ -9,7 +9,7 @@ export const SCHEMES: { id: Scheme; name: string; swatch: string }[] = [ { id: "slate", name: "Slate", swatch: "#e8913c" }, { id: "youtube", name: "YouTube", swatch: "#ff3b46" }, { id: "starship", name: "Starship", swatch: "#38b6ff" }, - { id: "matrix", name: "Matrix", swatch: "#2fe36e" }, + { id: "matrix", name: "Matrix", swatch: "#46b87c" }, ]; export interface ThemePrefs { From 036e2fe7ea9bb017004b03c078c671b872f56f35 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 12 Jul 2026 20:40:20 +0200 Subject: [PATCH 4/7] feat(glass): dev-prototype feed backdrop (blurred rotating thumbnail) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Idea from UAT-2: give the feeds the same 'content behind glass' lift the Plex detail page gets. New FeedBackdrop paints a faint, slowly-rotating feed thumbnail as a fixed backdrop on
(the proven art-backdrop path — a fixed z:-1 layer is occluded by the root's opaque bg-bg). Blur = tiny-canvas downscale + cover upscale (no CSS filter; ytimg is CORS-readable so it uses a data-URL, else raw). Flat --bg stays as the 'perf mode' look. Behind the GlassTuner toggle + a Backdrop-fade slider (--feedbg-fade) so it's judged/tuned in UAT before anything is committed for real. --- frontend/src/components/FeedBackdrop.tsx | 93 ++++++++++++++++++++++++ frontend/src/components/GlassTuner.tsx | 40 +++++++++- frontend/src/index.css | 4 + 3 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 frontend/src/components/FeedBackdrop.tsx diff --git a/frontend/src/components/FeedBackdrop.tsx b/frontend/src/components/FeedBackdrop.tsx new file mode 100644 index 0000000..6ad7009 --- /dev/null +++ b/frontend/src/components/FeedBackdrop.tsx @@ -0,0 +1,93 @@ +import { useEffect, useState } from "react"; + +/** + * DEV prototype (toggled by GlassTuner): a faint, blurred, slowly-rotating feed thumbnail painted + * as a fixed backdrop so the glass surfaces have real content to refract — the same trick that makes + * the Plex detail page pop, brought to the YT/Plex feeds. The flat `--bg` then reads as "perf mode". + * + * It writes `
`'s background (NOT a separate fixed layer): a fixed z-index:-1 layer is occluded + * by the app root's opaque `bg-bg`, whereas `
` is a transparent descendant whose own background + * paints above it — this is exactly how `useArtBackdrop` (Plex) works, reused here. + * + * Blur: downscale the thumbnail into a tiny canvas and let `background-size: cover` upscale it back — + * a cheap gaussian-ish blur with no CSS filter (which can't touch a background-image). Falls back to + * the raw url if the image isn't CORS-readable (still soft once upscaled + heavily faded). + */ +export default function FeedBackdrop() { + const [srcs, setSrcs] = useState([]); + const [idx, setIdx] = useState(0); + const [art, setArt] = useState(null); + + // Sample the video thumbnails currently on screen. + useEffect(() => { + const found: string[] = []; + document.querySelectorAll("img").forEach((img) => { + const s = img.currentSrc || img.src; + if (/i\.ytimg\.com\/vi\//.test(s)) found.push(s); + }); + setSrcs([...new Set(found)]); + }, []); + + // Slowly cycle through them. + useEffect(() => { + if (srcs.length < 2) return; + const t = setInterval(() => setIdx((i) => (i + 1) % srcs.length), 14000); + return () => clearInterval(t); + }, [srcs]); + + // Blur the current pick via a tiny-canvas downscale (fallback: raw url on CORS taint). + useEffect(() => { + const url = srcs[idx]; + if (!url) return; + let cancelled = false; + const img = new Image(); + img.crossOrigin = "anonymous"; + img.onload = () => { + if (cancelled) return; + try { + const c = document.createElement("canvas"); + c.width = 40; + c.height = 22; + c.getContext("2d")!.drawImage(img, 0, 0, 40, 22); + setArt(c.toDataURL("image/jpeg", 0.6)); + } catch { + setArt(url); + } + }; + img.onerror = () => { + if (!cancelled) setArt(url); + }; + img.src = url; + return () => { + cancelled = true; + }; + }, [srcs, idx]); + + // Paint (and clean up) the faded backdrop on
. + useEffect(() => { + const main = document.querySelector("main"); + if (!main) return; + const s = main.style; + const clear = () => { + s.backgroundImage = ""; + s.backgroundSize = ""; + s.backgroundPosition = ""; + s.backgroundRepeat = ""; + s.backgroundAttachment = ""; + }; + if (art) { + s.backgroundImage = + `linear-gradient(color-mix(in srgb, var(--bg) var(--feedbg-fade), transparent), ` + + `color-mix(in srgb, var(--bg) var(--feedbg-fade), transparent)), url("${art}")`; + s.backgroundSize = "cover"; + s.backgroundPosition = "center"; + s.backgroundRepeat = "no-repeat"; + s.backgroundAttachment = "fixed"; + } else { + clear(); + } + return clear; + }, [art]); + + return null; +} diff --git a/frontend/src/components/GlassTuner.tsx b/frontend/src/components/GlassTuner.tsx index 5b899c5..f287cba 100644 --- a/frontend/src/components/GlassTuner.tsx +++ b/frontend/src/components/GlassTuner.tsx @@ -1,4 +1,5 @@ import { useEffect, useMemo, useState } from "react"; +import FeedBackdrop from "./FeedBackdrop"; /** * DEV-ONLY live appearance tuner. Mounted at the App root so it stays reachable on every page. @@ -77,13 +78,19 @@ const PRESETS: { id: string; name: string; hint: string; over: Record document.documentElement; const readVar = (k: string) => getComputedStyle(root()).getPropertyValue(k).trim(); type Saved = { vars?: Record; palette?: Record; + feedbg?: boolean; open?: boolean; }; @@ -103,6 +110,7 @@ export default function GlassTuner() { return { ...base, ...(initial.vars || {}) }; }); const [palette, setPalette] = useState>(() => initial.palette || {}); + const [feedbg, setFeedbg] = useState(() => Boolean(initial.feedbg)); const [open, setOpen] = useState(() => initial.open ?? true); const [tab, setTab] = useState<"glass" | "palette">("glass"); const [copied, setCopied] = useState(false); @@ -199,10 +207,17 @@ export default function GlassTuner() { persist({ open: v }); } + function toggleFeedbg(v: boolean) { + setFeedbg(v); + persist({ feedbg: v }); + } + if (!DEV_TUNER) return null; return ( -
+ <> + {feedbg && } +
{!open && (
+ {/* Feed backdrop (dev prototype) */} + + {/* Tab switch */}
{(["glass", "palette"] as const).map((t) => ( @@ -269,6 +295,13 @@ export default function GlassTuner() { {SLIDERS.map((s) => ( setVar(s.k, v)} /> ))} + {feedbg && ( +
+ {FEEDBG_SLIDERS.map((s) => ( + setVar(s.k, v)} /> + ))} +
+ )}
)} @@ -313,7 +346,8 @@ export default function GlassTuner() {
)} -

+
+ ); } diff --git a/frontend/src/index.css b/frontend/src/index.css index 2ed21a0..7471124 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -21,6 +21,10 @@ --glass-edge: 10%; /* extra edge-light mixed into the TOP border (#fff N%) — 0 = off */ --glass-scrim: 14%; /* under-content scrim: darkens surfaces toward --bg for text contrast — 0 = off */ --ambient: 1.1; /* multiplier on the ambient accent backdrop pools */ + + /* Dev-prototype feed backdrop (see ): how strongly the faded --bg overlay hides the + blurred thumbnail — higher = fainter image. Only in effect while the backdrop is toggled on. */ + --feedbg-fade: 86%; } /* ===== Rich-backdrop scope: surfaces that float over real imagery (Plex art hero/detail, and From f9f90cf6094cebfe8c249d89ead2bb654bf816ae Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 12 Jul 2026 21:20:40 +0200 Subject: [PATCH 5/7] feat(glass): per-scheme background images + glass-over-image mode Land the UAT-approved backdrop direction as a real feature (replacing the dev thumbnail prototype): - 6 generated abstract SVG backdrops in public/backdrops/, one tuned to each accent scheme (dark, mixed-colour, few light areas). Non-figurative + generated = repo-safe, tiny, accent-matched. - New data-backdrop="on" state (dark theme + the setting + not perf) paints the per-scheme image on (app root now transparent so it shows app-wide and the glass refracts it) AND switches the glass to its translucent tier (the user's tuned values: surface 50 / card 60 / scrim 30 / blur 10 / edge 25). Off / light / perf -> flat colour + solid glass (the readable fallback). - Settings > Appearance 'Background image' toggle (bgImage pref, dark-only), trilingual. Flat is the fallback + opt-out. - Remove the FeedBackdrop prototype + its tuner controls; tuner baseline resynced to the glass-over-image tier, add a Backdrop-fade slider. GOTCHA fixed: the dark-mode ambient 'background' shorthand reset background-size to auto (image rendered un-covered); out-specified it with [data-theme="dark"]. --- frontend/public/backdrops/forest.svg | 18 +++++ frontend/public/backdrops/matrix.svg | 18 +++++ frontend/public/backdrops/midnight.svg | 18 +++++ frontend/public/backdrops/slate.svg | 18 +++++ frontend/public/backdrops/starship.svg | 18 +++++ frontend/public/backdrops/youtube.svg | 18 +++++ frontend/src/App.tsx | 10 ++- frontend/src/components/FeedBackdrop.tsx | 93 ---------------------- frontend/src/components/GlassTuner.tsx | 88 +++++++------------- frontend/src/components/SettingsPanel.tsx | 11 +++ frontend/src/i18n/locales/de/settings.json | 2 + frontend/src/i18n/locales/en/settings.json | 2 + frontend/src/i18n/locales/hu/settings.json | 2 + frontend/src/index.css | 34 ++++++-- frontend/src/lib/theme.ts | 3 + 15 files changed, 191 insertions(+), 162 deletions(-) create mode 100644 frontend/public/backdrops/forest.svg create mode 100644 frontend/public/backdrops/matrix.svg create mode 100644 frontend/public/backdrops/midnight.svg create mode 100644 frontend/public/backdrops/slate.svg create mode 100644 frontend/public/backdrops/starship.svg create mode 100644 frontend/public/backdrops/youtube.svg delete mode 100644 frontend/src/components/FeedBackdrop.tsx diff --git a/frontend/public/backdrops/forest.svg b/frontend/public/backdrops/forest.svg new file mode 100644 index 0000000..5e8f0f4 --- /dev/null +++ b/frontend/public/backdrops/forest.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/backdrops/matrix.svg b/frontend/public/backdrops/matrix.svg new file mode 100644 index 0000000..3e699a7 --- /dev/null +++ b/frontend/public/backdrops/matrix.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/backdrops/midnight.svg b/frontend/public/backdrops/midnight.svg new file mode 100644 index 0000000..217531f --- /dev/null +++ b/frontend/public/backdrops/midnight.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/backdrops/slate.svg b/frontend/public/backdrops/slate.svg new file mode 100644 index 0000000..b5c4889 --- /dev/null +++ b/frontend/public/backdrops/slate.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/backdrops/starship.svg b/frontend/public/backdrops/starship.svg new file mode 100644 index 0000000..2a8d704 --- /dev/null +++ b/frontend/public/backdrops/starship.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/public/backdrops/youtube.svg b/frontend/public/backdrops/youtube.svg new file mode 100644 index 0000000..6d50059 --- /dev/null +++ b/frontend/public/backdrops/youtube.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 4d178b4..5dc1d0c 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -381,6 +381,14 @@ export default function App() { document.documentElement.dataset.perf = perf ? "1" : ""; setAccountRaw(PERF_KEY, perf ? "1" : "0"); }, [perf]); + + // The per-scheme background image (the "glass over image" look) is on only in dark theme, when + // the user hasn't opted out, and not in perf mode. Drives `html[data-backdrop]` (see index.css), + // which both paints the image on and switches the glass to its translucent tier. + useEffect(() => { + const on = theme.mode === "dark" && theme.bgImage && !perf; + document.documentElement.dataset.backdrop = on ? "on" : "off"; + }, [theme.mode, theme.bgImage, perf]); useEffect(() => setHintsEnabled(hints), [hints]); useEffect(() => configureNotifications(notif), [notif]); @@ -726,7 +734,7 @@ export default function App() { ); return ( -
+
`'s background (NOT a separate fixed layer): a fixed z-index:-1 layer is occluded - * by the app root's opaque `bg-bg`, whereas `
` is a transparent descendant whose own background - * paints above it — this is exactly how `useArtBackdrop` (Plex) works, reused here. - * - * Blur: downscale the thumbnail into a tiny canvas and let `background-size: cover` upscale it back — - * a cheap gaussian-ish blur with no CSS filter (which can't touch a background-image). Falls back to - * the raw url if the image isn't CORS-readable (still soft once upscaled + heavily faded). - */ -export default function FeedBackdrop() { - const [srcs, setSrcs] = useState([]); - const [idx, setIdx] = useState(0); - const [art, setArt] = useState(null); - - // Sample the video thumbnails currently on screen. - useEffect(() => { - const found: string[] = []; - document.querySelectorAll("img").forEach((img) => { - const s = img.currentSrc || img.src; - if (/i\.ytimg\.com\/vi\//.test(s)) found.push(s); - }); - setSrcs([...new Set(found)]); - }, []); - - // Slowly cycle through them. - useEffect(() => { - if (srcs.length < 2) return; - const t = setInterval(() => setIdx((i) => (i + 1) % srcs.length), 14000); - return () => clearInterval(t); - }, [srcs]); - - // Blur the current pick via a tiny-canvas downscale (fallback: raw url on CORS taint). - useEffect(() => { - const url = srcs[idx]; - if (!url) return; - let cancelled = false; - const img = new Image(); - img.crossOrigin = "anonymous"; - img.onload = () => { - if (cancelled) return; - try { - const c = document.createElement("canvas"); - c.width = 40; - c.height = 22; - c.getContext("2d")!.drawImage(img, 0, 0, 40, 22); - setArt(c.toDataURL("image/jpeg", 0.6)); - } catch { - setArt(url); - } - }; - img.onerror = () => { - if (!cancelled) setArt(url); - }; - img.src = url; - return () => { - cancelled = true; - }; - }, [srcs, idx]); - - // Paint (and clean up) the faded backdrop on
. - useEffect(() => { - const main = document.querySelector("main"); - if (!main) return; - const s = main.style; - const clear = () => { - s.backgroundImage = ""; - s.backgroundSize = ""; - s.backgroundPosition = ""; - s.backgroundRepeat = ""; - s.backgroundAttachment = ""; - }; - if (art) { - s.backgroundImage = - `linear-gradient(color-mix(in srgb, var(--bg) var(--feedbg-fade), transparent), ` + - `color-mix(in srgb, var(--bg) var(--feedbg-fade), transparent)), url("${art}")`; - s.backgroundSize = "cover"; - s.backgroundPosition = "center"; - s.backgroundRepeat = "no-repeat"; - s.backgroundAttachment = "fixed"; - } else { - clear(); - } - return clear; - }, [art]); - - return null; -} diff --git a/frontend/src/components/GlassTuner.tsx b/frontend/src/components/GlassTuner.tsx index f287cba..888ac88 100644 --- a/frontend/src/components/GlassTuner.tsx +++ b/frontend/src/components/GlassTuner.tsx @@ -1,5 +1,4 @@ import { useEffect, useMemo, useState } from "react"; -import FeedBackdrop from "./FeedBackdrop"; /** * DEV-ONLY live appearance tuner. Mounted at the App root so it stays reachable on every page. @@ -26,18 +25,20 @@ type Slider = { }; // def = the BAKED baseline in index.css (:root). "Current" preset + the export diff both key off it. +// def = the default rendered baseline = the "glass over image" (backdrop-on) tier from index.css. const SLIDERS: Slider[] = [ - { k: "--glass-blur", label: "Blur radius", min: 0, max: 40, step: 1, unit: "px", def: 20 }, - { k: "--glass-saturate", label: "Saturation", min: 1, max: 2.5, step: 0.05, unit: "", def: 1.8 }, - { k: "--glass-dark-bright", label: "Dark brightness", min: 1, max: 2, step: 0.05, unit: "", def: 1.25 }, - { k: "--glass-surface-alpha", label: "Panel opacity", min: 40, max: 100, step: 1, unit: "%", def: 94 }, - { k: "--glass-card-alpha", label: "Card opacity", min: 40, max: 100, step: 1, unit: "%", def: 94 }, - { k: "--glass-menu-alpha", label: "Menu opacity", min: 60, max: 100, step: 1, unit: "%", def: 98 }, - { k: "--glass-border-alpha", label: "Border opacity", min: 20, max: 100, step: 1, unit: "%", def: 78 }, - { k: "--glass-edge", label: "Edge-light rim", min: 0, max: 60, step: 1, unit: "%", def: 10 }, - { k: "--glass-inset", label: "Top highlight", min: 0, max: 40, step: 1, unit: "%", def: 16 }, - { k: "--glass-scrim", label: "Under-text scrim", min: 0, max: 85, step: 1, unit: "%", def: 14 }, + { k: "--glass-blur", label: "Blur radius", min: 0, max: 40, step: 1, unit: "px", def: 10 }, + { k: "--glass-saturate", label: "Saturation", min: 1, max: 2.5, step: 0.05, unit: "", def: 1.6 }, + { k: "--glass-dark-bright", label: "Dark brightness", min: 1, max: 2, step: 0.05, unit: "", def: 1.2 }, + { k: "--glass-surface-alpha", label: "Panel opacity", min: 40, max: 100, step: 1, unit: "%", def: 50 }, + { k: "--glass-card-alpha", label: "Card opacity", min: 40, max: 100, step: 1, unit: "%", def: 60 }, + { k: "--glass-menu-alpha", label: "Menu opacity", min: 40, max: 100, step: 1, unit: "%", def: 66 }, + { k: "--glass-border-alpha", label: "Border opacity", min: 20, max: 100, step: 1, unit: "%", def: 80 }, + { k: "--glass-edge", label: "Edge-light rim", min: 0, max: 60, step: 1, unit: "%", def: 25 }, + { k: "--glass-inset", label: "Top highlight", min: 0, max: 40, step: 1, unit: "%", def: 15 }, + { k: "--glass-scrim", label: "Under-text scrim", min: 0, max: 85, step: 1, unit: "%", def: 30 }, { k: "--ambient", label: "Ambient intensity", min: 0, max: 2, step: 0.05, unit: "", def: 1.1 }, + { k: "--bg-fade", label: "Backdrop fade", min: 40, max: 97, step: 1, unit: "%", def: 60 }, ]; const PALETTE: { k: string; label: string }[] = [ @@ -52,22 +53,20 @@ const PALETTE: { k: string; label: string }[] = [ // Each preset resets every slider to its default, then applies these overrides. const PRESETS: { id: string; name: string; hint: string; over: Record }[] = [ - { id: "current", name: "Current", hint: "The baked baseline", over: {} }, + { id: "current", name: "Glass/image", hint: "The default (over image)", over: {} }, { - id: "media", - name: "Media (glassy)", - hint: "For art-backed pages", + id: "solid", + name: "Solid (flat)", + hint: "As shown w/ image off", over: { - "--glass-blur": 10, - "--glass-saturate": 1.6, - "--glass-dark-bright": 1.2, - "--glass-surface-alpha": 50, - "--glass-card-alpha": 60, - "--glass-menu-alpha": 66, - "--glass-border-alpha": 80, - "--glass-edge": 25, - "--glass-inset": 15, - "--glass-scrim": 30, + "--glass-blur": 20, + "--glass-dark-bright": 1.25, + "--glass-surface-alpha": 94, + "--glass-card-alpha": 94, + "--glass-menu-alpha": 98, + "--glass-edge": 10, + "--glass-inset": 16, + "--glass-scrim": 14, }, }, { @@ -78,19 +77,13 @@ const PRESETS: { id: string; name: string; hint: string; over: Record document.documentElement; const readVar = (k: string) => getComputedStyle(root()).getPropertyValue(k).trim(); type Saved = { vars?: Record; palette?: Record; - feedbg?: boolean; open?: boolean; }; @@ -110,7 +103,6 @@ export default function GlassTuner() { return { ...base, ...(initial.vars || {}) }; }); const [palette, setPalette] = useState>(() => initial.palette || {}); - const [feedbg, setFeedbg] = useState(() => Boolean(initial.feedbg)); const [open, setOpen] = useState(() => initial.open ?? true); const [tab, setTab] = useState<"glass" | "palette">("glass"); const [copied, setCopied] = useState(false); @@ -207,17 +199,10 @@ export default function GlassTuner() { persist({ open: v }); } - function toggleFeedbg(v: boolean) { - setFeedbg(v); - persist({ feedbg: v }); - } - if (!DEV_TUNER) return null; return ( - <> - {feedbg && } -
+
{!open && (
- {/* Feed backdrop (dev prototype) */} - - {/* Tab switch */}
{(["glass", "palette"] as const).map((t) => ( @@ -295,13 +269,6 @@ export default function GlassTuner() { {SLIDERS.map((s) => ( setVar(s.k, v)} /> ))} - {feedbg && ( -
- {FEEDBG_SLIDERS.map((s) => ( - setVar(s.k, v)} /> - ))} -
- )}
)} @@ -346,8 +313,7 @@ export default function GlassTuner() {
)} -
- +
); } diff --git a/frontend/src/components/SettingsPanel.tsx b/frontend/src/components/SettingsPanel.tsx index 0399ea3..6675db0 100644 --- a/frontend/src/components/SettingsPanel.tsx +++ b/frontend/src/components/SettingsPanel.tsx @@ -158,6 +158,17 @@ function Appearance({ prefs }: { prefs: PrefsController }) { onChange={(v) => setTheme({ ...theme, mode: v ? "dark" : "light" })} /> + + setTheme({ ...theme, bgImage: v })} + /> + ): how strongly the faded --bg overlay hides the - blurred thumbnail — higher = fainter image. Only in effect while the backdrop is toggled on. */ - --feedbg-fade: 86%; + /* Per-scheme background image dim (see frontend/public/backdrops/): how strongly the faded --bg + overlay hides the image — higher = fainter. Only in effect while data-backdrop="on". */ + --bg-fade: 60%; } -/* ===== Rich-backdrop scope: surfaces that float over real imagery (Plex art hero/detail, and - later channel-page banners) want MORE translucency so the picture shows through — the "glass - over content" look. Put `.glass-media` on such a page root; every .glass* inside inherits these - (UAT-tuned 2026-07-12). Global chrome stays solid via the :root defaults above. ===== */ +/* ===== "Glass over image" — the translucent tier (UAT-tuned 2026-07-12). Applies whenever a + real image sits behind the surfaces: app-wide when the per-scheme background image is on + (`html[data-backdrop="on"]`), and on the Plex art-backed detail views (`.glass-media`, which + have their own art backdrop even when the global image is off). When there's nothing behind the + glass (image off / light theme / perf), the :root defaults keep it solid & readable. ===== */ +html[data-backdrop="on"], .glass-media { --glass-blur: 10px; --glass-saturate: 1.6; @@ -44,6 +46,24 @@ --glass-scrim: 30%; } +/* Per-scheme background image, painted on (the app root is transparent so it shows through + the whole app and the glass refracts it). A faded --bg overlay keeps it subtle; `fixed` so it + doesn't scroll. Only when the backdrop is on (dark theme + the "Background image" setting). */ +html[data-backdrop="on"][data-scheme="midnight"] body { background-image: linear-gradient(color-mix(in srgb, var(--bg) var(--bg-fade), transparent), color-mix(in srgb, var(--bg) var(--bg-fade), transparent)), url("/backdrops/midnight.svg"); } +html[data-backdrop="on"][data-scheme="forest"] body { background-image: linear-gradient(color-mix(in srgb, var(--bg) var(--bg-fade), transparent), color-mix(in srgb, var(--bg) var(--bg-fade), transparent)), url("/backdrops/forest.svg"); } +html[data-backdrop="on"][data-scheme="slate"] body { background-image: linear-gradient(color-mix(in srgb, var(--bg) var(--bg-fade), transparent), color-mix(in srgb, var(--bg) var(--bg-fade), transparent)), url("/backdrops/slate.svg"); } +html[data-backdrop="on"][data-scheme="youtube"] body { background-image: linear-gradient(color-mix(in srgb, var(--bg) var(--bg-fade), transparent), color-mix(in srgb, var(--bg) var(--bg-fade), transparent)), url("/backdrops/youtube.svg"); } +html[data-backdrop="on"][data-scheme="starship"] body { background-image: linear-gradient(color-mix(in srgb, var(--bg) var(--bg-fade), transparent), color-mix(in srgb, var(--bg) var(--bg-fade), transparent)), url("/backdrops/starship.svg"); } +html[data-backdrop="on"][data-scheme="matrix"] body { background-image: linear-gradient(color-mix(in srgb, var(--bg) var(--bg-fade), transparent), color-mix(in srgb, var(--bg) var(--bg-fade), transparent)), url("/backdrops/matrix.svg"); } +/* [data-theme="dark"] added purely to out-specify the `html[data-theme="dark"] body` ambient rule + below, whose `background` shorthand would otherwise reset background-size back to auto. */ +html[data-backdrop="on"][data-theme="dark"] body { + background-size: cover; + background-position: center; + background-repeat: no-repeat; + background-attachment: fixed; +} + /* Make native controls (date picker, scrollbars) follow the theme. */ html[data-theme="dark"] { color-scheme: dark; diff --git a/frontend/src/lib/theme.ts b/frontend/src/lib/theme.ts index a6d080c..e3a97e6 100644 --- a/frontend/src/lib/theme.ts +++ b/frontend/src/lib/theme.ts @@ -16,12 +16,15 @@ export interface ThemePrefs { mode: Mode; scheme: Scheme; fontScale: number; + /** Show the per-scheme background image (dark theme only); off = flat colour. */ + bgImage: boolean; } export const DEFAULT_THEME: ThemePrefs = { mode: "dark", scheme: "midnight", fontScale: 1.06, + bgImage: true, }; export function applyTheme(t: ThemePrefs): void { From a187b2f4759f1156dddab5c0fafe30909e505d3c Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 12 Jul 2026 22:24:09 +0200 Subject: [PATCH 6/7] feat(glass): user-facing Image-fade slider under Settings > Background image Replaces the dev-only backdrop-fade knob with a real control: when Background image is on (dark theme), a 0-100% 'Image fade' slider appears beneath it and drives --bg-fade live (higher = fainter). Persists to DB + localStorage via the existing theme prefs path (ThemePrefs.bgFade, applyTheme sets the CSS var). Removed --bg-fade from the GlassTuner so the two don't fight over the var. --- frontend/src/components/GlassTuner.tsx | 1 - frontend/src/components/SettingsPanel.tsx | 18 ++++++++++++++++++ frontend/src/i18n/locales/de/settings.json | 1 + frontend/src/i18n/locales/en/settings.json | 1 + frontend/src/i18n/locales/hu/settings.json | 1 + frontend/src/lib/theme.ts | 4 ++++ 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/GlassTuner.tsx b/frontend/src/components/GlassTuner.tsx index 888ac88..eb59791 100644 --- a/frontend/src/components/GlassTuner.tsx +++ b/frontend/src/components/GlassTuner.tsx @@ -38,7 +38,6 @@ const SLIDERS: Slider[] = [ { k: "--glass-inset", label: "Top highlight", min: 0, max: 40, step: 1, unit: "%", def: 15 }, { k: "--glass-scrim", label: "Under-text scrim", min: 0, max: 85, step: 1, unit: "%", def: 30 }, { k: "--ambient", label: "Ambient intensity", min: 0, max: 2, step: 0.05, unit: "", def: 1.1 }, - { k: "--bg-fade", label: "Backdrop fade", min: 40, max: 97, step: 1, unit: "%", def: 60 }, ]; const PALETTE: { k: string; label: string }[] = [ diff --git a/frontend/src/components/SettingsPanel.tsx b/frontend/src/components/SettingsPanel.tsx index 6675db0..8ebd4cc 100644 --- a/frontend/src/components/SettingsPanel.tsx +++ b/frontend/src/components/SettingsPanel.tsx @@ -169,6 +169,24 @@ function Appearance({ prefs }: { prefs: PrefsController }) { onChange={(v) => setTheme({ ...theme, bgImage: v })} /> + {theme.mode === "dark" && theme.bgImage && ( +
+
+ {t("settings.appearance.backgroundFade")} + {theme.bgFade}% +
+ setTheme({ ...theme, bgFade: Number(e.target.value) })} + aria-label={t("settings.appearance.backgroundFade")} + className="w-full accent-accent" + /> +
+ )} Date: Sun, 12 Jul 2026 22:28:50 +0200 Subject: [PATCH 7/7] =?UTF-8?q?chore(release):=200.42.0=20=E2=80=94=20glas?= =?UTF-8?q?s-over-image=20look=20+=20Starship/Matrix=20schemes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- frontend/src/lib/releaseNotes.ts | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/VERSION b/VERSION index ca59bb0..57c1868 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.41.0 \ No newline at end of file +0.42.0 \ No newline at end of file diff --git a/frontend/src/lib/releaseNotes.ts b/frontend/src/lib/releaseNotes.ts index e035467..9fb890e 100644 --- a/frontend/src/lib/releaseNotes.ts +++ b/frontend/src/lib/releaseNotes.ts @@ -14,6 +14,18 @@ export interface ReleaseEntry { } export const RELEASE_NOTES: ReleaseEntry[] = [ + { + version: "0.42.0", + date: "2026-07-12", + summary: "A refreshed “glass over image” look for dark theme, plus two new colour schemes.", + features: [ + "New background image: in dark theme a subtle backdrop, tuned to your colour scheme, now sits behind the app — so the frosted-glass surfaces have real depth to refract. Turn it on or off, and dial its strength, with the new controls in Settings → Appearance.", + "Two new colour schemes: Starship (deep-space blue) and Matrix (terminal green).", + ], + chores: [ + "Reworked the translucent “glass” surface system so the whole app shares one consistent, tunable look.", + ], + }, { version: "0.41.0", date: "2026-07-12",