Added Performance Mode Setting & Improved Performance

This commit is contained in:
2025-06-05 01:16:00 +10:00
parent 47e622e213
commit 7953519773
5 changed files with 129 additions and 73 deletions
+19 -1
View File
@@ -7,6 +7,7 @@ export const settings = await ReactiveStore.getPluginStorage("RadiantLyrics", {
playerBarVisible: true,
lyricsGlowEnabled: true,
spinningCoverEverywhere: false,
performanceMode: false,
backgroundContrast: 120,
backgroundBlur: 80,
backgroundBrightness: 40,
@@ -17,6 +18,7 @@ export const Settings = () => {
const [playerBarVisible, setPlayerBarVisible] = React.useState(settings.playerBarVisible);
const [lyricsGlowEnabled, setLyricsGlowEnabled] = React.useState(settings.lyricsGlowEnabled);
const [spinningCoverEverywhere, setSpinningCoverEverywhere] = React.useState(settings.spinningCoverEverywhere);
const [performanceMode, setPerformanceMode] = React.useState(settings.performanceMode);
const [backgroundContrast, setBackgroundContrast] = React.useState(settings.backgroundContrast);
const [backgroundBlur, setBackgroundBlur] = React.useState(settings.backgroundBlur);
const [backgroundBrightness, setBackgroundBrightness] = React.useState(settings.backgroundBrightness);
@@ -60,7 +62,7 @@ export const Settings = () => {
/>
<LunaSwitchSetting
title="Cover Everywhere | Experimental"
desc="Apply the spinning album cover background to the entire app, not just the Now Playing view, Heavily Inspired by Cover-Theme by @Inrixia"
desc="Apply the spinning CoverArt background to the entire app, not just the Now Playing view, Heavily Inspired by Cover-Theme by @Inrixia"
checked={spinningCoverEverywhere}
onChange={(_, checked: boolean) => {
console.log("Spinning Cover Everywhere:", checked ? "enabled" : "disabled");
@@ -71,6 +73,22 @@ export const Settings = () => {
}
}}
/>
<LunaSwitchSetting
title="Performance Mode"
desc="Disable spinning animations to reduce performance impact on your computer (backgrounds become static)"
checked={performanceMode}
onChange={(_, checked: boolean) => {
console.log("Performance Mode:", checked ? "enabled" : "disabled");
setPerformanceMode((settings.performanceMode = checked));
// Update background animations immediately when setting changes
if ((window as any).updateRadiantLyricsGlobalBackground) {
(window as any).updateRadiantLyricsGlobalBackground();
}
if ((window as any).updateRadiantLyricsPerformanceMode) {
(window as any).updateRadiantLyricsPerformanceMode();
}
}}
/>
<LunaNumberSetting
title="Background Contrast"
desc="Adjust the contrast of the spinning background (0-200, default: 120)"