Adjusted Default Settings

This commit is contained in:
2025-09-09 21:09:08 +10:00
parent fa0a7b7f56
commit b9a9588f9d
2 changed files with 28 additions and 28 deletions
+17 -17
View File
@@ -3,21 +3,21 @@ import { LunaSettings, LunaSwitchSetting, LunaNumberSetting } from "@luna/ui";
import React from "react"; import React from "react";
export const settings = await ReactiveStore.getPluginStorage("RadiantLyrics", { export const settings = await ReactiveStore.getPluginStorage("RadiantLyrics", {
hideUIEnabled: true,
trackTitleGlow: false,
playerBarVisible: false,
lyricsGlowEnabled: true, lyricsGlowEnabled: true,
textGlow: 20, trackTitleGlow: false,
spinningCoverEverywhere: true, hideUIEnabled: true,
playerBarVisible: false,
CoverEverywhere: true,
performanceMode: false, performanceMode: false,
spinningArtEnabled: true, spinningArt: true,
textGlow: 20,
backgroundScale: 15,
backgroundRadius: 25,
backgroundContrast: 120, backgroundContrast: 120,
backgroundBlur: 80, backgroundBlur: 80,
backgroundBrightness: 40, backgroundBrightness: 40,
spinSpeed: 45, spinSpeed: 45,
settingsAffectNowPlaying: true, settingsAffectNowPlaying: true,
backgroundScale: 15,
backgroundRadius: 25,
}); });
export const Settings = () => { export const Settings = () => {
@@ -31,14 +31,14 @@ export const Settings = () => {
settings.lyricsGlowEnabled, settings.lyricsGlowEnabled,
); );
const [textGlow, setTextGlow] = React.useState(settings.textGlow); const [textGlow, setTextGlow] = React.useState(settings.textGlow);
const [spinningCoverEverywhere, setSpinningCoverEverywhere] = React.useState( const [CoverEverywhere, setCoverEverywhere] = React.useState(
settings.spinningCoverEverywhere, settings.CoverEverywhere,
); );
const [performanceMode, setPerformanceMode] = React.useState( const [performanceMode, setPerformanceMode] = React.useState(
settings.performanceMode, settings.performanceMode,
); );
const [spinningArtEnabled, setSpinningArtEnabled] = React.useState( const [spinningArt, setspinningArt] = React.useState(
settings.spinningArtEnabled, settings.spinningArt,
); );
const [backgroundContrast, setBackgroundContrast] = React.useState( const [backgroundContrast, setBackgroundContrast] = React.useState(
settings.backgroundContrast, settings.backgroundContrast,
@@ -121,14 +121,14 @@ export const Settings = () => {
<AnySwitch <AnySwitch
title="Cover Everywhere" title="Cover Everywhere"
desc="Apply the spinning Cover Art background to the entire app, not just the Now Playing view, Heavily Inspired by Cover-Theme by @Inrixia" desc="Apply the spinning Cover Art background to the entire app, not just the Now Playing view, Heavily Inspired by Cover-Theme by @Inrixia"
checked={spinningCoverEverywhere} checked={CoverEverywhere}
onChange={(_: unknown, checked: boolean) => { onChange={(_: unknown, checked: boolean) => {
console.log( console.log(
"Spinning Cover Everywhere:", "Spinning Cover Everywhere:",
checked ? "enabled" : "disabled", checked ? "enabled" : "disabled",
); );
setSpinningCoverEverywhere( setCoverEverywhere(
(settings.spinningCoverEverywhere = checked), (settings.CoverEverywhere = checked),
); );
// Update styles immediately when setting changes // Update styles immediately when setting changes
if ((window as any).updateRadiantLyricsGlobalBackground) { if ((window as any).updateRadiantLyricsGlobalBackground) {
@@ -155,13 +155,13 @@ export const Settings = () => {
<AnySwitch <AnySwitch
title="Background Cover Spin" // Cheers @Max/n0201 for the idea <3 title="Background Cover Spin" // Cheers @Max/n0201 for the idea <3
desc="Enable the spinning cover art background animation" desc="Enable the spinning cover art background animation"
checked={spinningArtEnabled} checked={spinningArt}
onChange={(_: unknown, checked: boolean) => { onChange={(_: unknown, checked: boolean) => {
console.log( console.log(
"Background Cover Spin:", "Background Cover Spin:",
checked ? "enabled" : "disabled", checked ? "enabled" : "disabled",
); );
setSpinningArtEnabled((settings.spinningArtEnabled = checked)); setspinningArt((settings.spinningArt = checked));
if ((window as any).updateRadiantLyricsGlobalBackground) { if ((window as any).updateRadiantLyricsGlobalBackground) {
(window as any).updateRadiantLyricsGlobalBackground(); (window as any).updateRadiantLyricsGlobalBackground();
} }
+11 -11
View File
@@ -387,7 +387,7 @@ function updateCoverArtBackground(method: number = 0): void {
// Update backgrounds when we have a valid cover art source // Update backgrounds when we have a valid cover art source
if (coverArtImageSrc) { if (coverArtImageSrc) {
// Apply global spinning background if enabled // Apply global spinning background if enabled
if (settings.spinningCoverEverywhere) { if (settings.CoverEverywhere) {
applyGlobalSpinningBackground(coverArtImageSrc); applyGlobalSpinningBackground(coverArtImageSrc);
} }
@@ -495,10 +495,10 @@ function updateCoverArtBackground(method: number = 0): void {
const filt = `blur(${blur}px) brightness(${settings.backgroundBrightness / 100}) contrast(${contrast}%)`; const filt = `blur(${blur}px) brightness(${settings.backgroundBrightness / 100}) contrast(${contrast}%)`;
if (nowPlayingBackgroundImage.style.filter !== filt) if (nowPlayingBackgroundImage.style.filter !== filt)
nowPlayingBackgroundImage.style.filter = filt; nowPlayingBackgroundImage.style.filter = filt;
const anim = settings.spinningArtEnabled const anim = settings.spinningArt
? `spin ${settings.spinSpeed}s linear infinite` ? `spin ${settings.spinSpeed}s linear infinite`
: "none"; : "none";
const wc = settings.spinningArtEnabled ? "transform" : "auto"; const wc = settings.spinningArt ? "transform" : "auto";
if (nowPlayingBackgroundImage.style.animation !== anim) if (nowPlayingBackgroundImage.style.animation !== anim)
nowPlayingBackgroundImage.style.animation = anim; nowPlayingBackgroundImage.style.animation = anim;
if (nowPlayingBackgroundImage.style.willChange !== wc) if (nowPlayingBackgroundImage.style.willChange !== wc)
@@ -512,10 +512,10 @@ function updateCoverArtBackground(method: number = 0): void {
const filt = `blur(${settings.backgroundBlur}px) brightness(${settings.backgroundBrightness / 100}) contrast(${settings.backgroundContrast}%)`; const filt = `blur(${settings.backgroundBlur}px) brightness(${settings.backgroundBrightness / 100}) contrast(${settings.backgroundContrast}%)`;
if (nowPlayingBackgroundImage.style.filter !== filt) if (nowPlayingBackgroundImage.style.filter !== filt)
nowPlayingBackgroundImage.style.filter = filt; nowPlayingBackgroundImage.style.filter = filt;
const anim = settings.spinningArtEnabled const anim = settings.spinningArt
? `spin ${settings.spinSpeed}s linear infinite` ? `spin ${settings.spinSpeed}s linear infinite`
: "none"; : "none";
const wc = settings.spinningArtEnabled ? "transform" : "auto"; const wc = settings.spinningArt ? "transform" : "auto";
if (nowPlayingBackgroundImage.style.animation !== anim) if (nowPlayingBackgroundImage.style.animation !== anim)
nowPlayingBackgroundImage.style.animation = anim; nowPlayingBackgroundImage.style.animation = anim;
if (nowPlayingBackgroundImage.style.willChange !== wc) if (nowPlayingBackgroundImage.style.willChange !== wc)
@@ -547,7 +547,7 @@ const applyGlobalSpinningBackground = (coverArtImageSrc: string): void => {
'[data-test="main"]', '[data-test="main"]',
) as HTMLElement; ) as HTMLElement;
if (!settings.spinningCoverEverywhere) { if (!settings.CoverEverywhere) {
cleanUpGlobalSpinningBackground(); cleanUpGlobalSpinningBackground();
return; return;
} }
@@ -663,7 +663,7 @@ const applyGlobalSpinningBackground = (coverArtImageSrc: string): void => {
if (globalBackgroundImage.style.borderRadius !== radius) if (globalBackgroundImage.style.borderRadius !== radius)
globalBackgroundImage.style.borderRadius = radius; globalBackgroundImage.style.borderRadius = radius;
// Do not apply radius to vignette overlay; matches Now Playing behavior // Do not apply radius to vignette overlay; matches Now Playing behavior
if (settings.spinningArtEnabled) { if (settings.spinningArt) {
globalBackgroundImage.style.animation = `spinGlobal ${settings.spinSpeed}s linear infinite`; globalBackgroundImage.style.animation = `spinGlobal ${settings.spinSpeed}s linear infinite`;
globalBackgroundImage.style.willChange = "transform"; globalBackgroundImage.style.willChange = "transform";
} else { } else {
@@ -677,7 +677,7 @@ const applyGlobalSpinningBackground = (coverArtImageSrc: string): void => {
if (globalBackgroundImage.style.borderRadius !== radius) if (globalBackgroundImage.style.borderRadius !== radius)
globalBackgroundImage.style.borderRadius = radius; globalBackgroundImage.style.borderRadius = radius;
// Do not apply radius to vignette overlay; matches Now Playing behavior // Do not apply radius to vignette overlay; matches Now Playing behavior
if (settings.spinningArtEnabled) { if (settings.spinningArt) {
globalBackgroundImage.style.animation = `spinGlobal ${settings.spinSpeed}s linear infinite`; globalBackgroundImage.style.animation = `spinGlobal ${settings.spinSpeed}s linear infinite`;
globalBackgroundImage.style.willChange = "transform"; globalBackgroundImage.style.willChange = "transform";
} else { } else {
@@ -715,7 +715,7 @@ const updateRadiantLyricsGlobalBackground = function (): void {
document.body.classList.remove("performance-mode"); document.body.classList.remove("performance-mode");
} }
if (settings.spinningCoverEverywhere) { if (settings.CoverEverywhere) {
// Get current cover art and apply global background // Get current cover art and apply global background
updateCoverArtBackground(); updateCoverArtBackground();
} else { } else {
@@ -761,7 +761,7 @@ const updateRadiantLyricsNowPlayingBackground = function (): void {
// Reduce blur and effects for better performance, but keep spinning // Reduce blur and effects for better performance, but keep spinning
blur = Math.min(blur, 20); blur = Math.min(blur, 20);
contrast = Math.min(contrast, 150); contrast = Math.min(contrast, 150);
if (settings.spinningArtEnabled) { if (settings.spinningArt) {
imgElement.style.animation = `spin ${spinSpeed}s linear infinite`; imgElement.style.animation = `spin ${spinSpeed}s linear infinite`;
imgElement.style.willChange = "transform"; imgElement.style.willChange = "transform";
} else { } else {
@@ -770,7 +770,7 @@ const updateRadiantLyricsNowPlayingBackground = function (): void {
} }
imgElement.classList.remove("performance-mode-static"); imgElement.classList.remove("performance-mode-static");
} else { } else {
if (settings.spinningArtEnabled) { if (settings.spinningArt) {
imgElement.style.animation = `spin ${spinSpeed}s linear infinite`; imgElement.style.animation = `spin ${spinSpeed}s linear infinite`;
imgElement.style.willChange = "transform"; imgElement.style.willChange = "transform";
} else { } else {