From a187b2f4759f1156dddab5c0fafe30909e505d3c Mon Sep 17 00:00:00 2001 From: npeter83 Date: Sun, 12 Jul 2026 22:24:09 +0200 Subject: [PATCH] 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" + /> +
+ )}