From ef4c73037f4bc89a17f306d3d17330da6a4c92b9 Mon Sep 17 00:00:00 2001 From: meowarex Date: Wed, 25 Feb 2026 20:54:51 +1100 Subject: [PATCH] Fixed Disabling Lyrics Glow --- plugins/radiant-lyrics-luna/src/Settings.tsx | 2 +- plugins/radiant-lyrics-luna/src/index.ts | 50 +++++++------------ .../radiant-lyrics-luna/src/lyrics-glow.css | 40 +++++++-------- 3 files changed, 35 insertions(+), 57 deletions(-) diff --git a/plugins/radiant-lyrics-luna/src/Settings.tsx b/plugins/radiant-lyrics-luna/src/Settings.tsx index 10cc7f5..fc9a831 100644 --- a/plugins/radiant-lyrics-luna/src/Settings.tsx +++ b/plugins/radiant-lyrics-luna/src/Settings.tsx @@ -156,7 +156,7 @@ export const Settings = () => { { settings.lyricsGlowEnabled = checked; diff --git a/plugins/radiant-lyrics-luna/src/index.ts b/plugins/radiant-lyrics-luna/src/index.ts index 934163f..5418758 100644 --- a/plugins/radiant-lyrics-luna/src/index.ts +++ b/plugins/radiant-lyrics-luna/src/index.ts @@ -1,6 +1,6 @@ // MARKER: Core Setup import { type LunaUnload, Tracer } from "@luna/core"; -import { StyleTag, PlayState, MediaItem, observePromise, observe, safeInterval, safeTimeout } from "@luna/lib"; +import { StyleTag, PlayState, MediaItem, observe, safeInterval, safeTimeout } from "@luna/lib"; import { settings, Settings } from "./Settings"; // Interpret integer backgroundScale (e.g., 10=1.0x, 20=2.0x) const getScaledMultiplier = (): number => { @@ -28,10 +28,8 @@ const playerBarStyleTag = new StyleTag("RadiantLyrics-player-bar", unloads); const lyricsGlowStyleTag = new StyleTag("RadiantLyrics-lyrics-glow", unloads); const floatingPlayerBarStyleTag = new StyleTag("RadiantLyrics-floating-player-bar", unloads); -// Apply lyrics glow styles if enabled -if (settings.lyricsGlowEnabled) { - lyricsGlowStyleTag.css = lyricsGlow; -} +// Always load lyrics CSS (glow is toggled via .lyrics-glow-disabled class) +lyricsGlowStyleTag.css = lyricsGlow; // MARKER: Floating Player Bar @@ -138,10 +136,20 @@ baseStyleTag.css = baseStyles; // Update CSS variables for lyrics text glow based on settings const updateRadiantLyricsTextGlow = function (): void { const root = document.documentElement; - root.style.setProperty("--rl-glow-outer", `${settings.textGlow}px`); - root.style.setProperty("--rl-glow-inner", "2px"); + if (settings.lyricsGlowEnabled) { + root.style.setProperty("--rl-glow-outer", `${settings.textGlow}px`); + root.style.setProperty("--rl-glow-inner", "2px"); + root.classList.remove("lyrics-glow-disabled"); + } else { + root.style.setProperty("--rl-glow-outer", "0px"); + root.style.setProperty("--rl-glow-inner", "0px"); + root.classList.add("lyrics-glow-disabled"); + } }; +// Apply glow state immediately at startup +updateRadiantLyricsTextGlow(); + // Function to update styles when settings change const updateRadiantLyricsStyles = function (): void { // Handle Player Bar Visibility @@ -158,32 +166,8 @@ const updateRadiantLyricsStyles = function (): void { // Handle Floating Player Bar applyFloatingPlayerBar(); - // Update lyrics glow based on setting (Always apply if enabled, even when UI is hidden) - const lyricsContainer = document.querySelector('[class^="_lyricsContainer"]'); - if (lyricsContainer) { - if (settings.lyricsGlowEnabled) { - (lyricsContainer as HTMLElement).classList.remove("lyrics-glow-disabled"); - lyricsGlowStyleTag.css = lyricsGlow; - updateRadiantLyricsTextGlow(); - } else { - (lyricsContainer as HTMLElement).classList.add("lyrics-glow-disabled"); - lyricsGlowStyleTag.remove(); - } - } else { - observePromise(unloads, '[class^="_lyricsContainer"]') - .then((el) => { - if (!el) return; - if (settings.lyricsGlowEnabled) { - el.classList.remove("lyrics-glow-disabled"); - lyricsGlowStyleTag.css = lyricsGlow; - updateRadiantLyricsTextGlow(); - } else { - el.classList.add("lyrics-glow-disabled"); - lyricsGlowStyleTag.remove(); - } - }) - .catch(() => {}); - } + // Toggle glow via CSS vars + class on :root (always available, no timing issues) + updateRadiantLyricsTextGlow(); // Track title glow toggle based on settings const trackTitleEl = document.querySelector( diff --git a/plugins/radiant-lyrics-luna/src/lyrics-glow.css b/plugins/radiant-lyrics-luna/src/lyrics-glow.css index 0b4c7a5..d78c5bf 100644 --- a/plugins/radiant-lyrics-luna/src/lyrics-glow.css +++ b/plugins/radiant-lyrics-luna/src/lyrics-glow.css @@ -383,30 +383,24 @@ padding-left: 20px; } -/* Reset lyrics styling when disabled */ +/* Reset glow when disabled */ .lyrics-glow-disabled [class*="_lyricsText"] > div > span[data-current="true"], -.lyrics-glow-disabled [class*="_lyricsText"] > div > span, -.lyrics-glow-disabled [class*="_lyricsText"] > div > span:hover, -.lyrics-glow-disabled [data-test="now-playing-track-title"], -.lyrics-glow-disabled [class^="_lyricsContainer"] > div > div > span { - /* biome-ignore lint: Hard reset when disabled */ +.lyrics-glow-disabled [class*="_lyricsText"] > div > span:hover { + /* biome-ignore lint: Kill glow on active/hover lines */ text-shadow: none !important; - /* biome-ignore lint: Hard reset when disabled */ - padding-left: 0 !important; - /* biome-ignore lint: Hard reset when disabled */ - transition: none !important; - /* biome-ignore lint: Hard reset when disabled */ - font-size: inherit !important; - /* biome-ignore lint: Hard reset when disabled */ - color: inherit !important; - /* biome-ignore lint: Hard reset when disabled */ - font-family: inherit !important; - /* biome-ignore lint: Hard reset when disabled */ - font-weight: inherit !important; - /* biome-ignore lint: Hard reset when disabled */ - margin-bottom: inherit !important; - /* biome-ignore lint: Hard reset when disabled */ - opacity: inherit !important; } -/* thats right biome.. shut upp */ \ No newline at end of file +/* kill glow on active word */ +.lyrics-glow-disabled .rl-wbw-word.rl-wbw-active { + /* biome-ignore lint: Kill glow on active word */ + text-shadow: none !important; +} + +/* kill glow on hovered word */ +.lyrics-glow-disabled .rl-wbw-line:not(.rl-wbw-line-active) > .rl-wbw-word:hover, +.lyrics-glow-disabled .rl-wbw-line:not(.rl-wbw-line-active) > .rl-wbw-word.rl-wbw-word-hover, +.lyrics-glow-disabled .rl-wbw-line:not(.rl-wbw-line-active) .rl-wbw-main .rl-wbw-word:hover, +.lyrics-glow-disabled .rl-wbw-line:not(.rl-wbw-line-active) .rl-wbw-main .rl-wbw-word.rl-wbw-word-hover { + /* biome-ignore lint: Kill glow on hovered word */ + text-shadow: none !important; +} \ No newline at end of file