From 712829ad8ebf0628ff035fc3a384074aa3d7d33f Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 8 Sep 2025 21:50:37 +0200 Subject: [PATCH] Add profile pictures and improve modal animations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add ProfilePicture component with fallback to user initials - Integrate profile pictures in dashboard recent activity dialog layout - Add profile pictures to payments list and split details - Fix modal animation overshoot by using fixed positioning and smooth slide-in - Add fade-in animation for modal content with proper sequencing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/components/PaymentModal.svelte | 18 +- src/lib/components/ProfilePicture.svelte | 66 +++++++ src/routes/cospend/+layout.svelte | 47 +++-- src/routes/cospend/+page.svelte | 161 +++++++++++++----- src/routes/cospend/payments/+page.svelte | 21 ++- .../cospend/payments/view/[id]/+page.svelte | 18 +- 6 files changed, 263 insertions(+), 68 deletions(-) create mode 100644 src/lib/components/ProfilePicture.svelte diff --git a/src/lib/components/PaymentModal.svelte b/src/lib/components/PaymentModal.svelte index ada3d92..1830113 100644 --- a/src/lib/components/PaymentModal.svelte +++ b/src/lib/components/PaymentModal.svelte @@ -2,6 +2,7 @@ import { onMount, createEventDispatcher } from 'svelte'; import { goto } from '$app/navigation'; import { page } from '$app/stores'; + import ProfilePicture from './ProfilePicture.svelte'; export let paymentId; @@ -150,10 +151,13 @@ {#each payment.splits as split}
- {split.username} - {#if split.username === session?.user?.nickname} - You - {/if} + +
0}> {#if split.amount > 0} @@ -362,6 +366,12 @@ gap: 0.5rem; } + .split-user .user-info { + display: flex; + align-items: center; + gap: 0.5rem; + } + .username { font-weight: 500; color: #333; diff --git a/src/lib/components/ProfilePicture.svelte b/src/lib/components/ProfilePicture.svelte new file mode 100644 index 0000000..752a897 --- /dev/null +++ b/src/lib/components/ProfilePicture.svelte @@ -0,0 +1,66 @@ + + +
+ {#if !imageError} + {altText} + {:else} +
+ {getInitials(username)} +
+ {/if} +
+ + diff --git a/src/routes/cospend/+layout.svelte b/src/routes/cospend/+layout.svelte index 03fd8de..88a7120 100644 --- a/src/routes/cospend/+layout.svelte +++ b/src/routes/cospend/+layout.svelte @@ -38,38 +38,63 @@
- {#if showModal} -
- showModal = false} /> -
- {/if} +
+ {#if showModal} + + {/if} +