From adcbadcf49c2bb744e17c6c02be2f6ff6ae6a9fe Mon Sep 17 00:00:00 2001 From: meowarex Date: Fri, 20 Feb 2026 23:53:17 +1100 Subject: [PATCH] Cleanup <3 --- plugins/radiant-lyrics-luna/src/Settings.tsx | 789 ++++++++++-------- .../src/cover-everywhere.css | 22 - plugins/radiant-lyrics-luna/src/index.ts | 256 +++--- .../radiant-lyrics-luna/src/lyrics-glow.css | 5 +- 4 files changed, 551 insertions(+), 521 deletions(-) diff --git a/plugins/radiant-lyrics-luna/src/Settings.tsx b/plugins/radiant-lyrics-luna/src/Settings.tsx index b845425..39bc50d 100644 --- a/plugins/radiant-lyrics-luna/src/Settings.tsx +++ b/plugins/radiant-lyrics-luna/src/Settings.tsx @@ -7,12 +7,13 @@ declare global { updateRadiantLyricsStyles?: () => void; updateRadiantLyricsTextGlow?: () => void; updateStickyLyricsFeature?: () => void; + updateStickyLyricsSetting?: (checked: boolean) => void; updateRadiantLyricsPlayerBarTint?: () => void; updateRadiantLyricsGlobalBackground?: () => void; updateRadiantLyricsNowPlayingBackground?: () => void; - updateStickyLyricsIcon?: () => void; updateQualityProgressColor?: () => void; updateLyricsStyle?: () => void; + updateLyricsStyleSetting?: (value: number) => void; } } @@ -39,10 +40,10 @@ export const settings = await ReactiveStore.getPluginStorage("RadiantLyrics", { backgroundBrightness: 40, spinSpeed: 45, settingsAffectNowPlaying: true, - stickyLyricsFeature: true, - stickyLyrics: true, + stickyLyrics: false, stickyLyricsIcon: "sparkle" as string, lyricsStyle: 0, + syllableLogging: false, }); export const Settings = () => { @@ -62,9 +63,7 @@ export const Settings = () => { const [performanceMode, setPerformanceMode] = React.useState( settings.performanceMode, ); - const [spinningArt, setspinningArt] = React.useState( - settings.spinningArt, - ); + const [spinningArt, setspinningArt] = React.useState(settings.spinningArt); const [backgroundContrast, setBackgroundContrast] = React.useState( settings.backgroundContrast, ); @@ -103,13 +102,33 @@ export const Settings = () => { ); const [showTintColorPicker, setShowTintColorPicker] = React.useState(false); const [isTintAnimatingIn, setIsTintAnimatingIn] = React.useState(false); - const [shouldRenderTintPicker, setShouldRenderTintPicker] = React.useState(false); - const [tintCustomInput, setTintCustomInput] = React.useState(settings.playerBarTintColor); - const [tintCustomColors, setTintCustomColors] = React.useState(settings.playerBarTintCustomColors); - const [tintHoveredColorIndex, setTintHoveredColorIndex] = React.useState(null); - const [stickyLyricsFeature, setStickyLyricsFeature] = React.useState( - settings.stickyLyricsFeature, + const [shouldRenderTintPicker, setShouldRenderTintPicker] = + React.useState(false); + const [tintCustomInput, setTintCustomInput] = React.useState( + settings.playerBarTintColor, ); + const [tintCustomColors, setTintCustomColors] = React.useState( + settings.playerBarTintCustomColors, + ); + const [tintHoveredColorIndex, setTintHoveredColorIndex] = React.useState< + number | null + >(null); + const [stickyLyrics, setStickyLyrics] = React.useState(settings.stickyLyrics); + React.useEffect(() => { + window.updateStickyLyricsSetting = (checked: boolean) => + setStickyLyrics(checked); + return () => { + window.updateStickyLyricsSetting = undefined; + }; + }, []); + const [lyricsStyle, setLyricsStyle] = React.useState(settings.lyricsStyle); + React.useEffect(() => { + window.updateLyricsStyleSetting = (value: number) => + setLyricsStyle(value); + return () => { + window.updateLyricsStyleSetting = undefined; + }; + }, []); const [qualityProgressColor, setQualityProgressColor] = React.useState( settings.qualityProgressColor, ); @@ -120,9 +139,8 @@ export const Settings = () => { onChange: (_: unknown, checked: boolean) => void; checked: boolean; }; - const AnySwitch = LunaSwitchSetting as unknown as React.ComponentType< - AnySwitchProps - >; + const AnySwitch = + LunaSwitchSetting as unknown as React.ComponentType; return ( @@ -132,7 +150,7 @@ export const Settings = () => { checked={lyricsGlowEnabled} onChange={(_: unknown, checked: boolean) => { settings.lyricsGlowEnabled = checked; - setLyricsGlowEnabled(checked); + setLyricsGlowEnabled(checked); // Update styles immediately when setting changes if (window.updateRadiantLyricsStyles) { window.updateRadiantLyricsStyles(); @@ -145,88 +163,92 @@ export const Settings = () => { checked={trackTitleGlow} onChange={(_: unknown, checked: boolean) => { settings.trackTitleGlow = checked; - setTrackTitleGlow(checked); + setTrackTitleGlow(checked); if (window.updateRadiantLyricsStyles) { window.updateRadiantLyricsStyles(); } }} /> - {(lyricsGlowEnabled || trackTitleGlow) && ( - { - settings.textGlow = value; - setTextGlow(value); - // Update variables immediately when setting changes - if (window.updateRadiantLyricsTextGlow) { - window.updateRadiantLyricsTextGlow(); - } - }} - /> - )} + {(lyricsGlowEnabled || trackTitleGlow) && ( + { + settings.textGlow = value; + setTextGlow(value); + // Update variables immediately when setting changes + if (window.updateRadiantLyricsTextGlow) { + window.updateRadiantLyricsTextGlow(); + } + }} + /> + )} + { + settings.lyricsStyle = value; + setLyricsStyle(value); + if (window.updateLyricsStyle) { + window.updateLyricsStyle(); + } + }} + /> { - settings.stickyLyricsFeature = checked; - setStickyLyricsFeature(checked); + settings.stickyLyrics = checked; + setStickyLyrics(checked); if (window.updateStickyLyricsFeature) { window.updateStickyLyricsFeature(); } }} /> - { - settings.lyricsStyle = value; - if (window.updateLyricsStyle) { - window.updateLyricsStyle(); - } - }} - /> - { settings.hideUIEnabled = checked; - setHideUIEnabled(checked); + setHideUIEnabled(checked); }} /> - {hideUIEnabled && ( - { - console.log("Player Bar Visibility:", checked ? "visible" : "hidden"); - settings.playerBarVisible = checked; - setPlayerBarVisible(checked); - // Update styles immediately when setting changes - if (window.updateRadiantLyricsStyles) { - window.updateRadiantLyricsStyles(); - } - }} - /> - )} + {hideUIEnabled && ( + { + console.log( + "Player Bar Visibility:", + checked ? "visible" : "hidden", + ); + settings.playerBarVisible = checked; + setPlayerBarVisible(checked); + // Update styles immediately when setting changes + if (window.updateRadiantLyricsStyles) { + window.updateRadiantLyricsStyles(); + } + }} + /> + )} { settings.qualityProgressColor = checked; - setQualityProgressColor(checked); + setQualityProgressColor(checked); if (window.updateQualityProgressColor) { window.updateQualityProgressColor(); } @@ -238,7 +260,7 @@ export const Settings = () => { checked={floatingPlayerBar} onChange={(_: unknown, checked: boolean) => { settings.floatingPlayerBar = checked; - setFloatingPlayerBar(checked); + setFloatingPlayerBar(checked); if (window.updateRadiantLyricsStyles) { window.updateRadiantLyricsStyles(); } @@ -255,7 +277,7 @@ export const Settings = () => { value={playerBarRadius} onNumber={(value: number) => { settings.playerBarRadius = value; - setPlayerBarRadius(value); + setPlayerBarRadius(value); window.updateRadiantLyricsPlayerBarTint?.(); }} /> @@ -268,7 +290,7 @@ export const Settings = () => { value={playerBarSpacing} onNumber={(value: number) => { settings.playerBarSpacing = value; - setPlayerBarSpacing(value); + setPlayerBarSpacing(value); window.updateRadiantLyricsPlayerBarTint?.(); }} /> @@ -324,10 +346,25 @@ export const Settings = () => { }; const tintColorPresets = [ - "#000000", "#111111", "#222222", "#333333", "#444444", - "#555555", "#666666", "#888888", "#aaaaaa", "#cccccc", - "#ffffff", "#0d1117", "#1a1a2e", "#16213e", "#0f3460", - "#1b1b2f", "#162447", "#1f4068", "#e94560", + "#000000", + "#111111", + "#222222", + "#333333", + "#444444", + "#555555", + "#666666", + "#888888", + "#aaaaaa", + "#cccccc", + "#ffffff", + "#0d1117", + "#1a1a2e", + "#16213e", + "#0f3460", + "#1b1b2f", + "#162447", + "#1f4068", + "#e94560", ]; const allTintColors = [...tintColorPresets, ...tintCustomColors]; @@ -343,17 +380,21 @@ export const Settings = () => { value={playerBarTint} onNumber={(value: number) => { settings.playerBarTint = value; - setPlayerBarTint(value); + setPlayerBarTint(value); window.updateRadiantLyricsPlayerBarTint?.(); }} /> {/* Color swatch — positioned just left of the value box */} - {/* Color Picker Modal */} {shouldRenderTintPicker && ( <> - -