Cleanup Comments

This commit is contained in:
2025-06-06 00:54:20 +10:00
parent 9c96000dc1
commit 40b08efc12
2 changed files with 19 additions and 28 deletions
+10 -10
View File
@@ -44,7 +44,7 @@ const updateButtonStates = function(): void {
hideButton.style.pointerEvents = 'auto';
}, 50);
} else {
// Hide UI button immediately when clicked - no fade animation
// Hide UI button immediately when clicked - (couldn't get the fade to work)
hideButton.style.display = 'none';
hideButton.style.opacity = '0';
hideButton.style.visibility = 'hidden';
@@ -56,7 +56,7 @@ const updateButtonStates = function(): void {
unhideButton.style.display = 'flex';
// Remove the hide-immediately class and let it fade in smoothly
unhideButton.classList.remove('hide-immediately');
// Small delay to ensure display is set first, then fade in
// Small delay to ensure display is set first, then fade in - (Works for unhide button.. but not hide button.. because uhh idk)
setTimeout(() => {
unhideButton.style.opacity = '1';
unhideButton.style.visibility = 'visible';
@@ -120,7 +120,7 @@ const applyGlobalSpinningBackground = (coverArtImageSrc: string): void => {
return;
}
// Add StyleTag if not present
// Add StyleTag if not present (Don't know if this is needed.. But it's here)
if (!globalSpinningBgStyleTag) {
globalSpinningBgStyleTag = new StyleTag("RadiantLyrics-global-spinning-bg", unloads, coverEverywhereCss);
}
@@ -227,11 +227,11 @@ const toggleRadiantLyrics = function(): void {
const nowPlayingContainer = document.querySelector('[class*="_nowPlayingContainer"]') as HTMLElement;
if (isHidden) {
// We're currently hidden, so we're about to show UI
// currently hidden, so we're about to show UI
// Add a class to immediately hide the unhide button with CSS
const unhideButton = document.querySelector('.unhide-ui-button') as HTMLElement;
if (unhideButton) {
unhideButton.classList.add('hide-immediately');
unhideButton.classList.add('hide-immediately'); // actually uses fade out but.. still
}
// Toggle the state
@@ -242,7 +242,7 @@ const toggleRadiantLyrics = function(): void {
nowPlayingContainer.classList.remove('radiant-lyrics-ui-hidden');
}
document.body.classList.remove('radiant-lyrics-ui-hidden');
// Remove styles after animation completes
// Remove styles after animation completes (I think this is needed.. but not sure)
setTimeout(() => {
if (!isHidden) {
lyricsStyleTag.remove();
@@ -261,7 +261,7 @@ const toggleRadiantLyrics = function(): void {
// Update button states immediately to start Hide UI button fade-out
updateButtonStates();
// Delay adding the CSS class to allow Hide UI button to fade out first
// Delay adding the CSS class to allow Hide UI button to fade out first - (Had issues with the fade out.. so I removed it)
setTimeout(() => {
// Apply clean view styles
updateRadiantLyricsStyles();
@@ -270,7 +270,7 @@ const toggleRadiantLyrics = function(): void {
nowPlayingContainer.classList.add('radiant-lyrics-ui-hidden');
}
document.body.classList.add('radiant-lyrics-ui-hidden');
}, 50); // Small delay to let Hide UI button start its fade transition
}, 50); // Small delay to let Hide UI button start its fade transition - (Had issues with the fade out.. so I removed it)
}
};
@@ -362,14 +362,14 @@ const createUnhideUIButton = function(): void {
return;
}
// Create our unhide UI button
// Create unhide UI button
const unhideUIButton = document.createElement("button");
unhideUIButton.className = 'unhide-ui-button';
unhideUIButton.setAttribute('aria-label', 'Unhide UI');
unhideUIButton.setAttribute('title', 'Unhide UI');
unhideUIButton.textContent = 'Unhide';
// Style for top-right positioning within the Now Playing container (with safe margin)
// Style for top-right positioning within the Now Playing container (is a pain)
unhideUIButton.style.cssText = `
position: absolute;
top: 10px;
+9 -18
View File
@@ -9,9 +9,7 @@
transition: opacity 0.4s ease-in-out;
}
/* Remove image container positioning - let it stay where it is */
/* Tab items stay hidden - no hover functionality */
/* Tab items stay hidden - no hover functionality (if the song changes and it doesnt have lyrics.. and ya want them back.. you can unhide the UI <3) */
.radiant-lyrics-ui-hidden [data-test="header-container"]:not(:has(.hide-ui-button)) {
opacity: 0 !important;
@@ -38,9 +36,7 @@
transform: none !important;
}
/* Remove all layout-changing rules - only fade buttons, keep everything else in place */
/* Immediate hide class for unhide button with smooth transition */
/* Immediate hide class for unhide button with smooth transition (had issues with the fade out.. so I removed it) */
.hide-immediately {
opacity: 0 !important;
visibility: hidden !important;
@@ -57,14 +53,12 @@
transition: opacity 0.4s ease-in-out;
}
/* Bar elements stay hidden - no hover functionality */
/* Default state for bar elements */
[class^="_bar"]>* {
transition: opacity 0.4s ease-in-out;
}
/* Hide search box and make it non-interactive - comprehensive selectors */
/* Hide search box and make it non-interactive */
.radiant-lyrics-ui-hidden [data-test="search-input"],
.radiant-lyrics-ui-hidden [class*="_searchInput"],
.radiant-lyrics-ui-hidden [class*="searchInput"],
@@ -85,7 +79,7 @@
}
/* Hide bottom left controls completely - no hover functionality */
/* Exclude heart buttons in player bar and make sure hidden buttons can't be clicked */
/* Exclude heart button in player bar and make sure hidden buttons can't be clicked */
.radiant-lyrics-ui-hidden [data-test="add-to-playlist"]:not([data-test="footer-player"] *),
.radiant-lyrics-ui-hidden [data-test="remove-from-playlist"]:not([data-test="footer-player"] *),
.radiant-lyrics-ui-hidden [data-test="like-toggle"]:not([data-test="footer-player"] *),
@@ -111,10 +105,10 @@
.radiant-lyrics-ui-hidden button[aria-label*="Like"]:not([data-test="footer-player"] *),
.radiant-lyrics-ui-hidden button[aria-label*="Favorite"]:not([data-test="footer-player"] *),
.radiant-lyrics-ui-hidden button[aria-label*="Heart"]:not([data-test="footer-player"] *),
/* Target buttons in bottom left area specifically */
/* Target buttons in bottom left area specifically - (idk if this is needed.. but it's here) */
.radiant-lyrics-ui-hidden [class*="_nowPlayingContainer"] button[class*="_button"]:not(.unhide-ui-button),
.radiant-lyrics-ui-hidden [class*="_nowPlayingContainer"] [class*="_iconButton"]:not(.unhide-ui-button),
/* Additional catch-all for bottom left area buttons */
/* Additional catch-all for bottom left area buttons - (idk if this is needed.. but it's here) */
.radiant-lyrics-ui-hidden [class*="_nowPlayingContainer"] > div > div:first-child button:not(.unhide-ui-button),
.radiant-lyrics-ui-hidden [class*="_nowPlayingContainer"] > div:first-child button:not(.unhide-ui-button) {
opacity: 0 !important;
@@ -122,7 +116,7 @@
transition: opacity 0.5s ease-in-out !important;
}
/* No hover functionality in Hide UI Mode - buttons stay hidden */
/* No hover functionality in Hide UI Mode - buttons stay hidden.. yea thats right, you heard me */
/* Default state for control buttons */
[data-test="add-to-playlist"],
@@ -170,7 +164,7 @@ figure[class*="_albumImage"] {
transform: translateX(80px) !important;
}
/* Smooth track info wrapper movement when UI is hidden (less movement to stay centered) */
/* Smooth track info wrapper movement when UI is hidden (Arists & Track Title) */
[class*="_infoWrapper"],
[class*="_textContainer"] {
transition: transform 0.6s ease-in-out;
@@ -182,7 +176,6 @@ figure[class*="_albumImage"] {
}
/* Move parent containers instead of lyrics container directly to preserve gradient fade */
/* Use original movement distances: 30px right and 70px up */
[data-test="stream-metadata"],
[class*="_rightColumn"],
[class*="_rightSide"],
@@ -206,6 +199,4 @@ figure[class*="_albumImage"] {
/* Hide UI button base styling - just the transition */
.hide-ui-button {
transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out, background-color 0.2s ease-in-out, transform 0.2s ease-in-out !important;
}
/* Let JavaScript handle the unhide button visibility and transitions */
}