diff --git a/packages/frontend/src/components/MkContextMenu.vue b/packages/frontend/src/components/MkContextMenu.vue index 9d9abc5d0..bb4a71656 100644 --- a/packages/frontend/src/components/MkContextMenu.vue +++ b/packages/frontend/src/components/MkContextMenu.vue @@ -74,7 +74,7 @@ function onMousedown(evt: Event) { } .fade-enter-active, .fade-leave-active { - transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1); + transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); transform-origin: left top; } diff --git a/packages/frontend/src/components/MkModal.vue b/packages/frontend/src/components/MkModal.vue index f323de605..83b40fd01 100644 --- a/packages/frontend/src/components/MkModal.vue +++ b/packages/frontend/src/components/MkModal.vue @@ -74,8 +74,24 @@ const type = $computed(() => { return props.preferType!; } }); -let transitionName = $ref(defaultStore.state.animation ? (type === 'drawer') ? 'modal-drawer' : (type === 'popup') ? 'modal-popup' : 'modal' : ''); -let transitionDuration = $ref(defaultStore.state.animation ? 200 : 0); +let transitionName = $computed((() => + defaultStore.state.animation + ? (type === 'drawer') + ? 'modal-drawer' + : (type === 'popup') + ? 'modal-popup' + : 'modal' + : '' +)); +let transitionDuration = $computed((() => + transitionName === 'modal-popup' + ? 100 + : transitionName === 'modal' + ? 200 + : transitionName === 'modal-drawer' + ? 200 + : 0 +)); let contentClicking = false; @@ -308,12 +324,12 @@ defineExpose({ .modal-popup-enter-active, .modal-popup-leave-active { > .bg { - transition: opacity 0.2s !important; + transition: opacity 0.1s !important; } > .content { transform-origin: var(--transformOrigin); - transition: opacity 0.2s cubic-bezier(0, 0, 0.2, 1), transform 0.2s cubic-bezier(0, 0, 0.2, 1) !important; + transition: opacity 0.1s cubic-bezier(0, 0, 0.2, 1), transform 0.1s cubic-bezier(0, 0, 0.2, 1) !important; } } .modal-popup-enter-from, .modal-popup-leave-to {