From 5c8fe6476dab0832e02122a9571c884ea5cd0725 Mon Sep 17 00:00:00 2001 From: meowarex Date: Tue, 3 Jun 2025 00:42:17 +1000 Subject: [PATCH] Added Setting for Glowing Lyrics --- plugins/clean-view-luna/src/Settings.tsx | 15 ++++++++ plugins/clean-view-luna/src/index.ts | 42 +++++++++++++++++++-- plugins/clean-view-luna/src/lyrics-glow.css | 21 +++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) diff --git a/plugins/clean-view-luna/src/Settings.tsx b/plugins/clean-view-luna/src/Settings.tsx index 7ee7c5c..6ba1991 100644 --- a/plugins/clean-view-luna/src/Settings.tsx +++ b/plugins/clean-view-luna/src/Settings.tsx @@ -5,14 +5,29 @@ import React from "react"; export const settings = await ReactiveStore.getPluginStorage("CleanView", { hideUIEnabled: true, playerBarVisible: true, + lyricsGlowEnabled: true, }); export const Settings = () => { const [hideUIEnabled, setHideUIEnabled] = React.useState(settings.hideUIEnabled); const [playerBarVisible, setPlayerBarVisible] = React.useState(settings.playerBarVisible); + const [lyricsGlowEnabled, setLyricsGlowEnabled] = React.useState(settings.lyricsGlowEnabled); return ( + { + console.log("Lyrics Glow Effect:", checked ? "enabled" : "disabled"); + setLyricsGlowEnabled((settings.lyricsGlowEnabled = checked)); + // Update styles immediately when setting changes + if ((window as any).updateCleanViewStyles) { + (window as any).updateCleanViewStyles(); + } + }} + /> observer.disconnect()); } +// Also observe for lyrics container changes to apply the setting +function observeLyricsContainer(): void { + const observer = new MutationObserver(() => { + const lyricsContainer = document.querySelector('[class^="_lyricsContainer"]'); + if (lyricsContainer) { + if (settings.lyricsGlowEnabled) { + lyricsContainer.classList.remove('lyrics-glow-disabled'); + } else { + lyricsContainer.classList.add('lyrics-glow-disabled'); + } + } + }); + + observer.observe(document.body, { + childList: true, + subtree: true + }); + + unloads.add(() => observer.disconnect()); +} + const onTrackChanged = function (method: number = 0): void { if (method === 1) { setTimeout(() => { @@ -369,6 +404,7 @@ const cleanUpDynamicArt = function (): void { // Initialize the button creation and observers observeForButtons(); observeTrackTitle(); +observeLyricsContainer(); onTrackChanged(1); // Add cleanup to unloads diff --git a/plugins/clean-view-luna/src/lyrics-glow.css b/plugins/clean-view-luna/src/lyrics-glow.css index 147c2c1..ba55d4e 100644 --- a/plugins/clean-view-luna/src/lyrics-glow.css +++ b/plugins/clean-view-luna/src/lyrics-glow.css @@ -30,6 +30,8 @@ transition-duration: 0.7s; font-size: 55px; color: white !important; + font-family: "AbyssFont", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-weight: 700; } [class*="_lyricsText"] > div > span { @@ -37,6 +39,8 @@ transition-duration: 0.25s; color: rgba(128, 128, 128, 0.4); font-size: 40px; + font-family: "AbyssFont", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-weight: 700; } [class*="_lyricsText"] > div > span:hover { @@ -63,4 +67,21 @@ font-family: "AbyssFont", system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; font-weight: 700; font-size: 38px !important; +} + +/* Reset all lyrics styling when disabled */ +.lyrics-glow-disabled [class*="_lyricsText"] > div > span[data-current="true"], +.lyrics-glow-disabled [class*="_lyricsText"] > div > span, +.lyrics-glow-disabled [class*="_lyricsText"] > div > span:hover, +.lyrics-glow-disabled [data-test="now-playing-track-title"], +.lyrics-glow-disabled [class^="_lyricsContainer"] > div > div > span { + text-shadow: none !important; + padding-left: 0 !important; + transition: none !important; + font-size: inherit !important; + color: inherit !important; + font-family: inherit !important; + font-weight: inherit !important; + margin-bottom: inherit !important; + opacity: inherit !important; } \ No newline at end of file