From 3773b3c1ed572a7a7558e7fc37e0290dbf4bd308 Mon Sep 17 00:00:00 2001 From: mukeshs Date: Fri, 25 Sep 2026 11:12:15 +0530 Subject: [PATCH] Event Detail page --- src/components/Gallery.tsx | 56 ++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/src/components/Gallery.tsx b/src/components/Gallery.tsx index 9e18b63..7a38b11 100644 --- a/src/components/Gallery.tsx +++ b/src/components/Gallery.tsx @@ -7,11 +7,33 @@ import Reveal from "./Reveal"; import EmptyNote from "./EmptyNote"; import type { GalleryPhoto } from "@/lib/content"; -const CARD = - "relative h-52 w-72 shrink-0 sm:h-64 sm:w-[25rem] [perspective:1200px] cursor-pointer text-left outline-none"; +const CARD_BASE = "relative [perspective:1200px] cursor-pointer text-left outline-none"; +/** strip = fixed size for the scrolling row; grid = fills its grid cell at a 4:3 ratio. */ +const CARD_SIZE = { + strip: "h-56 w-[18rem] shrink-0 sm:h-64 sm:w-[22rem]", + grid: "w-full aspect-[4/3]", +} as const; + +/** Still row (4 or fewer photos): one row on desktop, sized so it never wraps. */ +const GRID_LAYOUT: Record = { + 1: "max-w-md grid-cols-1", + 2: "max-w-4xl grid-cols-1 sm:grid-cols-2", + 3: "max-w-6xl grid-cols-1 sm:grid-cols-2 lg:grid-cols-3", + 4: "max-w-7xl grid-cols-1 sm:grid-cols-2 lg:grid-cols-4", +}; /** One photo card: photo on the front, details on the back (flips on hover). Click opens the viewer. */ -function FlipCard({ photo, onOpen, hidden }: { photo: GalleryPhoto; onOpen: () => void; hidden?: boolean }) { +function FlipCard({ + photo, + onOpen, + hidden, + size = "strip", +}: { + photo: GalleryPhoto; + onOpen: () => void; + hidden?: boolean; + size?: keyof typeof CARD_SIZE; +}) { const hasDetails = Boolean(photo.alt || photo.description || photo.date); return (