Background Cover Scale

This commit is contained in:
2025-09-09 20:09:24 +10:00
parent 9c9b47c930
commit 2ea44bd3cc
2 changed files with 73 additions and 24 deletions
@@ -16,6 +16,7 @@ export const settings = await ReactiveStore.getPluginStorage("RadiantLyrics", {
backgroundBrightness: 40,
spinSpeed: 45,
settingsAffectNowPlaying: true,
backgroundScale: 15,
});
export const Settings = () => {
@@ -53,6 +54,9 @@ export const Settings = () => {
const [trackTitleGlow, setTrackTitleGlow] = React.useState(
settings.trackTitleGlow,
);
const [backgroundScale, setBackgroundScale] = React.useState(
settings.backgroundScale,
);
// Derive props and override onChange to accept a broader first param type
type BaseSwitchProps = React.ComponentProps<typeof LunaSwitchSetting>;
@@ -165,6 +169,27 @@ export const Settings = () => {
}
}}
/>
<LunaNumberSetting
title="Background Cover Scale"
desc="Integer scale 130 (10=100%, 20=200%, 30=300%)"
min={1}
max={30}
value={backgroundScale}
onNumber={(value: number) => {
const next = Math.max(1, Math.min(30, Math.round(value)));
setBackgroundScale((settings.backgroundScale = next));
// Immediate visual update without throttle
if ((window as any).updateRadiantLyricsGlobalBackground) {
(window as any).updateRadiantLyricsGlobalBackground();
}
if (
settings.settingsAffectNowPlaying &&
(window as any).updateRadiantLyricsNowPlayingBackground
) {
(window as any).updateRadiantLyricsNowPlayingBackground();
}
}}
/>
<LunaNumberSetting
title="Text Glow"
desc="Adjust the glow size of lyrics (0-100, default: 20)"