feat: add character avatars with upload and zoom functionality

- Add avatar upload with file picker dialog
- Display avatars in header, chat messages, and settings
- Implement clickable avatars with full-screen zoom modal
- Enable asset protocol for local file access in Tauri config
- Add tauri-plugin-dialog for native file selection
- Store avatars in ~/.config/claudia/avatars/
- Support PNG, JPG, JPEG, and WEBP formats
- Modal closes on overlay click or ESC key
This commit is contained in:
2025-10-13 18:49:34 -07:00
parent 6a8f1e0996
commit 90bbeb4468
7 changed files with 595 additions and 5 deletions

View File

@@ -84,6 +84,28 @@ body {
border-radius: 50%;
background: var(--bg-tertiary);
border: 1px solid var(--border);
background-size: cover;
background-position: center;
}
.avatar-circle-large {
width: 80px;
height: 80px;
border-radius: 50%;
background: var(--bg-tertiary);
border: 2px solid var(--border);
background-size: cover;
background-position: center;
}
.avatar-upload {
display: flex;
align-items: center;
gap: 12px;
}
.avatar-preview {
flex-shrink: 0;
}
#character-header-name {
@@ -730,6 +752,65 @@ body {
border: 1px solid rgba(239, 68, 68, 0.2);
}
/* Avatar Modal */
.avatar-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 10000;
display: flex;
align-items: center;
justify-content: center;
}
.avatar-modal-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
cursor: pointer;
}
.avatar-modal-content {
position: relative;
z-index: 1;
max-width: 90vw;
max-height: 90vh;
pointer-events: none;
}
.avatar-modal-content img {
max-width: 100%;
max-height: 90vh;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
object-fit: contain;
}
/* Make avatars clickable */
.avatar-circle,
.avatar-circle-large {
cursor: pointer;
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.avatar-circle:hover,
.avatar-circle-large:hover {
transform: scale(1.05);
box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.avatar-circle:active,
.avatar-circle-large:active {
transform: scale(0.95);
}
/* Responsive */
@media (max-width: 600px) {
.messages-list {