feat(user-avatar): users can now edit there image (image is taken from OIDC picture)

This commit is contained in:
Edouard Vanbelle
2026-05-26 00:50:38 +02:00
parent 8b6c8e345b
commit b0c5e7827e
43 changed files with 1563 additions and 250 deletions
+157
View File
@@ -776,3 +776,160 @@ body {
margin: 12px 0 8px;
line-height: 1.4;
}
/* ── Avatar photo ──────────────────────────────────────────────────────────── */
.avatar-large-wrap {
position: relative;
flex-shrink: 0;
}
/* Fill circle with photo when JS injects an <img> */
.avatar-large img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
display: block;
}
/* Pencil button that appears on hover (visible only for local accounts) */
.avatar-edit-btn {
position: absolute;
bottom: 2px;
right: 2px;
width: 28px;
height: 28px;
border-radius: 50%;
border: 2px solid var(--color-bg-surface);
background: var(--color-accent);
color: var(--color-sidebar-text-active);
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
cursor: pointer;
transition:
opacity 0.15s,
transform 0.15s;
}
.avatar-edit-btn:hover {
transform: scale(1.1);
}
/* OIDC note shown instead of edit button */
.avatar-oidc-note {
font-size: 12px;
color: var(--color-text-faint);
margin-top: 6px;
font-style: italic;
}
/* ── Photo edit panel ──────────────────────────────────────────────────────── */
.avatar-edit-panel {
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid var(--color-border);
}
.avatar-edit-tabs {
display: flex;
gap: 4px;
margin-bottom: 16px;
}
.avatar-tab {
padding: 6px 16px;
border: 1px solid var(--color-border);
border-radius: 20px;
background: none;
color: var(--color-text-subtle);
font-size: 13px;
cursor: pointer;
transition:
background 0.15s,
color 0.15s,
border-color 0.15s;
}
.avatar-tab.active {
background: var(--color-accent);
color: var(--color-sidebar-text-active);
border-color: var(--color-accent);
}
.avatar-tab-pane {
display: flex;
flex-direction: column;
gap: 8px;
}
.avatar-url-input {
width: 100%;
padding: 10px 14px;
border: 1px solid var(--color-border);
border-radius: 10px;
background: var(--color-bg-alt);
color: var(--color-text-dark);
font-size: 14px;
box-sizing: border-box;
}
.avatar-url-input:focus {
outline: none;
border-color: var(--color-accent);
box-shadow: 0 0 0 3px var(--color-accent-ring);
}
.avatar-hint {
font-size: 12px;
color: var(--color-text-faint);
}
/* Hidden file input — triggered via the label */
.avatar-file-input {
display: none;
}
.avatar-file-label {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 10px 20px;
border: 1px dashed var(--color-border);
border-radius: 10px;
background: var(--color-bg-alt);
color: var(--color-text-subtle);
font-size: 13px;
cursor: pointer;
transition:
border-color 0.15s,
color 0.15s;
}
.avatar-file-label:hover {
border-color: var(--color-accent);
color: var(--color-accent);
}
/* Live preview thumbnail (square, small) */
.avatar-preview {
width: 88px;
height: 88px;
border-radius: 50%;
object-fit: cover;
border: 2px solid var(--color-border);
}
.avatar-edit-actions {
display: flex;
gap: 8px;
flex-wrap: wrap;
margin-top: 16px;
}
#p-avatar-status {
margin-top: 12px;
}