Files
soul/miniprogram/custom-tab-bar/index.wxss

228 lines
3.6 KiB
Plaintext
Raw Normal View History

/**
* Soul创业实验 - 自定义TabBar样式
* 实现中间突出的"找伙伴"按钮
*/
.tab-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100rpx;
background: rgba(28, 28, 30, 0.95);
backdrop-filter: blur(40rpx);
-webkit-backdrop-filter: blur(40rpx);
display: flex;
align-items: flex-end;
padding-bottom: env(safe-area-inset-bottom);
z-index: 999;
}
.tab-bar-border {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1rpx;
background: rgba(255, 255, 255, 0.05);
}
.tab-bar-item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10rpx 0 16rpx;
}
.icon-wrapper {
width: 48rpx;
height: 48rpx;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 4rpx;
}
.icon {
width: 44rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
}
.tab-bar-text {
font-size: 22rpx;
line-height: 1;
}
/* ===== 首页图标 ===== */
.icon-home {
position: relative;
width: 40rpx;
height: 40rpx;
}
.home-roof {
position: absolute;
top: 4rpx;
left: 50%;
transform: translateX(-50%);
width: 0;
height: 0;
border-left: 18rpx solid transparent;
border-right: 18rpx solid transparent;
border-bottom: 14rpx solid #8e8e93;
}
.home-body {
position: absolute;
bottom: 4rpx;
left: 50%;
transform: translateX(-50%);
width: 28rpx;
height: 18rpx;
background: #8e8e93;
border-radius: 0 0 4rpx 4rpx;
}
.icon-active .home-roof {
border-bottom-color: #00CED1;
}
.icon-active .home-body {
background: #00CED1;
}
/* ===== 目录图标 ===== */
.icon-list {
width: 36rpx;
height: 32rpx;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.list-line {
width: 100%;
height: 6rpx;
background: #8e8e93;
border-radius: 3rpx;
}
.list-line:nth-child(2) {
width: 75%;
}
.list-line:nth-child(3) {
width: 50%;
}
.icon-active .list-line {
background: #00CED1;
}
/* ===== 我的图标 ===== */
.icon-user {
position: relative;
width: 36rpx;
height: 40rpx;
}
.user-head {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 16rpx;
height: 16rpx;
background: #8e8e93;
border-radius: 50%;
}
.user-body {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 28rpx;
height: 18rpx;
background: #8e8e93;
border-radius: 14rpx 14rpx 0 0;
}
.icon-active .user-head,
.icon-active .user-body {
background: #00CED1;
}
/* ===== 找伙伴 - 中间特殊按钮 ===== */
.special-item {
position: relative;
margin-top: -32rpx;
}
.special-button {
width: 112rpx;
height: 112rpx;
border-radius: 50%;
background: linear-gradient(135deg, #00CED1 0%, #20B2AA 100%);
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 8rpx 32rpx rgba(0, 206, 209, 0.4);
margin-bottom: 4rpx;
transition: all 0.2s ease;
}
.special-button:active {
transform: scale(0.95);
}
.special-active {
box-shadow: 0 8rpx 40rpx rgba(0, 206, 209, 0.6);
}
.special-text {
margin-top: 4rpx;
}
/* ===== 找伙伴图标 (双人) ===== */
.icon-users {
position: relative;
width: 56rpx;
height: 44rpx;
}
.user-circle {
position: absolute;
width: 28rpx;
height: 28rpx;
border-radius: 50%;
background: #ffffff;
}
.user-circle::after {
content: '';
position: absolute;
bottom: -12rpx;
left: 50%;
transform: translateX(-50%);
width: 22rpx;
height: 14rpx;
background: #ffffff;
border-radius: 11rpx 11rpx 0 0;
}
.user-1 {
top: 0;
left: 0;
}
.user-2 {
top: 0;
right: 0;
}