Files
PetCommunity/miniprogram/pages/nearby/nearby.wxss

403 lines
6.7 KiB
Plaintext

/* ── 附近页:Vital 风格工具页 ──
浅灰底 + 白卡,地图浮层全部实底白卡,动作按钮用强调黑 */
.nearby-page {
display: flex;
flex-direction: column;
height: 100vh;
background: #f1f2f6;
overflow: hidden;
}
/* 主导航栏:与胶囊等高,右侧避让胶囊 */
.navbar {
display: flex;
align-items: center;
padding-left: 28rpx;
flex-shrink: 0;
box-sizing: border-box;
}
/* 次级菜单栏:胶囊下方,全宽 */
.subbar {
display: flex;
align-items: center;
padding: 8rpx 28rpx 16rpx;
gap: 16rpx;
flex-shrink: 0;
}
/* logo:玻璃顶栏上的深色标题(颜色由 .glass-topbar 统一控制) */
.topbar-logo {
font-size: 46rpx;
font-weight: 700;
letter-spacing: -0.5rpx;
flex-shrink: 0;
}
/* 视图切换:灰底分段控件,激活为白色胶囊 */
.view-toggle {
flex: 1;
display: flex;
background: #e7e9ef;
border-radius: 999rpx;
padding: 6rpx;
gap: 4rpx;
}
.toggle-btn {
flex: 1;
text-align: center;
font-size: 24rpx;
font-weight: 600;
color: #6e7280;
padding: 12rpx 0;
border-radius: 999rpx;
transition: all 0.2s ease;
}
.toggle-active {
background: #ffffff;
color: #1b1b20;
font-weight: 700;
box-shadow: 0 8rpx 18rpx rgba(27, 27, 32, 0.08);
}
.topbar-btn {
width: 64rpx;
height: 64rpx;
border-radius: 26rpx;
background: #ffffff;
box-shadow: var(--shadow-soft);
display: flex;
align-items: center;
justify-content: center;
font-size: 28rpx;
color: #6e7280;
}
/* 地图 */
.map-wrap {
flex: 1;
position: relative;
overflow: hidden;
}
.map {
width: 100%;
height: 100%;
}
/* 地图控件 */
.map-controls {
position: absolute;
right: 24rpx;
bottom: 300rpx;
display: flex;
flex-direction: column;
gap: 14rpx;
z-index: 10;
}
.map-ctrl-btn {
width: 76rpx;
height: 76rpx;
background: #ffffff;
border-radius: 26rpx;
box-shadow: 0 12rpx 32rpx rgba(27, 27, 32, 0.12);
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
font-weight: 700;
color: #2b2b30;
}
/* 宠物弹窗 */
.pet-popup {
position: absolute;
bottom: 300rpx;
left: 50%;
transform: translateX(-50%);
background: #ffffff;
border-radius: 36rpx;
padding: 22rpx 26rpx;
display: flex;
align-items: center;
gap: 18rpx;
box-shadow: 0 20rpx 50rpx rgba(27, 27, 32, 0.14);
min-width: 520rpx;
z-index: 20;
}
.popup-avatar {
width: 72rpx;
height: 72rpx;
border-radius: 22rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
flex-shrink: 0;
}
.popup-info { flex: 1; }
.popup-name {
display: block;
font-size: 28rpx;
font-weight: 600;
color: #1b1b20;
}
.popup-sub {
display: block;
font-size: 22rpx;
color: #b9bdc6;
margin-top: 4rpx;
}
.popup-hi {
padding: 16rpx 24rpx;
font-size: 24rpx;
font-weight: 600;
border-radius: 999rpx;
flex-shrink: 0;
}
/* 在线数角标 */
.online-badge {
position: absolute;
top: 20rpx;
left: 20rpx;
background: #ffffff;
border-radius: 999rpx;
padding: 10rpx 22rpx;
font-size: 22rpx;
font-weight: 600;
color: #7563e0;
box-shadow: var(--shadow-soft);
z-index: 10;
}
/* 底部预览条 */
.map-preview-list {
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 15;
background: #ffffff;
border-top: 1rpx solid rgba(27, 27, 32, 0.06);
padding: 20rpx 0;
}
.preview-scroll {
white-space: nowrap;
padding: 0 24rpx;
}
.preview-card {
display: inline-flex;
align-items: center;
gap: 12rpx;
background: #f1f2f6;
border-radius: 26rpx;
padding: 14rpx 18rpx;
margin-right: 16rpx;
}
.preview-avatar {
width: 60rpx;
height: 60rpx;
border-radius: 18rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 30rpx;
flex-shrink: 0;
}
.preview-info {
display: flex;
flex-direction: column;
gap: 4rpx;
}
.preview-name {
font-size: 26rpx;
font-weight: 600;
color: #1b1b20;
}
.preview-dist {
font-size: 20rpx;
color: #7563e0;
font-weight: 600;
font-variant-numeric: tabular-nums;
}
/* 列表视图 */
.list-scroll {
flex: 1;
background: #f1f2f6;
}
.list-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 28rpx 28rpx 18rpx;
}
.list-title {
font-size: 32rpx;
font-weight: 700;
color: #1b1b20;
}
/* 在线数:淡紫静默胶囊 */
.online-chip {
font-size: 24rpx;
font-weight: 600;
color: #7563e0;
background: rgba(139, 124, 246, 0.12);
border-radius: 999rpx;
padding: 10rpx 22rpx;
}
/* 列表项:白卡 */
.nearby-item {
display: flex;
align-items: center;
gap: 18rpx;
background: #ffffff;
border-radius: 48rpx;
margin: 0 28rpx 20rpx;
padding: 22rpx;
box-shadow: var(--shadow-soft);
}
.nearby-avatar {
width: 92rpx;
height: 92rpx;
border-radius: 32rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 40rpx;
flex-shrink: 0;
}
.avatar-emoji { font-size: 40rpx; line-height: 1; }
.nearby-info { flex: 1; min-width: 0; }
.nearby-name-row {
display: flex;
align-items: center;
gap: 10rpx;
margin-bottom: 6rpx;
}
.nearby-pet-name {
font-size: 28rpx;
font-weight: 600;
color: #1b1b20;
}
.breed-chip {
font-size: 20rpx;
font-weight: 600;
color: #7563e0;
background: rgba(139, 124, 246, 0.12);
border-radius: 999rpx;
padding: 4rpx 14rpx;
}
.nearby-sub {
display: flex;
align-items: center;
gap: 8rpx;
font-size: 22rpx;
color: #b9bdc6;
}
.online-dot {
width: 14rpx;
height: 14rpx;
border-radius: 50%;
background: #4bbe9a;
flex-shrink: 0;
box-shadow: 0 0 0 4rpx rgba(75, 190, 154, 0.16);
}
.nearby-right {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 10rpx;
flex-shrink: 0;
}
.dist-text {
font-size: 22rpx;
font-weight: 600;
color: #7563e0;
font-variant-numeric: tabular-nums;
}
/* 打招呼:强调黑胶囊 */
.say-hi {
background: #2b2b30;
border-radius: 999rpx;
padding: 14rpx 26rpx;
font-size: 22rpx;
font-weight: 600;
color: #fff;
box-shadow: 0 12rpx 28rpx rgba(43, 43, 48, 0.24);
transition: transform 0.18s ease;
}
.say-hi:active {
transform: scale(0.94);
}
/* 骨架 */
.nearby-skeleton {
height: 128rpx;
background: linear-gradient(90deg, #ebecf1 25%, #e2e4ea 50%, #ebecf1 75%);
background-size: 200% 100%;
animation: shine 1.4s infinite;
border-radius: 40rpx;
margin: 0 28rpx 20rpx;
}
@keyframes shine {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* 空态 */
.empty-nearby {
display: flex;
flex-direction: column;
align-items: center;
padding: 120rpx 60rpx;
gap: 16rpx;
}
.empty-emoji { font-size: 80rpx; }
.empty-title {
font-size: 34rpx;
font-weight: 700;
color: #1b1b20;
}
.empty-desc {
font-size: 26rpx;
color: #b9bdc6;
text-align: center;
line-height: 1.6;
}