All checks were successful
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
139 lines
7.1 KiB
TypeScript
139 lines
7.1 KiB
TypeScript
import Image from 'next/image'
|
|
import { notFound } from 'next/navigation'
|
|
import { BookLink } from '@/components/BookLink'
|
|
import { Footer } from '@/components/Footer'
|
|
import { Header } from '@/components/Header'
|
|
import Link from 'next/link'
|
|
import { getDict, isLocale } from '@/i18n'
|
|
import { loadContent } from '@/lib/content'
|
|
import { buildHomeModel, bookUrl, emailLinkHtml, type Card } from '@/lib/home-model'
|
|
|
|
export const dynamic = 'force-dynamic'
|
|
|
|
function Cards({ items }: { items: Card[] }) {
|
|
return (
|
|
<ul className="grid gap-px border border-line bg-line sm:grid-cols-2 lg:grid-cols-3">
|
|
{items.map((c) => (
|
|
<li key={c.title} className="bg-paper p-7 sm:p-9">
|
|
<h3 className="font-serif text-2xl leading-snug">{c.title}</h3>
|
|
{c.text && <p className="mt-4 text-muted">{c.text}</p>}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
)
|
|
}
|
|
|
|
const Section = ({ id, title, children }: { id: string; title: string; children: React.ReactNode }) => (
|
|
<section id={id} className="mx-auto max-w-6xl scroll-mt-8 px-5 py-20 sm:px-8 md:py-28">
|
|
<h2 className="reveal mb-10 font-serif text-3xl text-burgundy sm:text-4xl">{title}</h2>
|
|
{children}
|
|
</section>
|
|
)
|
|
|
|
export default async function Home({ params }: { params: Promise<{ locale: string }> }) {
|
|
const { locale } = await params
|
|
if (!isLocale(locale)) notFound()
|
|
const t = getDict(locale)
|
|
const { home, news } = await loadContent(locale)
|
|
const m = buildHomeModel(home, news, t)
|
|
const fmt = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'long', year: 'numeric' })
|
|
|
|
return (
|
|
<>
|
|
<Header t={t} locale={locale} showProjects={true} showNews={m.news.length > 0} />
|
|
<main>
|
|
<section className="relative flex min-h-[88svh] items-center overflow-hidden border-b border-line"
|
|
style={{ background: 'radial-gradient(ellipse at 85% 10%, rgba(122,31,43,0.16), transparent 55%), linear-gradient(180deg, #f7f5f2, #efebe6)' }}>
|
|
<svg aria-hidden viewBox="0 0 200 200" fill="none" stroke="#7a1f2b"
|
|
className="pointer-events-none absolute -right-24 top-1/2 hidden h-[42rem] w-[42rem] -translate-y-1/2 opacity-[0.14] sm:block">
|
|
{[96, 80, 64, 48, 32, 16].map((r) => <circle key={r} cx="100" cy="100" r={r} strokeWidth="0.8" />)}
|
|
{Array.from({ length: 12 }, (_, i) => (
|
|
<path key={i} d="M100 4 C112 36 112 64 100 100 C88 64 88 36 100 4Z" strokeWidth="0.8" transform={`rotate(${i * 30} 100 100)`} />
|
|
))}
|
|
</svg>
|
|
<div className="relative mx-auto w-full max-w-6xl px-5 pb-16 pt-36 sm:px-8 md:pb-24">
|
|
<div className="reveal mb-8 h-1 w-20 bg-burgundy" aria-hidden />
|
|
<h1 className="reveal max-w-5xl font-serif text-[clamp(2.4rem,8vw,6.5rem)] font-semibold leading-[1.05] tracking-tight text-graphite">{t.motto}</h1>
|
|
<p className="reveal reveal-2 mt-8 max-w-2xl text-lg font-medium leading-relaxed text-graphite sm:text-xl">{t.heroLead}</p>
|
|
<a href="#directions" className="reveal reveal-3 mt-10 inline-block bg-burgundy px-8 py-3 font-medium text-white transition hover:bg-graphite">
|
|
{t.nav.directions}
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
<Section id="mission" title={t.mission.title}>
|
|
<p className="max-w-3xl font-serif text-2xl leading-relaxed sm:text-3xl">{m.mission.text}</p>
|
|
</Section>
|
|
|
|
<Section id="directions" title={t.directions.title}>
|
|
<Cards items={m.directions} />
|
|
</Section>
|
|
|
|
<Section id="projects" title={t.projects.title}>
|
|
<article className="grid gap-8 border border-line p-6 sm:p-10 md:grid-cols-[1fr_2fr]">
|
|
<div className="space-y-5">
|
|
<Link href={`/${locale}/projects/ermek-serkebayev`}>
|
|
<Image src="/books/serkebayev/cover.jpg" alt={t.book.cover} width={677} height={1000} sizes="(min-width: 768px) 320px, 100vw" className="h-auto w-full" />
|
|
</Link>
|
|
</div>
|
|
<div className="min-w-0">
|
|
<p className="mb-3 text-muted">{t.book.author}</p>
|
|
<h3 className="font-serif text-2xl leading-snug sm:text-3xl">{t.book.title}</h3>
|
|
{t.book.paragraphs.map((text) => <p key={text} className="mt-5 text-muted">{text}</p>)}
|
|
<p className="mt-6">{t.book.organiser}</p>
|
|
{t.book.translationReview && <p className="mt-4 text-sm">{t.book.translationReview}</p>}
|
|
<Link href={`/${locale}/projects/ermek-serkebayev`} className="mt-6 mr-6 inline-block underline underline-offset-4">{t.projects.more}</Link>
|
|
<BookLink url={bookUrl} t={t.book} />
|
|
</div>
|
|
</article>
|
|
{m.projects.length > 0 && <div className="mt-8"><Cards items={m.projects} /></div>}
|
|
</Section>
|
|
|
|
{m.news.length > 0 && (
|
|
<Section id="news" title={t.news.title}>
|
|
<ul className="divide-y divide-line border-y border-line">
|
|
{m.news.map((n) => (
|
|
<li key={n.id} className="grid gap-2 py-7 md:grid-cols-[14rem_1fr] md:gap-10">
|
|
<div className="text-sm text-muted">
|
|
<time dateTime={n.date}>{fmt.format(new Date(n.date))}</time>
|
|
<div className="mt-1 text-burgundy">{n.kind === 'event' ? t.news.event : t.news.news}</div>
|
|
</div>
|
|
<div>
|
|
<h3 className="font-serif text-2xl">{n.title}</h3>
|
|
{n.summary && <p className="mt-2 text-muted">{n.summary}</p>}
|
|
{n.place && <p className="mt-2 text-sm text-muted">{n.place}</p>}
|
|
</div>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
</Section>
|
|
)}
|
|
|
|
<section id="collaboration" className="bg-graphite text-paper">
|
|
<div className="mx-auto max-w-6xl px-5 py-20 sm:px-8 md:py-28">
|
|
<h2 className="font-serif text-3xl sm:text-5xl">{t.collaboration.title}</h2>
|
|
<p className="mt-8 max-w-2xl text-lg text-paper/75">{m.collaboration.text}</p>
|
|
<p className="mt-10">
|
|
{m.collaboration.email && (
|
|
<span dangerouslySetInnerHTML={{ __html: emailLinkHtml(m.collaboration.email, 'inline-block max-w-full break-all border border-paper/60 px-5 py-3 transition hover:bg-paper hover:text-graphite') }} />
|
|
)}
|
|
</p>
|
|
<a href="https://www.instagram.com/serkebayev_book/" className="mt-6 inline-flex min-h-11 items-center gap-3 underline underline-offset-4 hover:text-paper/75">
|
|
<svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.7" className="h-6 w-6 shrink-0">
|
|
<rect x="3" y="3" width="18" height="18" rx="5" />
|
|
<circle cx="12" cy="12" r="4" />
|
|
<circle cx="17.5" cy="6.5" r="1" fill="currentColor" stroke="none" />
|
|
</svg>
|
|
{t.collaboration.instagram}
|
|
</a>
|
|
<p className="mt-6 text-sm text-paper/70">
|
|
<Link href={`/${locale}/privacy`} className="underline underline-offset-4 hover:text-paper">{t.legal.privacy.title}</Link>
|
|
</p>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
<Footer t={t} locale={locale} />
|
|
</>
|
|
)
|
|
}
|