From 9800be01474cb698942ce174c6f2dda8dce45a0f Mon Sep 17 00:00:00 2001 From: Zias van Nes Date: Tue, 4 Nov 2025 12:09:05 +0100 Subject: [PATCH] fix:Adjust media layout, sizing, and mobile sheet Render media container only when media exists and remove the no-media placeholder. Constrain images and videos with a max-height of 600px (height:auto) and set images to display:block. In preview, use object-fit: contain for media images and reduce mobile sheet height from 80vh to 50vh. --- src/lib/components/FindCard.svelte | 43 +++++++-------------------- src/lib/components/FindPreview.svelte | 4 +-- 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/src/lib/components/FindCard.svelte b/src/lib/components/FindCard.svelte index 4d52530..cb1fc3f 100644 --- a/src/lib/components/FindCard.svelte +++ b/src/lib/components/FindCard.svelte @@ -101,8 +101,8 @@ -
- {#if media && media.length > 0} + {#if media && media.length > 0} +
{#if media[0].type === 'photo'} {/if} - {:else} -
- - - - -
- {/if} -
+
+ {/if}
@@ -258,33 +245,23 @@ /* Media */ .post-media { width: 100%; - aspect-ratio: 16/10; + max-height: 600px; overflow: hidden; background: hsl(var(--muted)); - display: flex; - align-items: center; - justify-content: center; } .media-image { width: 100%; - height: 100%; + height: auto; + max-height: 600px; object-fit: cover; + display: block; } :global(.media-video) { width: 100%; - height: 100%; - } - - .no-media { - width: 100%; - height: 100%; - display: flex; - align-items: center; - justify-content: center; - color: hsl(var(--muted-foreground)); - opacity: 0.5; + height: auto; + max-height: 600px; } /* Post Actions */ diff --git a/src/lib/components/FindPreview.svelte b/src/lib/components/FindPreview.svelte index d0b80ad..737651d 100644 --- a/src/lib/components/FindPreview.svelte +++ b/src/lib/components/FindPreview.svelte @@ -278,7 +278,7 @@ /* Mobile styles (bottom sheet) */ @media (max-width: 767px) { :global(.sheet-content) { - height: 80vh !important; + height: 50vh !important; border-radius: 16px 16px 0 0 !important; } } @@ -414,7 +414,7 @@ .media-image { width: 100%; height: 100%; - object-fit: cover; + object-fit: contain; } :global(.media-video) {