From f900d4217dc497219d306e06db7c31efc7ad478e Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 16 Feb 2026 13:53:48 +0100 Subject: [PATCH] recipes: Swissmilk-inspired hero redesign with parallax and card refresh - Full-bleed hero image with CSS parallax (scaleY technique matching TitleImgParallax) - Hero picks random seasonal recipe with hashed image on each visit - Left-aligned title, subheading, and featured recipe link over the hero - Category chips with ellipsis collapse on small screens (<600px) - Search bar anchored to hero/grid boundary regardless of chip count - CompactCard redesign: 3/2 aspect ratio, rounded corners, subtle hover zoom - Search component margin adjusted to sit flush at hero boundary --- src/lib/components/recipes/CompactCard.svelte | 134 +++++ src/lib/components/recipes/Search.svelte | 8 +- .../[recipeLang=recipeLang]/+page.svelte | 498 +++++++++++++++--- 3 files changed, 562 insertions(+), 78 deletions(-) create mode 100644 src/lib/components/recipes/CompactCard.svelte diff --git a/src/lib/components/recipes/CompactCard.svelte b/src/lib/components/recipes/CompactCard.svelte new file mode 100644 index 0000000..9adf31c --- /dev/null +++ b/src/lib/components/recipes/CompactCard.svelte @@ -0,0 +1,134 @@ + + + +
+ + {#if showFavoriteIndicator && isFavorite} + ❤️ + {/if} +
+ {img_alt} +
+
+ {#if isInSeason} + {recipe.icon} + {/if} +

{@html recipe.name}

+ {#if recipe.tags?.length} +
+ {#each recipe.tags as tag (tag)} + {tag} + {/each} +
+ {/if} +
+
diff --git a/src/lib/components/recipes/Search.svelte b/src/lib/components/recipes/Search.svelte index 79a98c8..48eedaf 100644 --- a/src/lib/components/recipes/Search.svelte +++ b/src/lib/components/recipes/Search.svelte @@ -319,15 +319,15 @@ input::placeholder{ } .search { - width: 500px; - max-width: 85vw; + width: 560px; + max-width: 88vw; position: relative; - margin: 2.5rem auto 1.2rem; + margin: 0 auto; font-size: 1.6rem; display: flex; align-items: center; transition: var(--transition-fast); - filter: drop-shadow(0.4em 0.5em 0.4em rgba(0,0,0,0.4)) + filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25)); } .search:hover, diff --git a/src/routes/[recipeLang=recipeLang]/+page.svelte b/src/routes/[recipeLang=recipeLang]/+page.svelte index e341e3c..84126d1 100644 --- a/src/routes/[recipeLang=recipeLang]/+page.svelte +++ b/src/routes/[recipeLang=recipeLang]/+page.svelte @@ -1,20 +1,18 @@ + {labels.metaTitle} @@ -97,42 +362,127 @@ h1{ -

{labels.title}

-

{labels.subheading}

+{#if heroRecipe} +
+
+ +
+
- +
+
+

{labels.title}

+

{labels.subheading}

+ + {heroRecipe.icon} + {@html heroRecipe.name} + + -{#if seasonRecipes.length > 0} - - {#snippet children()} - - {#each seasonRecipes as recipe} - - {/each} - - {/snippet} - -{/if} +
+
+ -{#each categories as category, index} - {@const categoryRecipes = filteredRecipesByCategory.get(category) || []} - {#if categoryRecipes.length > 0} - - {#snippet children()} - - {#each categoryRecipes as recipe} - - {/each} - - {/snippet} - + {#if data.season.length > 0} + + {/if} + + {#each categories as cat (cat)} + {@const count = categoryCounts.get(cat) || 0} + {#if count > 0} + + {/if} + {/each} +
+ +
+ +
+ +
+
+ +
+
+ {#each visibleRecipes as recipe, i (recipe._id)} + + {/each} +
+ + {#if hasMore} +
+ {/if} + + {#if !isEnglish} + + {/if} +
+
+
+{:else} +
+

{labels.title}

+

{labels.subheading}

+
+ + +
+ {#each visibleRecipes as recipe, i (recipe._id)} + + {/each} +
+ + {#if hasMore} +
+ {/if} + + {#if !isEnglish} + {/if} -{/each} -{#if !isEnglish} - {/if}