Make brand/model images fill the whole card instead of a small inset thumbnail

Matches the existing gallery card treatment (GalleryOverview.jsx): when a
brand or model has an image, the card becomes a full-bleed aspect-[4/3]
photo with a dark gradient and the name overlaid at the bottom, instead of
a small contained thumbnail sitting above the name on a plain card. Cards
without an image are unchanged (same bordered box, centered name) - only
the image case changes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Maaxxs 2026-09-10 03:30:53 +02:00
parent 326d124a60
commit 8999e63cbf
4 changed files with 99 additions and 63 deletions

View file

@ -58,18 +58,36 @@ export default function BrandPage() {
)} )}
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3"> <div className="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3">
{data.models.map((model) => ( {data.models.map((model) =>
model.image_path ? (
<Link
key={model.id}
to={`/fahrzeuge/${brandSlug}/${model.slug}`}
className="group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg"
>
<img
src={model.image_path}
alt=""
className="h-full w-full object-cover transition duration-300 group-hover:scale-105"
/>
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95" />
<span
className="absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white"
style={fieldStyle(textStyles, `car_models.${model.id}.name`)}
>
{model.name}
</span>
</Link>
) : (
<Link <Link
key={model.id} key={model.id}
to={`/fahrzeuge/${brandSlug}/${model.slug}`} to={`/fahrzeuge/${brandSlug}/${model.slug}`}
className="flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100" className="flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100"
> >
{model.image_path && (
<img src={model.image_path} alt="" className="h-16 w-full object-contain" />
)}
<span style={fieldStyle(textStyles, `car_models.${model.id}.name`)}>{model.name}</span> <span style={fieldStyle(textStyles, `car_models.${model.id}.name`)}>{model.name}</span>
</Link> </Link>
))} )
)}
</div> </div>
</div> </div>
); );

View file

@ -45,18 +45,36 @@ export default function VehicleSelect() {
)} )}
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4"> <div className="grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4">
{brands.map((brand) => ( {brands.map((brand) =>
brand.image_path ? (
<Link
key={brand.id}
to={`/fahrzeuge/${brand.slug}`}
className="group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg"
>
<img
src={brand.image_path}
alt=""
className="h-full w-full object-cover transition duration-300 group-hover:scale-105"
/>
<div className="absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95" />
<span
className="absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white"
style={fieldStyle(textStyles, `brands.${brand.id}.name`)}
>
{brand.name}
</span>
</Link>
) : (
<Link <Link
key={brand.id} key={brand.id}
to={`/fahrzeuge/${brand.slug}`} to={`/fahrzeuge/${brand.slug}`}
className="flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100" className="flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100"
> >
{brand.image_path && (
<img src={brand.image_path} alt="" className="h-16 w-full object-contain" />
)}
<span style={fieldStyle(textStyles, `brands.${brand.id}.name`)}>{brand.name}</span> <span style={fieldStyle(textStyles, `brands.${brand.id}.name`)}>{brand.name}</span>
</Link> </Link>
))} )
)}
</div> </div>
</div> </div>
); );

File diff suppressed because one or more lines are too long

View file

@ -43,7 +43,7 @@
"sameAs": ["https://www.youtube.com/@hifiplanet2812"] "sameAs": ["https://www.youtube.com/@hifiplanet2812"]
} }
</script> </script>
<script type="module" crossorigin src="/assets/index-BVDYjPgo.js"></script> <script type="module" crossorigin src="/assets/index-C1bJ8U0C.js"></script>
<link rel="modulepreload" crossorigin href="/assets/lucide-icons-Cg2IxtAO.js"> <link rel="modulepreload" crossorigin href="/assets/lucide-icons-Cg2IxtAO.js">
<link rel="stylesheet" crossorigin href="/assets/index-lUKoqEad.css"> <link rel="stylesheet" crossorigin href="/assets/index-lUKoqEad.css">
</head> </head>