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

@@ -135,6 +135,27 @@
/>
</div>
<div class="form-group">
<label for="character-avatar">Avatar (Optional)</label>
<div class="avatar-upload">
<div id="avatar-preview" class="avatar-preview">
<div class="avatar-circle-large"></div>
</div>
<input
type="file"
id="character-avatar"
accept="image/png,image/jpeg,image/jpg,image/webp"
style="display: none;"
/>
<button type="button" id="upload-avatar-btn" class="btn-secondary">
Choose Image
</button>
<button type="button" id="remove-avatar-btn" class="btn-secondary" style="display: none;">
Remove
</button>
</div>
</div>
<div class="form-group">
<label for="character-system-prompt">System Prompt</label>
<textarea
@@ -193,5 +214,13 @@
</div>
</footer>
</div>
<!-- Avatar zoom modal -->
<div id="avatar-modal" class="avatar-modal" style="display: none;">
<div class="avatar-modal-overlay"></div>
<div class="avatar-modal-content">
<img id="avatar-modal-img" src="" alt="Avatar" />
</div>
</div>
</body>
</html>