mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-17 19:33:10 +10:00
Fixed Title Glow Persistance
This commit is contained in:
@@ -1,6 +1,2 @@
|
||||
node_modules/
|
||||
dist/
|
||||
dist/itzzexcel.oled-theme.json
|
||||
dist/itzzexcel.oled-theme.mjs
|
||||
dist/itzzexcel.oled-theme.mjs.map
|
||||
dist/store.json
|
||||
Generated
+2356
File diff suppressed because it is too large
Load Diff
@@ -18,5 +18,8 @@
|
||||
"rimraf": "^6.0.1",
|
||||
"tsx": "^4.19.4",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"pnpm": "^10.14.0"
|
||||
}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ const updateRadiantLyricsStyles = function(): void {
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
// Track title glow toggle
|
||||
// Track title glow toggle based on settings
|
||||
const trackTitleEl = document.querySelector('[data-test="now-playing-track-title"]') as HTMLElement | null;
|
||||
if (trackTitleEl) {
|
||||
if (settings.trackTitleGlow && settings.lyricsGlowEnabled) {
|
||||
@@ -775,7 +775,27 @@ function setupNowPlayingObserver(): void {
|
||||
});
|
||||
}
|
||||
|
||||
function setupTrackTitleObserver(): void {
|
||||
const trackTitleEl = document.querySelector('[data-test="now-playing-track-title"]') as HTMLElement | null;
|
||||
if (trackTitleEl) {
|
||||
if (settings.trackTitleGlow && settings.lyricsGlowEnabled) {
|
||||
trackTitleEl.classList.remove('rl-title-glow-disabled');
|
||||
} else {
|
||||
trackTitleEl.classList.add('rl-title-glow-disabled');
|
||||
}
|
||||
}
|
||||
observe<HTMLElement>(unloads, '[data-test="now-playing-track-title"]', (el) => {
|
||||
if (!el) return;
|
||||
if (settings.trackTitleGlow && settings.lyricsGlowEnabled) {
|
||||
el.classList.remove('rl-title-glow-disabled');
|
||||
} else {
|
||||
el.classList.add('rl-title-glow-disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize the button creation and observers (non-polling)
|
||||
setupHeaderObserver();
|
||||
setupNowPlayingObserver();
|
||||
setupTrackTitleObserver();
|
||||
observeTrackChanges();
|
||||
Reference in New Issue
Block a user