fix(user): move avatar upload to hover overlay

This commit is contained in:
2026-07-29 14:17:52 +08:00
parent 224691e709
commit eed75d9f15
4 changed files with 79 additions and 56 deletions
+71 -5
View File
@@ -136,24 +136,76 @@
}
.uc-header__avatar {
position: relative;
flex-shrink: 0;
width: 140px;
height: 140px;
border-radius: 6px;
}
/* 对齐 zibll: 140px, 6px 圆角 */
.uc-header__avatar img {
width: 140px;
height: 140px;
border-radius: 6px;
display: block;
box-sizing: border-box;
width: 100%;
height: 100%;
border-radius: inherit;
border: 4px solid var(--surface-1);
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
object-fit: cover;
transition: transform 0.2s ease;
}
.uc-header__avatar img:hover {
.uc-header__avatar-upload {
position: absolute;
inset: 0;
z-index: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 7px;
width: 100%;
padding: 0;
border: 0;
border-radius: inherit;
background: rgba(0, 0, 0, 0.52);
color: #fff;
font-size: 13px;
font-weight: 600;
line-height: 1;
cursor: pointer;
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease, visibility 0.2s ease;
}
.uc-header__avatar-upload i {
font-size: 22px;
}
.uc-header__avatar:hover .uc-header__avatar-upload,
.uc-header__avatar:focus-within .uc-header__avatar-upload {
opacity: 1;
visibility: visible;
}
.uc-header__avatar:hover img,
.uc-header__avatar:focus-within img {
transform: scale(1.03);
}
.uc-header__avatar-upload:focus-visible {
outline: 2px solid #fff;
outline-offset: -5px;
}
.uc-header__avatar-upload:disabled {
cursor: wait;
opacity: 1;
visibility: visible;
}
.uc-header__info {
flex: 1;
min-width: 0;
@@ -289,11 +341,25 @@
gap: 14px;
}
.uc-header__avatar img {
.uc-header__avatar {
width: 90px;
height: 90px;
}
.uc-header__avatar img {
width: 100%;
height: 100%;
}
.uc-header__avatar-upload {
gap: 5px;
font-size: 12px;
}
.uc-header__avatar-upload i {
font-size: 18px;
}
.uc-header__name {
font-size: 1.15rem;
}