mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
Fixed Animation of Unhide
This commit is contained in:
@@ -35,13 +35,43 @@ const updateButtonStates = function(): void {
|
|||||||
const unhideButton = document.querySelector('.unhide-ui-button') as HTMLElement;
|
const unhideButton = document.querySelector('.unhide-ui-button') as HTMLElement;
|
||||||
|
|
||||||
if (hideButton) {
|
if (hideButton) {
|
||||||
hideButton.style.display = (settings.hideUIEnabled && !isHidden) ? 'flex' : 'none';
|
if (settings.hideUIEnabled && !isHidden) {
|
||||||
|
hideButton.style.display = 'flex';
|
||||||
|
hideButton.style.opacity = '1';
|
||||||
|
hideButton.style.visibility = 'visible';
|
||||||
|
hideButton.style.pointerEvents = 'auto';
|
||||||
|
} else {
|
||||||
|
hideButton.style.opacity = '0';
|
||||||
|
hideButton.style.visibility = 'hidden';
|
||||||
|
hideButton.style.pointerEvents = 'none';
|
||||||
|
// Keep display: flex to maintain transitions
|
||||||
|
setTimeout(() => {
|
||||||
|
if (hideButton.style.opacity === '0') {
|
||||||
|
hideButton.style.display = 'none';
|
||||||
|
}
|
||||||
|
}, 500); // Wait for transition to complete
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (unhideButton) {
|
if (unhideButton) {
|
||||||
unhideButton.style.display = (settings.hideUIEnabled && isHidden) ? 'flex' : 'none';
|
|
||||||
// Remove the immediate hide class when button should be visible
|
|
||||||
if (settings.hideUIEnabled && isHidden) {
|
if (settings.hideUIEnabled && isHidden) {
|
||||||
|
unhideButton.style.display = 'flex';
|
||||||
|
// Remove the hide-immediately class and let it fade in
|
||||||
unhideButton.classList.remove('hide-immediately');
|
unhideButton.classList.remove('hide-immediately');
|
||||||
|
setTimeout(() => {
|
||||||
|
unhideButton.style.opacity = '1';
|
||||||
|
unhideButton.style.visibility = 'visible';
|
||||||
|
unhideButton.style.pointerEvents = 'auto';
|
||||||
|
}, 50); // Small delay to ensure display is set first
|
||||||
|
} else {
|
||||||
|
unhideButton.style.opacity = '0';
|
||||||
|
unhideButton.style.visibility = 'hidden';
|
||||||
|
unhideButton.style.pointerEvents = 'none';
|
||||||
|
// Keep display: flex to maintain transitions
|
||||||
|
setTimeout(() => {
|
||||||
|
if (unhideButton.style.opacity === '0') {
|
||||||
|
unhideButton.style.display = 'none';
|
||||||
|
}
|
||||||
|
}, 500); // Wait for transition to complete
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -278,10 +308,13 @@ const createHideUIButton = function(): void {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transition: background-color 0.2s ease;
|
transition: all 0.5s ease-in-out;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
opacity: 1;
|
||||||
|
visibility: visible;
|
||||||
|
pointer-events: auto;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Add hover effect
|
// Add hover effect
|
||||||
@@ -341,7 +374,7 @@ const createUnhideUIButton = function(): void {
|
|||||||
display: none;
|
display: none;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.5s ease-in-out;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
@@ -349,6 +382,9 @@ const createUnhideUIButton = function(): void {
|
|||||||
-webkit-backdrop-filter: blur(10px);
|
-webkit-backdrop-filter: blur(10px);
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
||||||
|
opacity: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
pointer-events: none;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// Add hover effect
|
// Add hover effect
|
||||||
|
|||||||
@@ -36,12 +36,11 @@
|
|||||||
|
|
||||||
/* Remove all layout-changing rules - only fade buttons, keep everything else in place */
|
/* Remove all layout-changing rules - only fade buttons, keep everything else in place */
|
||||||
|
|
||||||
/* Immediate hide class for unhide button */
|
/* Immediate hide class for unhide button with smooth transition */
|
||||||
.hide-immediately {
|
.hide-immediately {
|
||||||
opacity: 0 !important;
|
opacity: 0 !important;
|
||||||
visibility: hidden !important;
|
visibility: hidden !important;
|
||||||
pointer-events: none !important;
|
pointer-events: none !important;
|
||||||
transition: none !important;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[class^="_bar"] {
|
[class^="_bar"] {
|
||||||
@@ -173,8 +172,4 @@ button[aria-label*="Heart"],
|
|||||||
transition: opacity 0.5s ease-in-out;
|
transition: opacity 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Keep the Unhide button always visible with special styling */
|
/* Let JavaScript handle the unhide button visibility and transitions */
|
||||||
.unhide-ui-button {
|
|
||||||
opacity: 1 !important;
|
|
||||||
display: flex !important;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user