From 813c322249b70017285fbdc4bc3516f94da84140 Mon Sep 17 00:00:00 2001 From: cnliucheng Date: Wed, 8 Jul 2026 11:38:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20ui-btn=20=E6=8C=89=E4=B8=8B=E6=B6=9F?= =?UTF-8?q?=E6=BC=AA=E6=95=88=E6=9E=9C=20(=E7=99=BD=E8=89=B2/=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=89=B2=E5=BE=84=E5=90=91=E6=89=A9=E6=95=A3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ui-btn/ui-btn.wxss | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/components/ui-btn/ui-btn.wxss b/components/ui-btn/ui-btn.wxss index e1420ca..df087af 100644 --- a/components/ui-btn/ui-btn.wxss +++ b/components/ui-btn/ui-btn.wxss @@ -9,6 +9,8 @@ border-radius: 48rpx; line-height: 1; box-sizing: border-box; + position: relative; + overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; } @@ -90,3 +92,36 @@ .ui-btn__text { white-space: nowrap; } + +/* ---- ripple effect ---- */ +.ui-btn::before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + width: 0; + height: 0; + border-radius: 50%; + background: rgba(255, 255, 255, 0.35); + transform: translate(-50%, -50%); + transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease; + opacity: 0; + pointer-events: none; +} + +.ui-btn--primary::before, +.ui-btn--ghost::before { + background: rgba(255, 255, 255, 0.4); +} + +.ui-btn--outline::before, +.ui-btn--danger::before { + background: rgba(var(--primary-rgb, 255, 107, 53), 0.15); +} + +.ui-btn:active::before { + width: 400rpx; + height: 400rpx; + opacity: 1; + transition: 0s; +}