feat: ui-btn 按下涟漪效果 (白色/主题色径向扩散)

This commit is contained in:
2026-07-08 11:38:01 +08:00
parent d192769dbe
commit 813c322249
+35
View File
@@ -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;
}