Files
test/utils/ui-config.wxss

374 lines
5.9 KiB
Plaintext
Raw Normal View History

2025-09-18 12:39:54 +08:00
/**
* 美容小程序UI配置
* 统一样式变量和组件样式增强
*/
/* 按钮样式增强 */
.btn {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 32rpx;
font-size: 28rpx;
font-weight: 600;
height: 80rpx;
line-height: 80rpx;
border-radius: 12rpx;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
overflow: hidden;
box-shadow: 0 2rpx 8rpx 0 rgba(0, 0, 0, 0.05);
}
.btn:active {
transform: translateY(2rpx);
box-shadow: 0 1rpx 3rpx 0 rgba(0, 0, 0, 0.08);
}
/* 主要按钮 */
.btn-primary {
background: linear-gradient(135deg, #FF7A3D 0%, #FF5F15 100%);
color: #fff;
border: none;
}
.btn-primary:active {
opacity: 0.9;
}
/* 次要按钮 */
.btn-secondary {
background: linear-gradient(135deg, #1AD57A 0%, #07C160 100%);
color: #fff;
border: none;
}
.btn-secondary:active {
opacity: 0.9;
}
/* 轮廓按钮 */
.btn-outline {
background: transparent;
border: 2rpx solid var(--primary-color);
color: var(--primary-color);
}
.btn-outline:active {
background-color: var(--primary-color-light);
}
/* 文本按钮 */
.btn-text {
background: transparent;
border: none;
color: var(--primary-color);
box-shadow: none;
}
.btn-text:active {
background-color: var(--primary-color-light);
}
/* 按钮尺寸 */
.btn-large {
height: 96rpx;
line-height: 96rpx;
font-size: 32rpx;
padding: 0 40rpx;
}
.btn-small {
height: 64rpx;
line-height: 64rpx;
font-size: 24rpx;
padding: 0 24rpx;
}
.btn-mini {
height: 56rpx;
line-height: 56rpx;
font-size: 20rpx;
padding: 0 16rpx;
}
/* 圆角按钮 */
.btn-round {
border-radius: 999rpx;
}
/* 块级按钮 */
.btn-block {
display: flex;
width: 100%;
}
/* 禁用状态 */
.btn-disabled {
opacity: 0.5;
cursor: not-allowed;
pointer-events: none;
}
/* 涟漪效果 */
.ripple {
position: relative;
overflow: hidden;
}
.ripple::after {
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
background-repeat: no-repeat;
background-position: 50%;
transform: scale(10, 10);
opacity: 0;
transition: transform 0.5s, opacity 0.8s;
}
.ripple:active::after {
transform: scale(0, 0);
opacity: 0.3;
transition: 0s;
}
/* 卡片样式 */
.card {
background-color: #fff;
border-radius: var(--radius-default);
padding: 30rpx;
margin-bottom: 20rpx;
box-shadow: var(--shadow-1);
transition: var(--transition-base);
}
.card:active {
transform: scale(0.98);
box-shadow: var(--shadow-2);
}
/* 标签样式 */
.tag {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
font-size: 24rpx;
border-radius: 6rpx;
margin-right: 12rpx;
}
.tag-primary {
background-color: var(--primary-color-light);
color: var(--primary-color);
}
.tag-secondary {
background-color: var(--secondary-color-light);
color: var(--secondary-color);
}
/* 徽章样式 */
.badge {
position: relative;
display: inline-block;
}
.badge-dot {
position: absolute;
top: -6rpx;
right: -6rpx;
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: var(--primary-color);
border: 2rpx solid #fff;
}
.badge-count {
position: absolute;
top: -16rpx;
right: -16rpx;
min-width: 32rpx;
height: 32rpx;
line-height: 32rpx;
border-radius: 16rpx;
background-color: var(--primary-color);
color: #fff;
font-size: 20rpx;
text-align: center;
padding: 0 8rpx;
border: 2rpx solid #fff;
}
/* 输入框样式 */
.input {
width: 100%;
height: 80rpx;
background-color: var(--gray-1);
border-radius: var(--radius-default);
padding: 0 24rpx;
font-size: 28rpx;
color: var(--gray-10);
transition: all 0.3s ease;
border: 2rpx solid transparent;
}
.input:focus {
border-color: var(--primary-color);
background-color: #fff;
}
/* 分割线 */
.divider {
width: 100%;
height: 2rpx;
background-color: var(--gray-2);
margin: 30rpx 0;
}
.divider-text {
position: relative;
text-align: center;
margin: 30rpx 0;
}
.divider-text::before,
.divider-text::after {
content: '';
position: absolute;
top: 50%;
width: calc(50% - 100rpx);
height: 2rpx;
background-color: var(--gray-2);
}
.divider-text::before {
left: 0;
}
.divider-text::after {
right: 0;
}
/* 列表样式 */
.list {
background-color: #fff;
border-radius: var(--radius-default);
overflow: hidden;
}
.list-item {
display: flex;
align-items: center;
padding: 30rpx;
border-bottom: 2rpx solid var(--gray-2);
transition: all 0.3s ease;
}
.list-item:last-child {
border-bottom: none;
}
.list-item:active {
background-color: var(--gray-1);
}
.list-item-content {
flex: 1;
}
.list-item-title {
font-size: 28rpx;
color: var(--gray-10);
margin-bottom: 6rpx;
}
.list-item-desc {
font-size: 24rpx;
color: var(--gray-7);
}
.list-item-extra {
margin-left: 20rpx;
}
/* 价格样式 */
.price {
color: var(--primary-color);
font-weight: bold;
}
.price-large {
font-size: 40rpx;
}
.price-small {
font-size: 24rpx;
}
/* 图片样式 */
.img-round {
border-radius: 50%;
}
.img-radius {
border-radius: var(--radius-default);
}
.img-shadow {
box-shadow: var(--shadow-1);
}
/* 动画效果 */
.fade-in {
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.slide-up {
animation: slideUp 0.3s ease;
}
@keyframes slideUp {
from {
transform: translateY(30rpx);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
/* 渐变背景 */
.gradient-primary {
background: linear-gradient(135deg, #FF7A3D 0%, #FF5F15 100%);
color: #fff;
}
.gradient-secondary {
background: linear-gradient(135deg, #1AD57A 0%, #07C160 100%);
color: #fff;
}
/* 文本渐变 */
.text-gradient {
background: linear-gradient(135deg, #FF7A3D 0%, #FF5F15 100%);
-webkit-background-clip: text;
color: transparent;
}