mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
Background Cover Scale
This commit is contained in:
@@ -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 1–30 (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)"
|
||||
|
||||
Reference in New Issue
Block a user