Hide UI Rework

This commit is contained in:
2025-06-05 22:06:02 +10:00
parent 477593c0c3
commit 0f341cabf7
4 changed files with 153 additions and 93 deletions
+20 -4
View File
@@ -192,14 +192,30 @@ const toggleRadiantLyrics = function(): void {
// Toggle the state first
isHidden = !isHidden;
const nowPlayingContainer = document.querySelector('[class*="_nowPlayingContainer"]') as HTMLElement;
if (isHidden) {
// Apply clean view styles
updateRadiantLyricsStyles();
// Add a class to the container to trigger CSS animations
if (nowPlayingContainer) {
nowPlayingContainer.classList.add('radiant-lyrics-ui-hidden');
}
document.body.classList.add('radiant-lyrics-ui-hidden');
} else {
// Remove all clean view styles
lyricsStyleTag.remove();
baseStyleTag.remove();
playerBarStyleTag.remove();
// Don't remove StyleTags completely, just remove the class to show elements again
if (nowPlayingContainer) {
nowPlayingContainer.classList.remove('radiant-lyrics-ui-hidden');
}
document.body.classList.remove('radiant-lyrics-ui-hidden');
// Remove styles after animation completes
setTimeout(() => {
if (!isHidden) {
lyricsStyleTag.remove();
baseStyleTag.remove();
playerBarStyleTag.remove();
}
}, 500); // Wait for fade animation to complete
}
updateButtonStates();
};