From c08f0a5d4a100c1f93168af9867d6c8fe037a36d Mon Sep 17 00:00:00 2001 From: June Date: Mon, 17 Nov 2025 15:45:15 +1300 Subject: [PATCH] Dont show image cycle buttons, optimise header method --- web/src/components/Header.astro | 30 +++++++++++++++---- web/src/components/detail/ImageCarousel.astro | 10 +++---- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/web/src/components/Header.astro b/web/src/components/Header.astro index 89595c5..a7cb544 100644 --- a/web/src/components/Header.astro +++ b/web/src/components/Header.astro @@ -1,15 +1,35 @@ +--- +const links = [ + { + txt: "new", + lnk: "/recipe/new" + }, + { + txt: "add", + lnk: "/recipe/import" + }, + { + txt: "tags", + lnk: "/tags" + }, + { + txt: "search", + lnk: "/search" + }, +] +---

Recipie

- 🥧
- new - add - - search + { + links.map(({txt, lnk}) => ( + {txt} + )) + }
\ No newline at end of file diff --git a/web/src/components/detail/ImageCarousel.astro b/web/src/components/detail/ImageCarousel.astro index 784bf16..05fa80b 100644 --- a/web/src/components/detail/ImageCarousel.astro +++ b/web/src/components/detail/ImageCarousel.astro @@ -11,12 +11,12 @@ const { class: className, images } = Astro.props const cap = links.length - 1; const img = document.getElementById('carousel-img') as HTMLImageElement; - if (cap == 0) { + if (cap > 0) { const b0 = document.getElementById('dec-button') const b1 = document.getElementById('inc-button') - b0!.hidden = true - b1!.hidden = true + b0!.hidden = false + b1!.hidden = false } function inc() { @@ -39,9 +39,9 @@ const { class: className, images } = Astro.props
- + - +
\ No newline at end of file