From 17fb67f6539594d65153bfcf18f54581b5078ed8 Mon Sep 17 00:00:00 2001 From: Cat Tom Date: Wed, 26 Mar 2025 12:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20WechatModal=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E5=8A=A8=E7=94=BB=E6=95=88=E6=9E=9C=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=80=8F=E6=98=8E=E5=BA=A6=E5=92=8C=E8=BF=87?= =?UTF-8?q?=E6=B8=A1=E6=97=B6=E9=97=B4=E4=BB=A5=E6=8F=90=E5=8D=87=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/WechatModal.vue | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/components/WechatModal.vue b/src/components/WechatModal.vue index fbf4eed..dff47be 100644 --- a/src/components/WechatModal.vue +++ b/src/components/WechatModal.vue @@ -208,7 +208,8 @@ onUnmounted(() => { display: grid; place-items: center; backdrop-filter: blur(8px); - transition: opacity 0.3s ease; + opacity: 0; + transition: opacity 0.2s ease; isolation: isolate; } @@ -225,8 +226,9 @@ onUnmounted(() => { border-radius: 12px; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); overflow: hidden; - transform: scale(0.98); - transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); + opacity: 0; + transform: scale(0.95); + transition: all 0.2s ease; z-index: v-bind('zIndex + 1'); } @@ -405,20 +407,22 @@ onUnmounted(() => { } /* 过渡动画 */ -.wechat-modal-enter-active { - animation: fadeIn 0.3s ease; -} - -.wechat-modal-leave-active { - animation: fadeOut 0.3s ease; +.wechat-modal-enter-active .wechat-modal-mask { + opacity: 1; } .wechat-modal-enter-active .wechat-modal-container { - animation: scaleUp 0.3s cubic-bezier(0.4, 0, 0.2, 1); + opacity: 1; + transform: scale(1); +} + +.wechat-modal-leave-active .wechat-modal-mask { + opacity: 0; } .wechat-modal-leave-active .wechat-modal-container { - animation: scaleDown 0.3s cubic-bezier(0.4, 0, 0.2, 1); + opacity: 0; + transform: scale(0.95); } /* 响应式布局 */ @@ -448,17 +452,12 @@ onUnmounted(() => { /* 减少运动偏好设置 */ @media (prefers-reduced-motion: reduce) { - .wechat-modal-enter-active, - .wechat-modal-leave-active, - .wechat-modal-enter-active .wechat-modal-container, - .wechat-modal-leave-active .wechat-modal-container, - .wechat-modal-container, .wechat-modal-mask, + .wechat-modal-container, .qr-code-image, .scan-animation, .loader-spinner { transition: none !important; - animation: none !important; } } \ No newline at end of file