232 lines
5.4 KiB
CSS
232 lines
5.4 KiB
CSS
/* 个人中心页面样式 */
|
|
|
|
/* 头像上传相关CSS */
|
|
.avatar-upload {
|
|
position: relative !important;
|
|
display: inline-block !important;
|
|
width: 120px !important;
|
|
height: 120px !important;
|
|
overflow: hidden !important;
|
|
}
|
|
|
|
/* 强制限制头像尺寸 - 多重选择器确保优先级 */
|
|
.avatar-preview,
|
|
#avatarPreview,
|
|
.avatar-upload .avatar-preview,
|
|
.avatar-upload #avatarPreview {
|
|
width: 120px !important;
|
|
height: 120px !important;
|
|
border-radius: 50% !important;
|
|
border: 3px solid #ddd !important;
|
|
object-fit: cover !important;
|
|
cursor: pointer !important;
|
|
transition: all 0.3s ease !important;
|
|
display: block !important;
|
|
max-width: 120px !important;
|
|
max-height: 120px !important;
|
|
min-width: 120px !important;
|
|
min-height: 120px !important;
|
|
}
|
|
|
|
.avatar-preview:hover,
|
|
#avatarPreview:hover {
|
|
border-color: #007bff !important;
|
|
transform: scale(1.05) !important;
|
|
}
|
|
|
|
.avatar-placeholder {
|
|
width: 120px !important;
|
|
height: 120px !important;
|
|
border-radius: 50% !important;
|
|
border: 3px dashed #ddd !important;
|
|
display: flex !important;
|
|
align-items: center !important;
|
|
justify-content: center !important;
|
|
cursor: pointer !important;
|
|
transition: all 0.3s ease !important;
|
|
background-color: #f8f9fa !important;
|
|
}
|
|
|
|
.avatar-placeholder:hover {
|
|
border-color: #007bff !important;
|
|
background-color: #e3f2fd !important;
|
|
}
|
|
|
|
.upload-overlay {
|
|
position: absolute !important;
|
|
top: 0 !important;
|
|
left: 0 !important;
|
|
width: 120px !important;
|
|
height: 120px !important;
|
|
border-radius: 50% !important;
|
|
background: rgba(0, 0, 0, 0.5) !important;
|
|
display: flex !important;
|
|
align-items: center !important;
|
|
justify-content: center !important;
|
|
opacity: 0 !important;
|
|
transition: opacity 0.3s ease !important;
|
|
cursor: pointer !important;
|
|
}
|
|
|
|
.avatar-upload:hover .upload-overlay {
|
|
opacity: 1 !important;
|
|
}
|
|
|
|
.upload-progress {
|
|
display: none !important;
|
|
margin-top: 10px !important;
|
|
}
|
|
|
|
.upload-progress.show {
|
|
display: block !important;
|
|
}
|
|
|
|
/* 图片预览模态框样式 */
|
|
.image-preview-modal .modal-dialog {
|
|
max-width: 500px !important;
|
|
margin: 1.75rem auto !important;
|
|
display: flex !important;
|
|
align-items: center !important;
|
|
min-height: calc(100% - 3.5rem) !important;
|
|
}
|
|
|
|
.image-preview-modal .modal-content {
|
|
max-height: 90vh !important;
|
|
display: flex !important;
|
|
flex-direction: column !important;
|
|
}
|
|
|
|
.image-preview-modal .modal-body {
|
|
overflow-y: auto !important;
|
|
}
|
|
|
|
.preview-container {
|
|
background: #f8f9fa !important;
|
|
border-radius: 12px !important;
|
|
padding: 30px !important;
|
|
text-align: center !important;
|
|
}
|
|
|
|
.preview-image-wrapper {
|
|
position: relative !important;
|
|
display: block !important;
|
|
margin-bottom: 20px !important;
|
|
max-width: 100% !important;
|
|
}
|
|
|
|
/* 强制限制预览图片大小 */
|
|
.preview-image,
|
|
#previewImage,
|
|
.preview-image-wrapper .preview-image,
|
|
.preview-image-wrapper #previewImage {
|
|
max-width: 280px !important;
|
|
max-height: 280px !important;
|
|
width: auto !important;
|
|
height: auto !important;
|
|
object-fit: contain !important;
|
|
border-radius: 12px !important;
|
|
box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
|
|
border: 3px solid #fff !important;
|
|
}
|
|
|
|
.preview-info {
|
|
background: #fff !important;
|
|
border-radius: 8px !important;
|
|
padding: 15px !important;
|
|
margin-top: 15px !important;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
|
|
}
|
|
|
|
.preview-stats {
|
|
display: flex !important;
|
|
justify-content: space-around !important;
|
|
margin-top: 10px !important;
|
|
}
|
|
|
|
.stat-item {
|
|
text-align: center !important;
|
|
}
|
|
|
|
.stat-value {
|
|
font-weight: bold !important;
|
|
color: #007bff !important;
|
|
font-size: 1.1em !important;
|
|
}
|
|
|
|
.stat-label {
|
|
font-size: 0.85em !important;
|
|
color: #6c757d !important;
|
|
margin-top: 2px !important;
|
|
}
|
|
|
|
/* 进度条样式 */
|
|
.upload-progress .progress {
|
|
height: 8px !important;
|
|
margin-bottom: 5px !important;
|
|
border-radius: 4px !important;
|
|
}
|
|
|
|
.upload-progress .progress-bar {
|
|
transition: width 0.3s ease !important;
|
|
border-radius: 4px !important;
|
|
}
|
|
|
|
/* 模态框动画 */
|
|
.modal.fade .modal-dialog {
|
|
transition: transform 0.3s ease-out !important;
|
|
transform: translate(0, -50px) !important;
|
|
}
|
|
|
|
.modal.show .modal-dialog {
|
|
transform: none !important;
|
|
}
|
|
|
|
/* 响应式设计 */
|
|
@media (max-width: 768px) {
|
|
.image-preview-modal .modal-dialog {
|
|
max-width: 95% !important;
|
|
margin: 10px auto !important;
|
|
}
|
|
|
|
.preview-image,
|
|
#previewImage {
|
|
max-width: 250px !important;
|
|
max-height: 250px !important;
|
|
}
|
|
|
|
.preview-container {
|
|
padding: 20px !important;
|
|
}
|
|
}
|
|
|
|
/* 大屏幕优化 */
|
|
@media (min-width: 1200px) {
|
|
.preview-image,
|
|
#previewImage {
|
|
max-width: 300px !important;
|
|
max-height: 300px !important;
|
|
}
|
|
}
|
|
|
|
/* 终极覆盖规则 - 确保所有情况下样式都生效 */
|
|
img.avatar-preview,
|
|
img#avatarPreview {
|
|
width: 120px !important;
|
|
height: 120px !important;
|
|
border-radius: 50% !important;
|
|
object-fit: cover !important;
|
|
max-width: 120px !important;
|
|
max-height: 120px !important;
|
|
min-width: 120px !important;
|
|
min-height: 120px !important;
|
|
}
|
|
|
|
/* 防止任何外部样式影响 */
|
|
.col-md-4 .avatar-upload img,
|
|
.text-center .avatar-upload img {
|
|
width: 120px !important;
|
|
height: 120px !important;
|
|
border-radius: 50% !important;
|
|
object-fit: cover !important;
|
|
}
|