mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix: remove popup animation when animations are disabled
This commit is contained in:
+32
-12
@@ -862,11 +862,16 @@ export function closeSettings() {
|
|||||||
|
|
||||||
if (SettingsClicked == true) {
|
if (SettingsClicked == true) {
|
||||||
ExtensionSettings!.classList.add('hide')
|
ExtensionSettings!.classList.add('hide')
|
||||||
animate(
|
if (settingsState.animations) {
|
||||||
'#ExtensionPopup',
|
animate(
|
||||||
{ opacity: [1, 0], scale: [1, 0] },
|
'#ExtensionPopup',
|
||||||
{ easing: spring({ stiffness: 220, damping: 18 }) }
|
{ opacity: [1, 0], scale: [1, 0] },
|
||||||
)
|
{ easing: spring({ stiffness: 220, damping: 18 }) }
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
ExtensionSettings.style.opacity = '0'
|
||||||
|
ExtensionSettings.style.transform = 'scale(0)'
|
||||||
|
}
|
||||||
SettingsClicked = false
|
SettingsClicked = false
|
||||||
|
|
||||||
if (ExtensionIframe.contentWindow) {
|
if (ExtensionIframe.contentWindow) {
|
||||||
@@ -903,11 +908,16 @@ export function addExtensionSettings() {
|
|||||||
const ExtensionIframe = document.getElementById('ExtensionIframe') as HTMLIFrameElement
|
const ExtensionIframe = document.getElementById('ExtensionIframe') as HTMLIFrameElement
|
||||||
|
|
||||||
extensionPopup.classList.add('hide')
|
extensionPopup.classList.add('hide')
|
||||||
animate(
|
if (settingsState.animations) {
|
||||||
'#ExtensionPopup',
|
animate(
|
||||||
{ opacity: [1, 0], scale: [1, 0] },
|
'#ExtensionPopup',
|
||||||
{ easing: [.22, .03, .26, 1] }
|
{ opacity: [1, 0], scale: [1, 0] },
|
||||||
)
|
{ easing: spring({ stiffness: 220, damping: 18 }) }
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
extensionPopup.style.opacity = '0'
|
||||||
|
extensionPopup.style.transform = 'scale(0)'
|
||||||
|
}
|
||||||
if (ExtensionIframe.contentWindow) {
|
if (ExtensionIframe.contentWindow) {
|
||||||
ExtensionIframe.contentWindow.postMessage('popupClosed', '*')
|
ExtensionIframe.contentWindow.postMessage('popupClosed', '*')
|
||||||
}
|
}
|
||||||
@@ -1153,12 +1163,22 @@ export function setupSettingsButton() {
|
|||||||
AddedSettings!.addEventListener('click', function () {
|
AddedSettings!.addEventListener('click', function () {
|
||||||
if (SettingsClicked) {
|
if (SettingsClicked) {
|
||||||
extensionPopup!.classList.add('hide');
|
extensionPopup!.classList.add('hide');
|
||||||
animate('#ExtensionPopup', { opacity: [1, 0], scale: [1, 0] }, { easing: spring({ stiffness: 220, damping: 18 }) });
|
if (settingsState.animations) {
|
||||||
|
animate('#ExtensionPopup', { opacity: [1, 0], scale: [1, 0] }, { easing: spring({ stiffness: 220, damping: 18 }) });
|
||||||
|
} else {
|
||||||
|
extensionPopup!.style.opacity = '0'
|
||||||
|
extensionPopup!.style.transform = 'scale(0)'
|
||||||
|
}
|
||||||
(document.getElementById('ExtensionIframe')! as HTMLIFrameElement).contentWindow!.postMessage('popupClosed', '*');
|
(document.getElementById('ExtensionIframe')! as HTMLIFrameElement).contentWindow!.postMessage('popupClosed', '*');
|
||||||
SettingsClicked = false;
|
SettingsClicked = false;
|
||||||
} else {
|
} else {
|
||||||
extensionPopup!.classList.remove('hide');
|
extensionPopup!.classList.remove('hide');
|
||||||
animate('#ExtensionPopup', { opacity: [0, 1], scale: [0, 1] }, { easing: spring({ stiffness: 260, damping: 24 }) });
|
if (settingsState.animations) {
|
||||||
|
animate('#ExtensionPopup', { opacity: [0, 1], scale: [0, 1] }, { easing: spring({ stiffness: 260, damping: 24 }) });
|
||||||
|
} else {
|
||||||
|
extensionPopup!.style.opacity = '1'
|
||||||
|
extensionPopup!.style.transform = 'scale(1)'
|
||||||
|
}
|
||||||
SettingsClicked = true;
|
SettingsClicked = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user