feat(ui): admin-only root link and shared header navigation
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-06 16:50:45 +01:00
parent 7a20cf5c75
commit ce63cd8b69
32 changed files with 1070 additions and 600 deletions
+21 -21
View File
@@ -50,46 +50,46 @@ export default function AboutPage({ params: { locale } }: AboutPageProps) {
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-10">
<h1 className="text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<h1 className="text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
<p className="mt-4 max-w-3xl text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg">
{copy.intro}
</p>
</section>
</MotionFade>
<MotionFade delay={0.05}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<h2 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8">
<h2 className="text-2xl font-semibold text-fg">
{copy.valuesTitle}
</h2>
<div className="mt-6 grid gap-4 md:grid-cols-3">
<article className="rounded-2xl border border-zinc-200 bg-zinc-50 p-5 dark:border-zinc-800 dark:bg-zinc-900">
<Compass className="h-5 w-5 text-zinc-700 dark:text-zinc-200" />
<h3 className="mt-3 text-lg font-semibold text-zinc-900 dark:text-zinc-100">
<article className="rounded-2xl border border-default bg-surface-soft p-5 ">
<Compass className="h-5 w-5 text-muted-strong" />
<h3 className="mt-3 text-lg font-semibold text-fg">
{copy.valueA}
</h3>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{copy.valueAText}
</p>
</article>
<article className="rounded-2xl border border-zinc-200 bg-zinc-50 p-5 dark:border-zinc-800 dark:bg-zinc-900">
<Layers3 className="h-5 w-5 text-zinc-700 dark:text-zinc-200" />
<h3 className="mt-3 text-lg font-semibold text-zinc-900 dark:text-zinc-100">
<article className="rounded-2xl border border-default bg-surface-soft p-5 ">
<Layers3 className="h-5 w-5 text-muted-strong" />
<h3 className="mt-3 text-lg font-semibold text-fg">
{copy.valueB}
</h3>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{copy.valueBText}
</p>
</article>
<article className="rounded-2xl border border-zinc-200 bg-zinc-50 p-5 dark:border-zinc-800 dark:bg-zinc-900">
<Users className="h-5 w-5 text-zinc-700 dark:text-zinc-200" />
<h3 className="mt-3 text-lg font-semibold text-zinc-900 dark:text-zinc-100">
<article className="rounded-2xl border border-default bg-surface-soft p-5 ">
<Users className="h-5 w-5 text-muted-strong" />
<h3 className="mt-3 text-lg font-semibold text-fg">
{copy.valueC}
</h3>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{copy.valueCText}
</p>
</article>
@@ -98,17 +98,17 @@ export default function AboutPage({ params: { locale } }: AboutPageProps) {
</MotionFade>
<MotionFade delay={0.1}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<h2 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8">
<h2 className="text-2xl font-semibold text-fg">
{copy.processTitle}
</h2>
<ol className="mt-5 grid gap-3 sm:grid-cols-3">
{[copy.processOne, copy.processTwo, copy.processThree].map((step, index) => (
<li
key={step}
className="rounded-xl border border-zinc-200 bg-zinc-50 p-4 text-sm text-zinc-700 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-200"
className="rounded-xl border border-default bg-surface-soft p-4 text-sm text-muted-strong text-muted-strong"
>
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-full bg-zinc-200 text-xs font-semibold text-zinc-800 dark:bg-zinc-800 dark:text-zinc-100">
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-full bg-surface-elevated text-xs font-semibold text-muted-strong">
{index + 1}
</span>
<p>{step}</p>
+51 -65
View File
@@ -3,6 +3,11 @@ import Link from "next/link";
import { MotionFade } from "@/components/motion-fade";
import { resolveLocale } from "@/lib/site-data";
import { Button } from "@/src/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/src/components/ui/card";
import { Input } from "@/src/components/ui/input";
import { Label } from "@/src/components/ui/label";
import { Textarea } from "@/src/components/ui/textarea";
type ContactPageProps = {
params: {
@@ -43,77 +48,58 @@ export default function ContactPage({ params: { locale } }: ContactPageProps) {
return (
<div className="mx-auto grid w-full max-w-6xl gap-6 px-4 py-10 sm:px-6 lg:grid-cols-2 lg:px-8 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<h1 className="text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
{copy.title}
</h1>
<p className="mt-4 text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
{copy.intro}
</p>
<ul className="mt-6 space-y-3 text-sm text-zinc-700 dark:text-zinc-200">
<li className="inline-flex items-center gap-2">
<Phone className="h-4 w-4" />
{copy.phone}
</li>
<li className="inline-flex items-center gap-2">
<Mail className="h-4 w-4" />
{copy.mail}
</li>
<li className="inline-flex items-center gap-2">
<MapPin className="h-4 w-4" />
{copy.city}
</li>
</ul>
</section>
<Card>
<CardHeader>
<CardTitle className="text-3xl sm:text-4xl">{copy.title}</CardTitle>
<p className="text-base text-muted-foreground sm:text-lg">{copy.intro}</p>
</CardHeader>
<CardContent>
<ul className="space-y-3 text-sm text-foreground/85">
<li className="inline-flex items-center gap-2">
<Phone className="h-4 w-4" />
{copy.phone}
</li>
<li className="inline-flex items-center gap-2">
<Mail className="h-4 w-4" />
{copy.mail}
</li>
<li className="inline-flex items-center gap-2">
<MapPin className="h-4 w-4" />
{copy.city}
</li>
</ul>
</CardContent>
</Card>
</MotionFade>
<MotionFade delay={0.05}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<form className="grid gap-4">
<label className="grid gap-2 text-sm text-zinc-700 dark:text-zinc-200">
{copy.name}
<input
type="text"
className="rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 outline-none transition focus:border-zinc-500 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100"
placeholder={copy.name}
/>
</label>
<Card>
<CardContent className="pt-6">
<form className="grid gap-4">
<Label className="grid gap-2">
{copy.name}
<Input type="text" placeholder={copy.name} />
</Label>
<label className="grid gap-2 text-sm text-zinc-700 dark:text-zinc-200">
{copy.email}
<input
type="email"
className="rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 outline-none transition focus:border-zinc-500 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100"
placeholder={copy.email}
/>
</label>
<Label className="grid gap-2">
{copy.email}
<Input type="email" placeholder={copy.email} />
</Label>
<label className="grid gap-2 text-sm text-zinc-700 dark:text-zinc-200">
{copy.message}
<textarea
rows={5}
className="rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 outline-none transition focus:border-zinc-500 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100"
placeholder={copy.message}
/>
</label>
<Label className="grid gap-2">
{copy.message}
<Textarea rows={5} placeholder={copy.message} />
</Label>
<div className="flex flex-wrap gap-3">
<button
type="button"
className="inline-flex rounded-lg bg-zinc-900 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-300"
>
{copy.submit}
</button>
<Link
href={`/${localeKey}/success`}
className="inline-flex rounded-lg border border-zinc-300 px-4 py-2.5 text-sm font-medium text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-800"
>
{copy.preview}
</Link>
</div>
</form>
</section>
<div className="flex flex-wrap gap-3">
<Button type="button">{copy.submit}</Button>
<Button asChild variant="outline">
<Link href={`/${localeKey}/success`}>{copy.preview}</Link>
</Button>
</div>
</form>
</CardContent>
</Card>
</MotionFade>
</div>
);
+2 -2
View File
@@ -31,9 +31,9 @@ export default async function SiteLayout({ children, params: { locale } }: SiteL
return (
<div className="flex min-h-screen flex-col">
<Navbar />
<Navbar isAdmin={authenticated} />
<main className="flex-1">{children}</main>
<Footer />
<Footer isAdmin={authenticated} />
</div>
);
}
+130 -125
View File
@@ -9,6 +9,8 @@ import Link from "next/link";
import { MotionFade } from "@/components/motion-fade";
import { pickText, portfolioItems, productItems, resolveLocale } from "@/lib/site-data";
import { Button } from "@/src/components/ui/button";
import { Card, CardContent } from "@/src/components/ui/card";
type HomePageProps = {
params: {
@@ -61,145 +63,148 @@ export default function HomePage({ params: { locale } }: HomePageProps) {
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<MotionFade>
<section className="grid gap-6 rounded-3xl border border-zinc-200 bg-white p-6 shadow-sm dark:border-zinc-800 dark:bg-zinc-950 lg:grid-cols-[1.3fr_0.7fr] lg:p-10">
<div className="space-y-5">
<p className="inline-flex items-center gap-2 text-sm font-medium text-zinc-600 dark:text-zinc-300">
<Sparkles className="h-4 w-4" />
{copy.heroKicker}
</p>
<h1 className="text-3xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-100 sm:text-5xl">
{copy.heroTitle}
</h1>
<p className="max-w-2xl text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
{copy.heroText}
</p>
<div className="flex flex-wrap gap-3">
<Link
href={`/${localeKey}/portfolio`}
className="inline-flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-300"
>
{copy.toPortfolio}
<ArrowRight className="h-4 w-4" />
</Link>
<Link
href={`/${localeKey}/products`}
className="inline-flex items-center gap-2 rounded-lg border border-zinc-300 px-4 py-2.5 text-sm font-medium text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-800"
>
{copy.toProducts}
</Link>
<Card>
<CardContent className="grid gap-6 p-6 lg:grid-cols-[1.3fr_0.7fr] lg:p-10">
<div className="space-y-5">
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted">
<Sparkles className="h-4 w-4" />
{copy.heroKicker}
</p>
<h1 className="text-3xl font-semibold tracking-tight text-fg sm:text-5xl">
{copy.heroTitle}
</h1>
<p className="max-w-2xl text-base text-muted sm:text-lg">
{copy.heroText}
</p>
<div className="flex flex-wrap gap-3">
<Button asChild>
<Link href={`/${localeKey}/portfolio`}>
{copy.toPortfolio}
<ArrowRight className="h-4 w-4" />
</Link>
</Button>
<Button asChild variant="outline">
<Link href={`/${localeKey}/products`}>{copy.toProducts}</Link>
</Button>
</div>
</div>
</div>
<div className="rounded-2xl border border-zinc-200 bg-zinc-50 p-5 dark:border-zinc-800 dark:bg-zinc-900">
<p className="mb-3 inline-flex items-center gap-2 text-sm font-medium text-zinc-600 dark:text-zinc-300">
<BriefcaseBusiness className="h-4 w-4" />
{copy.heroCardTitle}
</p>
<p className="text-sm leading-relaxed text-zinc-600 dark:text-zinc-300">
{copy.heroCardText}
</p>
</div>
</section>
<div className="rounded-[var(--radius-input)] border border-border bg-muted p-5">
<p className="mb-3 inline-flex items-center gap-2 text-sm font-medium text-muted">
<BriefcaseBusiness className="h-4 w-4" />
{copy.heroCardTitle}
</p>
<p className="text-sm leading-relaxed text-muted">
{copy.heroCardText}
</p>
</div>
</CardContent>
</Card>
</MotionFade>
<MotionFade delay={0.05}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4">
<div>
<h2 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
{copy.portfolioTitle}
</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
{copy.portfolioText}
</p>
<Card>
<CardContent className="p-6 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4">
<div>
<h2 className="text-2xl font-semibold text-fg">
{copy.portfolioTitle}
</h2>
<p className="mt-2 text-sm text-muted">
{copy.portfolioText}
</p>
</div>
<BriefcaseBusiness className="h-5 w-5 text-subtle" />
</div>
<BriefcaseBusiness className="h-5 w-5 text-zinc-500 dark:text-zinc-300" />
</div>
<div className="grid gap-4 md:grid-cols-3">
{featuredProjects.map((item) => (
<Link
key={item.slug}
href={`/${localeKey}/portfolio/${item.slug}`}
className="group rounded-2xl border border-zinc-200 bg-zinc-50 p-4 transition hover:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600"
>
<p className="text-sm text-zinc-500 dark:text-zinc-400">
{pickText(item.category, localeKey)} - {item.year}
</p>
<h3 className="mt-2 text-lg font-semibold text-zinc-900 dark:text-zinc-100">
{pickText(item.title, localeKey)}
</h3>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
{pickText(item.summary, localeKey)}
</p>
<span className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-zinc-700 group-hover:text-zinc-900 dark:text-zinc-200 dark:group-hover:text-white">
{copy.toPortfolio}
<ArrowRight className="h-4 w-4" />
</span>
</Link>
))}
</div>
</section>
<div className="grid gap-4 md:grid-cols-3">
{featuredProjects.map((item) => (
<Card key={item.slug} className="bg-muted/85 transition hover:border-input">
<CardContent className="p-4">
<Link href={`/${localeKey}/portfolio/${item.slug}`} className="group block">
<p className="text-sm text-subtle">
{pickText(item.category, localeKey)} - {item.year}
</p>
<h3 className="mt-2 text-lg font-semibold text-fg">
{pickText(item.title, localeKey)}
</h3>
<p className="mt-2 text-sm text-muted">
{pickText(item.summary, localeKey)}
</p>
<span className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
{copy.toPortfolio}
<ArrowRight className="h-4 w-4" />
</span>
</Link>
</CardContent>
</Card>
))}
</div>
</CardContent>
</Card>
</MotionFade>
<MotionFade delay={0.1}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4">
<div>
<h2 className="text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
{copy.productsTitle}
</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
{copy.productsText}
</p>
<Card>
<CardContent className="p-6 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4">
<div>
<h2 className="text-2xl font-semibold text-fg">
{copy.productsTitle}
</h2>
<p className="mt-2 text-sm text-muted">
{copy.productsText}
</p>
</div>
<Boxes className="h-5 w-5 text-subtle" />
</div>
<Boxes className="h-5 w-5 text-zinc-500 dark:text-zinc-300" />
</div>
<div className="grid gap-4 md:grid-cols-3">
{featuredProducts.map((item) => (
<Link
key={item.slug}
href={`/${localeKey}/products/${item.slug}`}
className="group rounded-2xl border border-zinc-200 bg-zinc-50 p-4 transition hover:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-900 dark:hover:border-zinc-600"
>
<p className="text-sm text-zinc-500 dark:text-zinc-400">
{pickText(item.segment, localeKey)}
</p>
<h3 className="mt-2 text-lg font-semibold text-zinc-900 dark:text-zinc-100">
{pickText(item.name, localeKey)}
</h3>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-3 text-sm font-medium text-zinc-700 dark:text-zinc-200">
{pickText(item.price, localeKey)}
</p>
</Link>
))}
</div>
</section>
<div className="grid gap-4 md:grid-cols-3">
{featuredProducts.map((item) => (
<Card key={item.slug} className="bg-muted/85 transition hover:border-input">
<CardContent className="p-4">
<Link href={`/${localeKey}/products/${item.slug}`} className="group block">
<p className="text-sm text-subtle">
{pickText(item.segment, localeKey)}
</p>
<h3 className="mt-2 text-lg font-semibold text-fg">
{pickText(item.name, localeKey)}
</h3>
<p className="mt-2 text-sm text-muted">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-3 text-sm font-medium text-muted-strong">
{pickText(item.price, localeKey)}
</p>
</Link>
</CardContent>
</Card>
))}
</div>
</CardContent>
</Card>
</MotionFade>
<MotionFade delay={0.15}>
<section className="rounded-3xl border border-zinc-200 bg-zinc-900 p-6 text-zinc-100 dark:border-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 lg:p-8">
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div>
<p className="inline-flex items-center gap-2 text-sm font-medium opacity-80">
<Mail className="h-4 w-4" />
{copy.ctaTitle}
</p>
<p className="mt-2 max-w-2xl text-sm opacity-90 sm:text-base">
{copy.ctaText}
</p>
<Card className="bg-foreground text-background">
<CardContent className="p-6 lg:p-8">
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div>
<p className="inline-flex items-center gap-2 text-sm font-medium opacity-80">
<Mail className="h-4 w-4" />
{copy.ctaTitle}
</p>
<p className="mt-2 max-w-2xl text-sm opacity-90 sm:text-base">
{copy.ctaText}
</p>
</div>
<Button asChild variant="secondary">
<Link href={`/${localeKey}/contact`}>
{copy.toContact}
<ArrowRight className="h-4 w-4" />
</Link>
</Button>
</div>
<Link
href={`/${localeKey}/contact`}
className="inline-flex items-center justify-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold text-zinc-900 transition hover:bg-zinc-200 dark:bg-zinc-900 dark:text-zinc-100 dark:hover:bg-zinc-700"
>
{copy.toContact}
<ArrowRight className="h-4 w-4" />
</Link>
</div>
</section>
</CardContent>
</Card>
</MotionFade>
</div>
);
+17 -17
View File
@@ -62,31 +62,31 @@ export default function PortfolioItemPage({
return (
<div className="mx-auto flex w-full max-w-5xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-10">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<Link
href={`/${localeKey}/portfolio`}
className="inline-flex items-center gap-2 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-zinc-100"
className="inline-flex items-center gap-2 text-sm text-muted transition hover:text-fg"
>
<ArrowLeft className="h-4 w-4" />
{copy.back}
</Link>
<h1 className="mt-5 text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
<h1 className="mt-5 text-3xl font-semibold text-fg sm:text-4xl">
{pickText(item.title, localeKey)}
</h1>
<p className="mt-4 text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
<p className="mt-4 text-base text-muted sm:text-lg">
{pickText(item.summary, localeKey)}
</p>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-zinc-600 dark:text-zinc-300">
<span className="inline-flex items-center gap-2 rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900">
<div className="mt-6 flex flex-wrap gap-3 text-sm text-muted">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<Tag className="h-4 w-4" />
{pickText(item.category, localeKey)}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<CalendarDays className="h-4 w-4" />
{item.year}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<FolderKanban className="h-4 w-4" />
{item.slug}
</span>
@@ -96,31 +96,31 @@ export default function PortfolioItemPage({
<div className="grid gap-4 md:grid-cols-3">
<MotionFade delay={0.05}>
<article className="rounded-2xl border border-zinc-200 bg-white p-5 dark:border-zinc-800 dark:bg-zinc-950">
<h2 className="text-lg font-semibold text-zinc-900 dark:text-zinc-100">
<article className="rounded-2xl border border-default bg-surface p-5 ">
<h2 className="text-lg font-semibold text-fg">
{copy.challenge}
</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{copy.challengeText}
</p>
</article>
</MotionFade>
<MotionFade delay={0.1}>
<article className="rounded-2xl border border-zinc-200 bg-white p-5 dark:border-zinc-800 dark:bg-zinc-950">
<h2 className="text-lg font-semibold text-zinc-900 dark:text-zinc-100">
<article className="rounded-2xl border border-default bg-surface p-5 ">
<h2 className="text-lg font-semibold text-fg">
{copy.solution}
</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{copy.solutionText}
</p>
</article>
</MotionFade>
<MotionFade delay={0.15}>
<article className="rounded-2xl border border-zinc-200 bg-white p-5 dark:border-zinc-800 dark:bg-zinc-950">
<h2 className="text-lg font-semibold text-zinc-900 dark:text-zinc-100">
<article className="rounded-2xl border border-default bg-surface p-5 ">
<h2 className="text-lg font-semibold text-fg">
{copy.outcome}
</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{copy.outcomeText}
</p>
</article>
+10 -10
View File
@@ -29,14 +29,14 @@ export default function PortfolioPage({ params: { locale } }: PortfolioPageProps
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-10">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<div className="flex items-center gap-3">
<FolderKanban className="h-5 w-5 text-zinc-700 dark:text-zinc-200" />
<h1 className="text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
<FolderKanban className="h-5 w-5 text-muted-strong" />
<h1 className="text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
</div>
<p className="mt-4 max-w-3xl text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg">
{copy.intro}
</p>
</section>
@@ -47,24 +47,24 @@ export default function PortfolioPage({ params: { locale } }: PortfolioPageProps
<MotionFade key={item.slug} delay={index * 0.05}>
<Link
href={`/${localeKey}/portfolio/${item.slug}`}
className="group block rounded-2xl border border-zinc-200 bg-white p-5 transition hover:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-950 dark:hover:border-zinc-600"
className="group block rounded-2xl border border-default bg-surface p-5 transition group-hover-border-strong "
>
<div className="flex items-center justify-between gap-3">
<p className="text-sm text-zinc-500 dark:text-zinc-400">
<p className="text-sm text-subtle">
{pickText(item.category, localeKey)}
</p>
<p className="inline-flex items-center gap-1 text-xs text-zinc-500 dark:text-zinc-400">
<p className="inline-flex items-center gap-1 text-xs text-subtle">
<CalendarDays className="h-3.5 w-3.5" />
{item.year}
</p>
</div>
<h2 className="mt-3 text-xl font-semibold text-zinc-900 dark:text-zinc-100">
<h2 className="mt-3 text-xl font-semibold text-fg">
{pickText(item.title, localeKey)}
</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-zinc-700 group-hover:text-zinc-900 dark:text-zinc-200 dark:group-hover:text-white">
<p className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
{copy.open}
<ArrowUpRight className="h-4 w-4" />
</p>
+13 -13
View File
@@ -52,32 +52,32 @@ export default function ProductPage({ params: { locale, slug } }: ProductPagePro
return (
<div className="mx-auto flex w-full max-w-5xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-10">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<Link
href={`/${localeKey}/products`}
className="inline-flex items-center gap-2 text-sm text-zinc-600 transition hover:text-zinc-900 dark:text-zinc-300 dark:hover:text-zinc-100"
className="inline-flex items-center gap-2 text-sm text-muted transition hover:text-fg"
>
<ArrowLeft className="h-4 w-4" />
{copy.back}
</Link>
<h1 className="mt-5 text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
<h1 className="mt-5 text-3xl font-semibold text-fg sm:text-4xl">
{pickText(item.name, localeKey)}
</h1>
<p className="mt-4 text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
<p className="mt-4 text-base text-muted sm:text-lg">
{pickText(item.summary, localeKey)}
</p>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-zinc-600 dark:text-zinc-300">
<span className="inline-flex items-center gap-2 rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900">
<div className="mt-6 flex flex-wrap gap-3 text-sm text-muted">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<Layers2 className="h-4 w-4" />
{pickText(item.segment, localeKey)}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<BadgeEuro className="h-4 w-4" />
{pickText(item.price, localeKey)}
</span>
<span className="inline-flex items-center gap-2 rounded-lg border border-zinc-200 bg-zinc-50 px-3 py-2 dark:border-zinc-800 dark:bg-zinc-900">
<span className="inline-flex items-center gap-2 rounded-lg border border-default bg-surface-soft px-3 py-2 ">
<Boxes className="h-4 w-4" />
{item.slug}
</span>
@@ -86,17 +86,17 @@ export default function ProductPage({ params: { locale, slug } }: ProductPagePro
</MotionFade>
<MotionFade delay={0.05}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<h2 className="text-xl font-semibold text-zinc-900 dark:text-zinc-100">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8">
<h2 className="text-xl font-semibold text-fg">
{copy.included}
</h2>
<ul className="mt-4 grid gap-3 sm:grid-cols-3">
{[copy.stepOne, copy.stepTwo, copy.stepThree].map((step, index) => (
<li
key={step}
className="rounded-xl border border-zinc-200 bg-zinc-50 p-4 text-sm text-zinc-700 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-200"
className="rounded-xl border border-default bg-surface-soft p-4 text-sm text-muted-strong text-muted-strong"
>
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-full bg-zinc-200 text-xs font-semibold text-zinc-800 dark:bg-zinc-800 dark:text-zinc-100">
<span className="mb-2 inline-flex h-6 w-6 items-center justify-center rounded-full bg-surface-elevated text-xs font-semibold text-muted-strong">
{index + 1}
</span>
<p>{step}</p>
@@ -105,7 +105,7 @@ export default function ProductPage({ params: { locale, slug } }: ProductPagePro
</ul>
<Link
href={`/${localeKey}/contact`}
className="mt-6 inline-flex rounded-lg bg-zinc-900 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-300"
className="mt-6 inline-flex rounded-lg bg-inverse px-4 py-2.5 text-sm font-medium text-inverse transition hover:opacity-90 "
>
{copy.action}
</Link>
+10 -10
View File
@@ -29,14 +29,14 @@ export default function ProductsPage({ params: { locale } }: ProductsPageProps)
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-10">
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10">
<div className="flex items-center gap-3">
<Boxes className="h-5 w-5 text-zinc-700 dark:text-zinc-200" />
<h1 className="text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
<Boxes className="h-5 w-5 text-muted-strong" />
<h1 className="text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
</div>
<p className="mt-4 max-w-3xl text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg">
{copy.intro}
</p>
</section>
@@ -47,22 +47,22 @@ export default function ProductsPage({ params: { locale } }: ProductsPageProps)
<MotionFade key={item.slug} delay={index * 0.05}>
<Link
href={`/${localeKey}/products/${item.slug}`}
className="group block rounded-2xl border border-zinc-200 bg-white p-5 transition hover:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-950 dark:hover:border-zinc-600"
className="group block rounded-2xl border border-default bg-surface p-5 transition group-hover-border-strong "
>
<p className="text-sm text-zinc-500 dark:text-zinc-400">
<p className="text-sm text-subtle">
{pickText(item.segment, localeKey)}
</p>
<h2 className="mt-3 text-xl font-semibold text-zinc-900 dark:text-zinc-100">
<h2 className="mt-3 text-xl font-semibold text-fg">
{pickText(item.name, localeKey)}
</h2>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">
<p className="mt-2 text-sm text-muted">
{pickText(item.summary, localeKey)}
</p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-zinc-700 dark:text-zinc-200">
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
<CircleDollarSign className="h-4 w-4" />
{pickText(item.price, localeKey)}
</p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-zinc-700 group-hover:text-zinc-900 dark:text-zinc-200 dark:group-hover:text-white">
<p className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong">
{copy.open}
<ArrowUpRight className="h-4 w-4" />
</p>
+5 -5
View File
@@ -31,24 +31,24 @@ export default function SuccessPage({ params: { locale } }: SuccessPageProps) {
return (
<div className="mx-auto flex w-full max-w-4xl px-4 py-12 sm:px-6 lg:px-8 lg:py-16">
<MotionFade className="w-full">
<section className="w-full rounded-3xl border border-zinc-200 bg-white p-8 text-center dark:border-zinc-800 dark:bg-zinc-950">
<section className="w-full rounded-3xl border border-default bg-surface p-8 text-center ">
<CheckCircle2 className="mx-auto h-12 w-12 text-emerald-500" />
<h1 className="mt-4 text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
<h1 className="mt-4 text-3xl font-semibold text-fg sm:text-4xl">
{copy.title}
</h1>
<p className="mx-auto mt-3 max-w-2xl text-base text-zinc-600 dark:text-zinc-300">
<p className="mx-auto mt-3 max-w-2xl text-base text-muted">
{copy.text}
</p>
<div className="mt-6 flex flex-wrap items-center justify-center gap-3">
<Link
href={`/${localeKey}`}
className="inline-flex rounded-lg bg-zinc-900 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-300"
className="inline-flex rounded-lg bg-inverse px-4 py-2.5 text-sm font-medium text-inverse transition hover:opacity-90 "
>
{copy.home}
</Link>
<Link
href={`/${localeKey}/contact`}
className="inline-flex rounded-lg border border-zinc-300 px-4 py-2.5 text-sm font-medium text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-800"
className="inline-flex rounded-lg border border-strong px-4 py-2.5 text-sm font-medium text-muted-strong transition hover-surface-soft text-muted-strong"
>
{copy.contact}
</Link>
+1 -8
View File
@@ -37,14 +37,7 @@ export default async function LocaleLayout({
return (
<NextIntlClientProvider messages={messages}>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
<ThemeProvider>{children}</ThemeProvider>
</NextIntlClientProvider>
);
}
+131 -79
View File
@@ -3,191 +3,243 @@
@tailwind utilities;
:root {
--color-bg: #f5f6f8;
--color-fg: #111214;
--color-surface: #ffffff;
--color-surface-soft: #eef0f3;
--color-surface-elevated: #fdfdfd;
--background: 220 23% 97%;
--foreground: 222 22% 11%;
--color-border: #dde1e7;
--color-border-strong: #bec5d0;
--card: 0 0% 100%;
--card-foreground: 222 22% 11%;
--popover: 0 0% 100%;
--popover-foreground: 222 22% 11%;
--color-muted: #4b5565;
--color-muted-strong: #374151;
--color-subtle: #6b7380;
--primary: 10 74% 50%;
--primary-foreground: 210 40% 98%;
--secondary: 214 19% 93%;
--secondary-foreground: 222 22% 11%;
--muted: 215 20% 92%;
--muted-foreground: 219 15% 35%;
--accent: 44 93% 55%;
--accent-foreground: 222 22% 11%;
--destructive: 0 72% 45%;
--destructive-foreground: 210 40% 98%;
--color-inverse-bg: #111214;
--color-inverse-fg: #f3f4f6;
--surface: 0 0% 100%;
--surface-soft: 215 18% 93%;
--surface-elevated: 0 0% 99%;
--border: 215 20% 88%;
--input: 215 20% 83%;
--ring: 10 74% 50%;
--color-brand-primary: #dd4124;
--color-brand-secondary: #f7b91f;
--radius: 0.85rem;
--radius-card: 1rem;
--radius-input: 0.7rem;
--radius-sidebar: 1rem;
--color-success-bg: #dcfce7;
--color-success-fg: #166534;
--color-warning-bg: #fef3c7;
--color-warning-fg: #92400e;
--color-danger-bg: #fee2e2;
--color-danger-fg: #991b1b;
--shadow-xs: 0 1px 2px 0 hsl(220 30% 10% / 0.06);
--shadow-sm: 0 6px 18px -14px hsl(220 32% 20% / 0.18);
--shadow-md: 0 18px 35px -24px hsl(220 32% 20% / 0.24);
--shadow-lg: 0 24px 55px -30px hsl(220 32% 20% / 0.3);
--shadow-card: 0 10px 30px -20px hsl(220 35% 10% / 0.22);
--shadow-sidebar: inset 0 1px 0 0 hsl(0 0% 100% / 0.08);
--sidebar-background: 220 27% 96%;
--sidebar-foreground: 223 18% 24%;
--sidebar-primary: 10 74% 50%;
--sidebar-primary-foreground: 210 40% 98%;
--sidebar-accent: 220 24% 91%;
--sidebar-accent-foreground: 222 20% 15%;
--sidebar-border: 216 20% 85%;
--sidebar-ring: 10 74% 50%;
--focus-ring: 0 0 0 2px hsl(var(--ring) / 0.35);
}
.dark {
--color-bg: #090b0f;
--color-fg: #eef1f7;
--color-surface: #10141c;
--color-surface-soft: #151b24;
--color-surface-elevated: #1b2230;
--background: 223 32% 7%;
--foreground: 216 36% 93%;
--color-border: #2a3342;
--color-border-strong: #3a465a;
--card: 221 29% 11%;
--card-foreground: 216 36% 93%;
--popover: 221 29% 11%;
--popover-foreground: 216 36% 93%;
--color-muted: #c6cfdd;
--color-muted-strong: #dbe4f3;
--color-subtle: #98a4b8;
--primary: 10 80% 56%;
--primary-foreground: 216 36% 93%;
--secondary: 221 23% 18%;
--secondary-foreground: 216 36% 93%;
--muted: 221 21% 20%;
--muted-foreground: 218 17% 76%;
--accent: 44 92% 52%;
--accent-foreground: 221 29% 11%;
--destructive: 0 72% 50%;
--destructive-foreground: 216 36% 93%;
--color-inverse-bg: #eff3f9;
--color-inverse-fg: #0e1118;
--surface: 221 29% 11%;
--surface-soft: 220 24% 15%;
--surface-elevated: 220 21% 20%;
--border: 221 21% 24%;
--input: 221 20% 27%;
--ring: 10 80% 56%;
--color-success-bg: rgba(22, 101, 52, 0.35);
--color-success-fg: #86efac;
--color-warning-bg: rgba(146, 64, 14, 0.35);
--color-warning-fg: #fde68a;
--color-danger-bg: rgba(153, 27, 27, 0.35);
--color-danger-fg: #fecaca;
--shadow-xs: 0 1px 2px 0 hsl(220 40% 2% / 0.5);
--shadow-sm: 0 8px 20px -12px hsl(220 40% 2% / 0.65);
--shadow-md: 0 18px 36px -20px hsl(220 40% 2% / 0.75);
--shadow-lg: 0 28px 60px -28px hsl(220 40% 2% / 0.85);
--shadow-card: 0 16px 34px -24px hsl(220 40% 2% / 0.8);
--shadow-sidebar: inset 0 1px 0 0 hsl(216 36% 93% / 0.05);
--sidebar-background: 223 30% 9%;
--sidebar-foreground: 216 28% 86%;
--sidebar-primary: 10 80% 56%;
--sidebar-primary-foreground: 216 36% 93%;
--sidebar-accent: 221 23% 17%;
--sidebar-accent-foreground: 216 36% 93%;
--sidebar-border: 221 20% 21%;
--sidebar-ring: 10 80% 56%;
}
html {
color-scheme: light;
background-color: var(--color-bg);
background-color: hsl(var(--background));
}
html.dark {
color-scheme: dark;
}
@layer base {
* {
@apply border-border;
}
body {
@apply min-h-screen bg-background text-foreground antialiased;
}
}
body {
min-height: 100vh;
color: var(--color-fg);
background: var(--color-bg);
color: hsl(var(--foreground));
background: hsl(var(--background));
}
::selection {
background: color-mix(in oklab, var(--color-brand-primary) 72%, black 0%);
color: #ffffff;
background: hsl(var(--primary) / 0.82);
color: hsl(var(--primary-foreground));
}
@layer utilities {
.bg-app {
background-color: var(--color-bg);
background-color: hsl(var(--background));
}
.bg-surface {
background-color: var(--color-surface);
background-color: hsl(var(--surface));
}
.bg-surface-soft {
background-color: var(--color-surface-soft);
background-color: hsl(var(--surface-soft));
}
.bg-surface-elevated {
background-color: var(--color-surface-elevated);
background-color: hsl(var(--surface-elevated));
}
.bg-inverse {
background-color: var(--color-inverse-bg);
background-color: hsl(var(--foreground));
}
.text-fg {
color: var(--color-fg);
color: hsl(var(--foreground));
}
.text-muted {
color: var(--color-muted);
color: hsl(var(--muted-foreground));
}
.text-muted-strong {
color: var(--color-muted-strong);
color: hsl(var(--foreground) / 0.86);
}
.text-subtle {
color: var(--color-subtle);
color: hsl(var(--muted-foreground) / 0.88);
}
.text-inverse {
color: var(--color-inverse-fg);
color: hsl(var(--background));
}
.border-default {
border-color: var(--color-border);
border-color: hsl(var(--border));
}
.border-strong {
border-color: var(--color-border-strong);
border-color: hsl(var(--input));
}
.status-success {
background-color: var(--color-success-bg);
color: var(--color-success-fg);
background-color: hsl(142 70% 45% / 0.15);
color: hsl(142 72% 34%);
}
.status-warning {
background-color: var(--color-warning-bg);
color: var(--color-warning-fg);
background-color: hsl(38 92% 56% / 0.17);
color: hsl(33 92% 34%);
}
.status-danger {
background-color: var(--color-danger-bg);
color: var(--color-danger-fg);
background-color: hsl(var(--destructive) / 0.18);
color: hsl(var(--destructive));
}
.hover-surface-soft:hover {
background-color: var(--color-surface-soft);
background-color: hsl(var(--surface-soft));
}
.hover-fg:hover {
color: var(--color-fg);
color: hsl(var(--foreground));
}
.group:hover .group-hover-fg {
color: var(--color-fg);
color: hsl(var(--foreground));
}
.group:hover .group-hover-border-strong {
border-color: var(--color-border-strong);
border-color: hsl(var(--input));
}
.btn-primary {
background-color: var(--color-inverse-bg);
color: var(--color-inverse-fg);
background-color: hsl(var(--primary));
color: hsl(var(--primary-foreground));
}
.btn-primary:hover {
opacity: 0.9;
filter: brightness(0.95);
}
.btn-secondary {
border: 1px solid var(--color-border-strong);
color: var(--color-muted-strong);
border: 1px solid hsl(var(--input));
color: hsl(var(--foreground) / 0.88);
background-color: transparent;
}
.btn-secondary:hover {
background-color: var(--color-surface-soft);
background-color: hsl(var(--surface-soft));
}
.field-surface {
border: 1px solid var(--color-border-strong);
background-color: var(--color-surface);
color: var(--color-fg);
border: 1px solid hsl(var(--input));
background-color: hsl(var(--surface));
color: hsl(var(--foreground));
border-radius: var(--radius-input);
}
.field-surface:focus {
outline: none;
box-shadow: 0 0 0 2px color-mix(in oklab, var(--color-brand-primary) 20%, transparent);
box-shadow: var(--focus-ring);
}
.brand-gradient-text {
background: linear-gradient(120deg, var(--color-brand-primary), var(--color-brand-secondary));
background: linear-gradient(120deg, hsl(var(--primary)), hsl(var(--accent)));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
@@ -195,8 +247,8 @@ body {
.brand-glow {
box-shadow:
0 10px 40px -16px color-mix(in oklab, var(--color-brand-primary) 52%, transparent),
0 8px 32px -18px color-mix(in oklab, var(--color-brand-secondary) 58%, transparent);
0 10px 40px -16px hsl(var(--primary) / 0.45),
0 8px 32px -18px hsl(var(--accent) / 0.45);
}
.float-slow {
+1 -1
View File
@@ -13,7 +13,7 @@ export default function RootLayout({
}>) {
return (
<html lang="de" suppressHydrationWarning>
<body className="min-h-screen antialiased">{children}</body>
<body>{children}</body>
</html>
);
}
+148 -142
View File
@@ -1,7 +1,9 @@
import {
ArrowLeft,
BarChart3,
Boxes,
FolderKanban,
LayoutDashboard,
LockKeyhole,
LogOut,
Power,
@@ -11,8 +13,10 @@ import {
import { revalidatePath } from "next/cache";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import Link from "next/link";
import { MotionFade } from "@/components/motion-fade";
import { routing } from "@/i18n/routing";
import {
clearAdminSessionCookie,
getAdminLockState,
@@ -23,9 +27,17 @@ import {
resetAdminFailedAttempts,
setAdminSessionCookie,
} from "@/lib/admin-auth";
import { routing } from "@/i18n/routing";
import { getMaintenanceMode, setMaintenanceMode } from "@/lib/app-config";
import { resolveLocale } from "@/lib/site-data";
import { AppHeader } from "@/src/components/layout/app-header";
import { AppShell } from "@/src/components/layout/app-shell";
import { AppSidebar } from "@/src/components/layout/app-sidebar";
import { Badge } from "@/src/components/ui/badge";
import { Button } from "@/src/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/src/components/ui/card";
import { Input } from "@/src/components/ui/input";
import { Label } from "@/src/components/ui/label";
type RootPageProps = {
searchParams?: {
@@ -126,6 +138,7 @@ export default async function RootPage({ searchParams }: RootPageProps) {
basicAuthMissing:
"ROOT_BASIC_AUTH_USER und ROOT_BASIC_AUTH_PASS fehlen in env.",
logout: "Ausloggen",
backToSite: "Zur Website",
}
: {
title: "Root",
@@ -155,63 +168,56 @@ export default async function RootPage({ searchParams }: RootPageProps) {
basicAuthMissing:
"ROOT_BASIC_AUTH_USER and ROOT_BASIC_AUTH_PASS are missing in env.",
logout: "Sign out",
backToSite: "Back to site",
};
if (!authenticated) {
return (
<div className="mx-auto flex w-full max-w-xl flex-col gap-6 px-4 py-12 sm:px-6 lg:px-8">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<p className="inline-flex items-center gap-2 text-sm font-medium text-zinc-700 dark:text-zinc-200">
<LockKeyhole className="h-4 w-4" />
{copy.loginTitle}
</p>
<p className="mt-2 text-sm text-zinc-600 dark:text-zinc-300">{copy.loginText}</p>
{!authConfigured ? (
<p className="mt-4 rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300">
{copy.configMissing}
</p>
) : null}
{!basicConfigured ? (
<p className="mt-4 rounded-xl border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/40 dark:text-red-300">
{copy.basicAuthMissing}
</p>
) : null}
{searchParams?.error === "invalid" ? (
<p className="mt-4 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-700 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300">
{copy.invalidLogin}
</p>
) : null}
{searchParams?.error === "locked" || lockState.locked ? (
<p className="mt-4 rounded-xl border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-700 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300">
{copy.lockedLogin}
</p>
) : null}
<form action={loginAction} className="mt-5 space-y-3">
<label className="block text-sm font-medium text-zinc-700 dark:text-zinc-200">
{copy.passwordLabel}
</label>
<input
type="password"
name="password"
required
className="w-full rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 outline-none ring-zinc-300 focus:ring-2 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100 dark:ring-zinc-700"
/>
<button
type="submit"
className="inline-flex items-center gap-2 rounded-lg bg-zinc-900 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-300"
disabled={!authConfigured || !basicConfigured || lockState.locked}
>
<Card>
<CardHeader>
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<LockKeyhole className="h-4 w-4" />
{copy.loginButton}
</button>
</form>
</section>
{copy.loginTitle}
</p>
<CardDescription>{copy.loginText}</CardDescription>
</CardHeader>
<CardContent>
{!authConfigured ? (
<p className="mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
{copy.configMissing}
</p>
) : null}
{!basicConfigured ? (
<p className="mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
{copy.basicAuthMissing}
</p>
) : null}
{searchParams?.error === "invalid" ? (
<p className="mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300">
{copy.invalidLogin}
</p>
) : null}
{searchParams?.error === "locked" || lockState.locked ? (
<p className="mb-4 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300">
{copy.lockedLogin}
</p>
) : null}
<form action={loginAction} className="space-y-3">
<Label htmlFor="password">{copy.passwordLabel}</Label>
<Input id="password" type="password" name="password" required />
<Button type="submit" disabled={!authConfigured || !basicConfigured || lockState.locked}>
<LockKeyhole className="mr-2 h-4 w-4" />
{copy.loginButton}
</Button>
</form>
</CardContent>
</Card>
</MotionFade>
</div>
);
@@ -224,102 +230,102 @@ export default async function RootPage({ searchParams }: RootPageProps) {
{ label: copy.conversion, value: "4.8%", icon: BarChart3 },
];
const sidebarItems = [
{ label: copy.title, href: "/root", icon: LayoutDashboard, active: true },
{ label: copy.maintenanceTitle, href: "#maintenance", icon: ShieldAlert },
{ label: copy.updates, href: "#updates", icon: FolderKanban },
];
return (
<div className="mx-auto flex w-full max-w-6xl flex-col gap-8 px-4 py-10 sm:px-6 lg:px-8 lg:py-14">
<MotionFade>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-10">
<div className="flex flex-wrap items-center justify-between gap-3">
<h1 className="text-3xl font-semibold text-zinc-900 dark:text-zinc-100 sm:text-4xl">
{copy.title}
</h1>
<AppShell
sidebar={
<AppSidebar
title={copy.title}
description={copy.subtitle}
items={sidebarItems}
footer={
<form action={logoutAction}>
<button
type="submit"
className="inline-flex items-center gap-2 rounded-lg border border-zinc-300 px-3 py-2 text-sm font-medium text-zinc-700 transition hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-900"
>
<LogOut className="h-4 w-4" />
<Button type="submit" variant="outline" className="w-full justify-start">
<LogOut className="mr-2 h-4 w-4" />
{copy.logout}
</button>
</Button>
</form>
</div>
<p className="mt-4 max-w-3xl text-base text-zinc-600 dark:text-zinc-300 sm:text-lg">
{copy.subtitle}
</p>
}
/>
}
header={
<AppHeader
title={copy.title}
description={copy.subtitle}
actions={
<>
<Badge variant={maintenanceEnabled ? "warning" : "success"}>
{maintenanceEnabled ? copy.maintenanceOn : copy.maintenanceOff}
</Badge>
<Button asChild variant="outline">
<Link href={`/${localeKey}`}>
<ArrowLeft className="mr-2 h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
</>
}
/>
}
>
<div className="grid gap-6">
<MotionFade delay={0.05}>
<Card id="maintenance">
<CardHeader>
<CardTitle className="text-xl">{copy.maintenanceTitle}</CardTitle>
<CardDescription>{copy.maintenanceText}</CardDescription>
</CardHeader>
<CardContent>
<form action={updateMaintenanceMode}>
<input type="hidden" name="enabled" value={maintenanceEnabled ? "false" : "true"} />
<Button type="submit">
<Power className="mr-2 h-4 w-4" />
{maintenanceEnabled ? copy.disableMaintenance : copy.enableMaintenance}
</Button>
</form>
</CardContent>
</Card>
</MotionFade>
<section className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
{stats.map((item, index) => {
const Icon = item.icon;
return (
<MotionFade key={item.label} delay={index * 0.05}>
<Card>
<CardContent className="p-5">
<Icon className="h-5 w-5 text-muted-foreground" />
<p className="mt-3 text-sm text-muted-foreground">{item.label}</p>
<p className="mt-1 text-2xl font-semibold text-foreground">{item.value}</p>
</CardContent>
</Card>
</MotionFade>
);
})}
</section>
</MotionFade>
<MotionFade delay={0.05}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<div className="flex flex-wrap items-start justify-between gap-4">
<div>
<p className="inline-flex items-center gap-2 text-sm font-medium text-zinc-700 dark:text-zinc-200">
<ShieldAlert className="h-4 w-4" />
{copy.maintenanceTitle}
</p>
<p className="mt-2 max-w-2xl text-sm text-zinc-600 dark:text-zinc-300">
{copy.maintenanceText}
</p>
</div>
<span
className={`inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold ${
maintenanceEnabled
? "bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-200"
: "bg-emerald-100 text-emerald-800 dark:bg-emerald-900/40 dark:text-emerald-200"
}`}
>
{maintenanceEnabled ? copy.maintenanceOn : copy.maintenanceOff}
</span>
</div>
<form action={updateMaintenanceMode} className="mt-5">
<input
type="hidden"
name="enabled"
value={maintenanceEnabled ? "false" : "true"}
/>
<button
type="submit"
className="inline-flex items-center gap-2 rounded-lg border border-zinc-300 bg-zinc-900 px-4 py-2.5 text-sm font-medium text-white transition hover:bg-zinc-700 dark:border-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-zinc-300"
>
<Power className="h-4 w-4" />
{maintenanceEnabled ? copy.disableMaintenance : copy.enableMaintenance}
</button>
</form>
</section>
</MotionFade>
<section className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
{stats.map((item, index) => {
const Icon = item.icon;
return (
<MotionFade key={item.label} delay={index * 0.05}>
<article className="rounded-2xl border border-zinc-200 bg-white p-5 dark:border-zinc-800 dark:bg-zinc-950">
<Icon className="h-5 w-5 text-zinc-700 dark:text-zinc-200" />
<p className="mt-3 text-sm text-zinc-500 dark:text-zinc-400">{item.label}</p>
<p className="mt-1 text-2xl font-semibold text-zinc-900 dark:text-zinc-100">
{item.value}
</p>
</article>
</MotionFade>
);
})}
</section>
<MotionFade delay={0.1}>
<section className="rounded-3xl border border-zinc-200 bg-white p-6 dark:border-zinc-800 dark:bg-zinc-950 lg:p-8">
<h2 className="text-xl font-semibold text-zinc-900 dark:text-zinc-100">{copy.updates}</h2>
<ul className="mt-4 space-y-3">
{[copy.updateOne, copy.updateTwo, copy.updateThree].map((item) => (
<li
key={item}
className="rounded-xl border border-zinc-200 bg-zinc-50 px-4 py-3 text-sm text-zinc-700 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-200"
>
{item}
</li>
))}
</ul>
</section>
</MotionFade>
</div>
<MotionFade delay={0.1}>
<Card id="updates">
<CardHeader>
<CardTitle className="text-xl">{copy.updates}</CardTitle>
</CardHeader>
<CardContent>
<ul className="space-y-3">
{[copy.updateOne, copy.updateTwo, copy.updateThree].map((item) => (
<li key={item} className="rounded-[var(--radius-input)] border border-border bg-muted px-4 py-3 text-sm text-muted-foreground">
{item}
</li>
))}
</ul>
</CardContent>
</Card>
</MotionFade>
</div>
</AppShell>
);
}