Files
JoyD/Claw/client/wechat_app/components/user-avatar/user-avatar.wxss
2026-03-16 15:47:55 +08:00

143 lines
2.2 KiB
Plaintext

/* 用户头像组件样式 */
.user-avatar {
position: relative;
display: inline-block;
overflow: hidden;
}
/* 尺寸样式 */
.user-avatar.small {
width: 60rpx;
height: 60rpx;
}
.user-avatar.medium {
width: 80rpx;
height: 80rpx;
}
.user-avatar.large {
width: 120rpx;
height: 120rpx;
}
.user-avatar.xlarge {
width: 160rpx;
height: 160rpx;
}
/* 形状样式 */
.user-avatar.circle {
border-radius: 50%;
}
.user-avatar.rounded {
border-radius: 10rpx;
}
.user-avatar.square {
border-radius: 0;
}
/* 头像图片 */
.avatar-image {
width: 100%;
height: 100%;
display: block;
}
/* 在线状态指示器 */
.status-indicator {
position: absolute;
bottom: 0;
right: 0;
width: 20rpx;
height: 20rpx;
border-radius: 50%;
border: 4rpx solid white;
z-index: 1;
}
.status-indicator.online {
background-color: #07c160;
}
.status-indicator.offline {
background-color: #999;
}
.status-indicator.busy {
background-color: #f0ad4e;
}
.status-indicator.away {
background-color: #10aeff;
}
/* 徽章 */
.badge {
position: absolute;
top: -10rpx;
right: -10rpx;
background-color: #dd524d;
color: white;
border-radius: 50%;
min-width: 32rpx;
height: 32rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 20rpx;
font-weight: bold;
padding: 0 8rpx;
z-index: 2;
}
.badge-text {
font-size: 20rpx;
line-height: 1;
}
/* 加载遮罩 */
.loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(255, 255, 255, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 3;
}
.loading-spinner {
width: 40rpx;
height: 40rpx;
border: 4rpx solid #f3f3f3;
border-top: 4rpx solid #07c160;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* 默认头像样式 */
.user-avatar::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, #07c160 0%, #06a050 100%);
z-index: -1;
}
.user-avatar.error::before {
background: linear-gradient(135deg, #dd524d 0%, #c82333 100%);
}