Files
webb/src/components/sections/MediaShowcaseSection.tsx
T

103 lines
4.9 KiB
TypeScript

import Link from 'next/link';
import { ArrowRight, Image as ImageIcon, Play, Video } from 'lucide-react';
export interface MediaItem {
id: string;
type: 'video' | 'photo' | 'comparison' | 'banner';
title: string;
category: string;
badge?: string;
description: string;
videoUrl?: string;
poster?: string;
image?: string;
beforeUrl?: string;
afterUrl?: string;
link: string;
tag?: string;
}
interface MediaShowcaseProps {
title?: string;
badge?: string;
subtitle?: string;
items?: MediaItem[];
}
export function MediaShowcaseSection({
title = 'Visual Media & Transformation Reel',
badge = 'CURATED CREATIVE GALLERY',
subtitle = 'Explore high-resolution photography, video, and creative transformations produced by CRE neural tools.',
items = [],
}: MediaShowcaseProps) {
return (
<section className="relative overflow-hidden border-y border-slate-900/[0.08] bg-[#F5F2EB] py-16 sm:py-20 lg:py-24">
<div className="mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="mb-9 flex flex-col gap-4 border-b border-slate-900/[0.08] pb-7 sm:mb-12 sm:flex-row sm:items-end sm:justify-between">
<div className="max-w-2xl">
<p className="eyebrow">{badge}</p>
<h2 className="mt-3 text-3xl font-display font-bold tracking-tight text-slate-900 sm:text-4xl">{title}</h2>
<p className="mt-3 text-sm leading-relaxed text-slate-600 sm:text-base">{subtitle}</p>
</div>
<Link href="/#studio-suite" className="button-secondary shrink-0">
Explore the suite <ArrowRight className="h-4 w-4" />
</Link>
</div>
<div className="grid gap-5 md:grid-cols-3">
{items.map((item) => <MediaCard key={item.id} item={item} />)}
</div>
</div>
</section>
);
}
function MediaCard({ item }: { item: MediaItem }) {
const image = item.image || item.poster || item.beforeUrl;
return (
<article className="group overflow-hidden rounded-3xl border border-slate-900/[0.08] bg-white shadow-cream-sm transition-shadow duration-300 hover:shadow-cream-md">
<div className="relative aspect-[16/10] overflow-hidden bg-slate-100">
{item.type === 'video' && item.videoUrl ? (
<video controls preload="none" playsInline poster={item.poster} className="h-full w-full object-cover" aria-label={item.title}>
<source src={item.videoUrl} type="video/mp4" />
</video>
) : item.type === 'comparison' && item.beforeUrl && item.afterUrl ? (
<div className="grid h-full grid-cols-2">
<figure className="relative overflow-hidden border-r border-white/30">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={item.beforeUrl} alt="Original image" loading="lazy" decoding="async" className="h-full w-full object-cover" />
<figcaption className="media-label left-2">Before</figcaption>
</figure>
<figure className="relative overflow-hidden">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={item.afterUrl} alt="Enhanced image" loading="lazy" decoding="async" className="h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]" />
<figcaption className="media-label right-2">After</figcaption>
</figure>
</div>
) : image ? (
<>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={image} alt={item.title} loading="lazy" decoding="async" className="h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]" />
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/45 to-transparent" />
</>
) : null}
<span className="absolute left-3 top-3 inline-flex items-center gap-1.5 rounded-full bg-white/94 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-slate-700 shadow-sm">
{item.type === 'video' ? <Video className="h-3 w-3 text-blue-700" /> : <ImageIcon className="h-3 w-3 text-blue-700" />}
{item.category}
</span>
{item.type === 'video' && <Play className="pointer-events-none absolute bottom-3 right-3 h-8 w-8 rounded-full bg-white/90 p-2 text-slate-900 shadow-sm" />}
</div>
<div className="p-5">
{item.tag && <p className="text-xs font-semibold uppercase tracking-[0.12em] text-blue-700">{item.tag}</p>}
<h3 className="mt-2 text-xl font-display font-bold tracking-tight text-slate-900">{item.title}</h3>
<p className="mt-2 text-sm leading-relaxed text-slate-600">{item.description}</p>
<Link href={item.link} className="mt-5 inline-flex items-center gap-1.5 text-sm font-semibold text-blue-700 transition-transform hover:translate-x-0.5">
Open tool <ArrowRight className="h-4 w-4" />
</Link>
</div>
</article>
);
}