Merge pull request #28 from meowarex/dev

Move Unhide to Top Right
This commit is contained in:
Meow Meow
2025-06-05 19:03:06 +10:00
committed by GitHub
+6 -7
View File
@@ -290,11 +290,11 @@ const createUnhideUIButton = function(): void {
unhideUIButton.setAttribute('title', 'Unhide UI'); unhideUIButton.setAttribute('title', 'Unhide UI');
unhideUIButton.textContent = 'Unhide'; unhideUIButton.textContent = 'Unhide';
// Style for top-left positioning within the Now Playing container // Style for top-right positioning within the Now Playing container (with safe margin)
unhideUIButton.style.cssText = ` unhideUIButton.style.cssText = `
position: absolute; position: absolute;
top: 20px; top: 20px;
left: 20px; right: 80px;
background-color: rgba(255, 255, 255, 0.2); background-color: rgba(255, 255, 255, 0.2);
color: white; color: white;
border: 1px solid rgba(255, 255, 255, 0.3); border: 1px solid rgba(255, 255, 255, 0.3);
@@ -328,10 +328,10 @@ const createUnhideUIButton = function(): void {
unhideUIButton.onclick = toggleRadiantLyrics; unhideUIButton.onclick = toggleRadiantLyrics;
// Append to the Now Playing container // Append to the Now Playing container so it only shows there
nowPlayingContainer.appendChild(unhideUIButton); nowPlayingContainer.appendChild(unhideUIButton);
//trace.msg.log("Unhide UI button added to top-left of Now Playing container"); //trace.msg.log("Unhide UI button added to top-right of Now Playing container");
updateButtonStates(); updateButtonStates();
}, 1500); // Slight delay after hide button }, 1500); // Slight delay after hide button
}; };
@@ -375,9 +375,8 @@ function observeForButtons(): void {
createHideUIButton(); createHideUIButton();
} }
// Create unhide button if it doesn't exist and Now Playing container exists // Create unhide button if it doesn't exist
const nowPlayingContainer = document.querySelector('[class*="_nowPlayingContainer"]'); if (!document.querySelector('.unhide-ui-button')) {
if (nowPlayingContainer && !document.querySelector('.unhide-ui-button')) {
createUnhideUIButton(); createUnhideUIButton();
} }
}, 500); // Check every 500ms (much more efficient than MutationObserver) }, 500); // Check every 500ms (much more efficient than MutationObserver)