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:
parent
326d124a60
commit
8999e63cbf
4 changed files with 99 additions and 63 deletions
|
|
@ -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) =>
|
||||||
<Link
|
model.image_path ? (
|
||||||
key={model.id}
|
<Link
|
||||||
to={`/fahrzeuge/${brandSlug}/${model.slug}`}
|
key={model.id}
|
||||||
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"
|
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"
|
||||||
{model.image_path && (
|
>
|
||||||
<img src={model.image_path} alt="" className="h-16 w-full object-contain" />
|
<img
|
||||||
)}
|
src={model.image_path}
|
||||||
<span style={fieldStyle(textStyles, `car_models.${model.id}.name`)}>{model.name}</span>
|
alt=""
|
||||||
</Link>
|
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
|
||||||
|
key={model.id}
|
||||||
|
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"
|
||||||
|
>
|
||||||
|
<span style={fieldStyle(textStyles, `car_models.${model.id}.name`)}>{model.name}</span>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -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) =>
|
||||||
<Link
|
brand.image_path ? (
|
||||||
key={brand.id}
|
<Link
|
||||||
to={`/fahrzeuge/${brand.slug}`}
|
key={brand.id}
|
||||||
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"
|
to={`/fahrzeuge/${brand.slug}`}
|
||||||
>
|
className="group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg"
|
||||||
{brand.image_path && (
|
>
|
||||||
<img src={brand.image_path} alt="" className="h-16 w-full object-contain" />
|
<img
|
||||||
)}
|
src={brand.image_path}
|
||||||
<span style={fieldStyle(textStyles, `brands.${brand.id}.name`)}>{brand.name}</span>
|
alt=""
|
||||||
</Link>
|
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
|
||||||
|
key={brand.id}
|
||||||
|
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"
|
||||||
|
>
|
||||||
|
<span style={fieldStyle(textStyles, `brands.${brand.id}.name`)}>{brand.name}</span>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue