Merge pull request #50 from meowarex/dev

Fixed Title Glow Persistence
This commit is contained in:
Meow Meow
2025-08-14 21:40:51 +10:00
committed by GitHub
4 changed files with 2390 additions and 15 deletions
-4
View File
@@ -1,6 +1,2 @@
node_modules/ node_modules/
dist/ dist/
dist/itzzexcel.oled-theme.json
dist/itzzexcel.oled-theme.mjs
dist/itzzexcel.oled-theme.mjs.map
dist/store.json
+2356
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -18,5 +18,8 @@
"rimraf": "^6.0.1", "rimraf": "^6.0.1",
"tsx": "^4.19.4", "tsx": "^4.19.4",
"typescript": "^5.8.3" "typescript": "^5.8.3"
},
"dependencies": {
"pnpm": "^10.14.0"
} }
} }
+21 -1
View File
@@ -79,7 +79,7 @@ const updateRadiantLyricsStyles = function(): void {
}).catch(() => {}); }).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; const trackTitleEl = document.querySelector('[data-test="now-playing-track-title"]') as HTMLElement | null;
if (trackTitleEl) { if (trackTitleEl) {
if (settings.trackTitleGlow && settings.lyricsGlowEnabled) { 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) // Initialize the button creation and observers (non-polling)
setupHeaderObserver(); setupHeaderObserver();
setupNowPlayingObserver(); setupNowPlayingObserver();
setupTrackTitleObserver();
observeTrackChanges(); observeTrackChanges();