Finalize multilingual routing and translations
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-07 14:10:30 +01:00
parent 1ad9ae9629
commit 7f4277d1d7
53 changed files with 2805 additions and 1382 deletions
+1
View File
@@ -28,6 +28,7 @@ yarn-error.log*
# local env files # local env files
.env .env
.env*.local .env*.local
docker-compose.override.yml
# vercel # vercel
.vercel .vercel
+80 -85
View File
@@ -1,7 +1,13 @@
import type { Metadata } from "next";
import { Compass, Layers3, Users } from "lucide-react"; import { Compass, Layers3, Users } from "lucide-react";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";
type AboutPageProps = { type AboutPageProps = {
params: { params: {
@@ -9,114 +15,103 @@ type AboutPageProps = {
}; };
}; };
export default function AboutPage({ params: { locale } }: AboutPageProps) { export async function generateMetadata({
params: { locale },
}: AboutPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
const copy = return buildLocalizedMetadata({
localeKey === "de" locale: localeKey,
? { pathname: "/about",
title: "Ueber uns", title: t("title"),
intro: description: t("intro"),
"Wir bauen klare digitale Erlebnisse fuer Marken, Produkte und Teams.", });
valuesTitle: "Wie wir arbeiten",
valueA: "Strategie zuerst",
valueAText: "Jedes Projekt startet mit Zielbild, Scope und Prioritaeten.",
valueB: "Saubere Systeme",
valueBText: "Wir setzen auf wartbare Komponenten und klare Strukturen.",
valueC: "Enge Zusammenarbeit",
valueCText: "Kurze Schleifen mit direktem Feedback im gesamten Ablauf.",
processTitle: "Unser Ablauf",
processOne: "Discovery und Zieldefinition",
processTwo: "Design und Prototyping",
processThree: "Build, Test und Launch",
} }
: {
title: "About", export default async function AboutPage({ params: { locale } }: AboutPageProps) {
intro: const localeKey = resolveLocale(locale);
"We build clear digital experiences for brands, products and teams.", const t = await getTranslations({ locale: localeKey, namespace: "aboutPage" });
valuesTitle: "How we work",
valueA: "Strategy first",
valueAText: "Each project starts with goals, scope and priorities.",
valueB: "Clean systems",
valueBText: "We rely on maintainable components and clear structure.",
valueC: "Close collaboration",
valueCText: "Short loops with direct feedback across the full process.",
processTitle: "Our process",
processOne: "Discovery and goal definition",
processTwo: "Design and prototyping",
processThree: "Build, test and launch",
};
return ( 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"> <Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade> <MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10"> <AppCard level={3}>
<h1 className="text-3xl font-semibold text-fg sm:text-4xl"> <CardContent className="p-6 lg:p-10">
{copy.title} <h1 className="text-3xl font-semibold text-foreground sm:text-4xl">
{t("title")}
</h1> </h1>
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg"> <p className="mt-4 max-w-3xl text-base text-muted-foreground sm:text-lg">
{copy.intro} {t("intro")}
</p> </p>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
<MotionFade delay={0.05}> <MotionFade delay={0.05}>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8"> <AppCard>
<h2 className="text-2xl font-semibold text-fg"> <CardContent className="p-6 lg:p-8">
{copy.valuesTitle} <h2 className="text-2xl font-semibold text-foreground">
{t("valuesTitle")}
</h2> </h2>
<div className="mt-6 grid gap-4 md:grid-cols-3"> <div className="mt-6 grid gap-4 md:grid-cols-3">
<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"> icon: Compass,
{copy.valueA} title: t("valueA"),
text: t("valueAText"),
},
{
icon: Layers3,
title: t("valueB"),
text: t("valueBText"),
},
{
icon: Users,
title: t("valueC"),
text: t("valueCText"),
},
].map((item) => {
const Icon = item.icon;
return (
<AppCard key={item.title} level={2}>
<CardContent className="p-5">
<Icon className="h-5 w-5 text-brand-primary" />
<h3 className="mt-3 text-lg font-semibold text-foreground">
{item.title}
</h3> </h3>
<p className="mt-2 text-sm text-muted"> <p className="mt-2 text-sm text-muted-foreground">{item.text}</p>
{copy.valueAText} </CardContent>
</p> </AppCard>
</article> );
<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-muted">
{copy.valueBText}
</p>
</article>
<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-muted">
{copy.valueCText}
</p>
</article>
</div> </div>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
<MotionFade delay={0.1}> <MotionFade delay={0.1}>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8"> <AppCard>
<h2 className="text-2xl font-semibold text-fg"> <CardContent className="p-6 lg:p-8">
{copy.processTitle} <h2 className="text-2xl font-semibold text-foreground">
{t("processTitle")}
</h2> </h2>
<ol className="mt-5 grid gap-3 sm:grid-cols-3"> <ol className="mt-5 grid gap-3 sm:grid-cols-3">
{[copy.processOne, copy.processTwo, copy.processThree].map((step, index) => ( {[t("processOne"), t("processTwo"), t("processThree")].map((step, index) => (
<li <AppCard key={step} level={2}>
key={step} <CardContent className="p-4">
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-pill bg-surface-1 text-xs font-semibold text-foreground/80">
>
<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} {index + 1}
</span> </span>
<p>{step}</p> <p className="text-sm text-foreground/80">{step}</p>
</li> </CardContent>
</AppCard>
))} ))}
</ol> </ol>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
</div> </Container>
); );
} }
+47 -54
View File
@@ -1,13 +1,18 @@
import type { Metadata } from "next";
import { Mail, MapPin, Phone } from "lucide-react"; import { Mail, MapPin, Phone } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { Button } from "@/src/components/ui/button"; import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { Card, CardContent, CardHeader, CardTitle } from "@/src/components/ui/card"; import { AppCard } from "@/components/ui/app-card";
import { Input } from "@/src/components/ui/input"; import { Button } from "@/components/ui/button";
import { Label } from "@/src/components/ui/label"; import { CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Textarea } from "@/src/components/ui/textarea"; import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
type ContactPageProps = { type ContactPageProps = {
params: { params: {
@@ -15,92 +20,80 @@ type ContactPageProps = {
}; };
}; };
export default function ContactPage({ params: { locale } }: ContactPageProps) { export async function generateMetadata({
params: { locale },
}: ContactPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "contactPage" });
const copy = return buildLocalizedMetadata({
localeKey === "de" locale: localeKey,
? { pathname: "/contact",
title: "Kontakt", title: t("title"),
intro: "Schreib uns kurz dein Ziel und wir melden uns zeitnah.", description: t("intro"),
name: "Name", });
email: "E-Mail",
message: "Nachricht",
submit: "Senden",
preview: "Success Seite ansehen",
phone: "+49 30 123456",
mail: "hello@moh-sass.dev",
city: "Berlin, Germany",
} }
: {
title: "Contact", export default async function ContactPage({ params: { locale } }: ContactPageProps) {
intro: "Share your goal and we will get back quickly.", const localeKey = resolveLocale(locale);
name: "Name", const t = await getTranslations({ locale: localeKey, namespace: "contactPage" });
email: "Email",
message: "Message",
submit: "Submit",
preview: "Open success page",
phone: "+49 30 123456",
mail: "hello@moh-sass.dev",
city: "Berlin, Germany",
};
return ( 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"> <Container className="grid gap-6 py-10 lg:grid-cols-2 lg:py-14">
<MotionFade> <MotionFade>
<Card> <AppCard level={3}>
<CardHeader> <CardHeader>
<CardTitle className="text-3xl sm:text-4xl">{copy.title}</CardTitle> <CardTitle className="text-3xl sm:text-4xl">{t("title")}</CardTitle>
<p className="text-base text-muted-foreground sm:text-lg">{copy.intro}</p> <p className="text-base text-muted-foreground sm:text-lg">{t("intro")}</p>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
<ul className="space-y-3 text-sm text-foreground/85"> <ul className="space-y-3 text-sm text-foreground/85">
<li className="inline-flex items-center gap-2"> <li className="inline-flex items-center gap-2">
<Phone className="h-4 w-4" /> <Phone className="h-4 w-4 text-brand-primary" />
{copy.phone} +49 30 123456
</li> </li>
<li className="inline-flex items-center gap-2"> <li className="inline-flex items-center gap-2">
<Mail className="h-4 w-4" /> <Mail className="h-4 w-4 text-brand-primary" />
{copy.mail} hello@moh-sass.dev
</li> </li>
<li className="inline-flex items-center gap-2"> <li className="inline-flex items-center gap-2">
<MapPin className="h-4 w-4" /> <MapPin className="h-4 w-4 text-brand-primary" />
{copy.city} {t("city")}
</li> </li>
</ul> </ul>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
<MotionFade delay={0.05}> <MotionFade delay={0.05}>
<Card> <AppCard>
<CardContent className="pt-6"> <CardContent className="pt-6">
<form className="grid gap-4"> <form className="grid gap-4">
<Label className="grid gap-2"> <Label className="grid gap-2">
{copy.name} {t("name")}
<Input type="text" placeholder={copy.name} /> <Input type="text" placeholder={t("name")} />
</Label> </Label>
<Label className="grid gap-2"> <Label className="grid gap-2">
{copy.email} {t("email")}
<Input type="email" placeholder={copy.email} /> <Input type="email" placeholder={t("email")} />
</Label> </Label>
<Label className="grid gap-2"> <Label className="grid gap-2">
{copy.message} {t("message")}
<Textarea rows={5} placeholder={copy.message} /> <Textarea rows={5} placeholder={t("message")} />
</Label> </Label>
<div className="flex flex-wrap gap-3"> <div className="flex flex-wrap gap-3">
<Button type="button">{copy.submit}</Button> <Button type="button">{t("submit")}</Button>
<Button asChild variant="outline"> <Button asChild variant="outline">
<Link href={`/${localeKey}/success`}>{copy.preview}</Link> <Link href={getLocalizedPath(localeKey, "/success")}>{t("preview")}</Link>
</Button> </Button>
</div> </div>
</form> </form>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
</div> </Container>
); );
} }
+6 -6
View File
@@ -2,11 +2,11 @@ import type { ReactNode } from "react";
import { unstable_noStore as noStore } from "next/cache"; import { unstable_noStore as noStore } from "next/cache";
import { redirect } from "next/navigation"; import { redirect } from "next/navigation";
import { Footer } from "@/components/footer"; import { SiteFooter } from "@/components/layout/site-footer";
import { Navbar } from "@/components/navbar"; import { SiteHeader } from "@/components/layout/site-header";
import { isAdminAuthenticated } from "@/lib/admin-auth"; import { isAdminAuthenticated } from "@/lib/admin-auth";
import { getMaintenanceMode } from "@/lib/app-config"; import { getMaintenanceMode } from "@/lib/app-config";
import { resolveLocale } from "@/lib/site-data"; import { getLocalizedPath, resolveLocale } from "@/lib/locale";
type SiteLayoutProps = { type SiteLayoutProps = {
children: ReactNode; children: ReactNode;
@@ -26,14 +26,14 @@ export default async function SiteLayout({ children, params: { locale } }: SiteL
const authenticated = isAdminAuthenticated(); const authenticated = isAdminAuthenticated();
if (maintenanceEnabled && !authenticated) { if (maintenanceEnabled && !authenticated) {
redirect(`/${localeKey}/coming-soon`); redirect(getLocalizedPath(localeKey, "/coming-soon"));
} }
return ( return (
<div className="flex min-h-screen flex-col"> <div className="flex min-h-screen flex-col">
<Navbar isAdmin={authenticated} /> <SiteHeader isAdmin={authenticated} />
<main className="flex-1">{children}</main> <main className="flex-1">{children}</main>
<Footer isAdmin={authenticated} /> <SiteFooter isAdmin={authenticated} />
</div> </div>
); );
} }
+92 -102
View File
@@ -1,3 +1,4 @@
import type { Metadata } from "next";
import { import {
ArrowRight, ArrowRight,
BriefcaseBusiness, BriefcaseBusiness,
@@ -6,11 +7,16 @@ import {
Sparkles, Sparkles,
} from "lucide-react"; } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { pickText, portfolioItems, productItems, resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { Button } from "@/src/components/ui/button"; import { AppCard } from "@/components/ui/app-card";
import { Card, CardContent } from "@/src/components/ui/card"; import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { pickText, portfolioItems, productItems } from "@/lib/site-data";
type HomePageProps = { type HomePageProps = {
params: { params: {
@@ -18,194 +24,178 @@ type HomePageProps = {
}; };
}; };
export default function HomePage({ params: { locale } }: HomePageProps) { export async function generateMetadata({
params: { locale },
}: HomePageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "homepage" });
return buildLocalizedMetadata({
locale: localeKey,
pathname: "/",
title: t("heroTitle"),
description: t("heroText"),
});
}
export default async function HomePage({ params: { locale } }: HomePageProps) {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const featuredProjects = portfolioItems.slice(0, 3); const featuredProjects = portfolioItems.slice(0, 3);
const featuredProducts = productItems.slice(0, 3); const featuredProducts = productItems.slice(0, 3);
const t = await getTranslations({ locale: localeKey, namespace: "homepage" });
const copy =
localeKey === "de"
? {
heroKicker: "Digital Studio",
heroTitle: "Webseiten und Produkte, die schnell liefern.",
heroText:
"Diese Startseite ist die Basis fuer ein mehrsprachiges Marketing- und Produkt-Setup.",
portfolioTitle: "Featured Projects",
portfolioText: "Platzhalter fuer ausgewaehlte Kundenprojekte.",
productsTitle: "Featured Products",
productsText: "Platzhalter fuer die wichtigsten Produktangebote.",
ctaTitle: "Bereit fuer den naechsten Schritt?",
ctaText: "Wir planen zusammen den passenden Scope fuer dein Projekt.",
toPortfolio: "Portfolio ansehen",
toProducts: "Produkte ansehen",
toContact: "Kontakt aufnehmen",
heroCardTitle: "Schneller Rollout",
heroCardText: "Struktur, Content und Komponenten fuer schnelles Wachstum.",
}
: {
heroKicker: "Digital Studio",
heroTitle: "Websites and products that ship fast.",
heroText:
"This homepage is a starter for a multilingual marketing and product setup.",
portfolioTitle: "Featured Projects",
portfolioText: "Placeholder area for highlighted client projects.",
productsTitle: "Featured Products",
productsText: "Placeholder area for top product offerings.",
ctaTitle: "Ready for your next step?",
ctaText: "We can shape the right project scope together.",
toPortfolio: "View portfolio",
toProducts: "View products",
toContact: "Contact us",
heroCardTitle: "Fast rollout",
heroCardText: "Structure, content and components for rapid growth.",
};
return ( 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"> <Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade> <MotionFade>
<Card> <AppCard level={3}>
<CardContent className="grid gap-6 p-6 lg:grid-cols-[1.3fr_0.7fr] lg:p-10"> <CardContent className="grid gap-6 p-6 lg:grid-cols-[1.35fr_0.65fr] lg:p-10">
<div className="space-y-5"> <div className="space-y-5">
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted"> <p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<Sparkles className="h-4 w-4" /> <Sparkles className="h-4 w-4 text-brand-secondary" />
{copy.heroKicker} {t("heroKicker")}
</p> </p>
<h1 className="text-3xl font-semibold tracking-tight text-fg sm:text-5xl"> <h1 className="text-balance text-3xl font-semibold tracking-tight text-foreground sm:text-5xl">
{copy.heroTitle} {t("heroTitle")}
</h1> </h1>
<p className="max-w-2xl text-base text-muted sm:text-lg"> <p className="max-w-2xl text-base text-muted-foreground sm:text-lg">
{copy.heroText} {t("heroText")}
</p> </p>
<div className="flex flex-wrap gap-3"> <div className="flex flex-wrap gap-3">
<Button asChild> <Button asChild>
<Link href={`/${localeKey}/portfolio`}> <Link href={getLocalizedPath(localeKey, "/portfolio")}>
{copy.toPortfolio} {t("toPortfolio")}
<ArrowRight className="h-4 w-4" /> <ArrowRight className="h-4 w-4" />
</Link> </Link>
</Button> </Button>
<Button asChild variant="outline"> <Button asChild variant="outline">
<Link href={`/${localeKey}/products`}>{copy.toProducts}</Link> <Link href={getLocalizedPath(localeKey, "/products")}>{t("toProducts")}</Link>
</Button> </Button>
</div> </div>
</div> </div>
<div className="rounded-[var(--radius-input)] border border-border bg-muted p-5"> <AppCard level={2} padding="md" className="self-start">
<p className="mb-3 inline-flex items-center gap-2 text-sm font-medium text-muted"> <p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<BriefcaseBusiness className="h-4 w-4" /> <BriefcaseBusiness className="h-4 w-4 text-brand-primary" />
{copy.heroCardTitle} {t("heroCardTitle")}
</p> </p>
<p className="text-sm leading-relaxed text-muted"> <p className="mt-3 text-sm leading-relaxed text-muted-foreground">
{copy.heroCardText} {t("heroCardText")}
</p> </p>
</div> </AppCard>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
<MotionFade delay={0.05}> <MotionFade delay={0.05}>
<Card> <AppCard>
<CardContent className="p-6 lg:p-8"> <CardContent className="p-6 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4"> <div className="mb-6 flex items-center justify-between gap-4">
<div> <div>
<h2 className="text-2xl font-semibold text-fg"> <h2 className="text-2xl font-semibold text-foreground">
{copy.portfolioTitle} {t("portfolioTitle")}
</h2> </h2>
<p className="mt-2 text-sm text-muted"> <p className="mt-2 text-sm text-muted-foreground">
{copy.portfolioText} {t("portfolioText")}
</p> </p>
</div> </div>
<BriefcaseBusiness className="h-5 w-5 text-subtle" /> <BriefcaseBusiness className="h-5 w-5 text-muted-foreground" />
</div> </div>
<div className="grid gap-4 md:grid-cols-3"> <div className="grid gap-4 md:grid-cols-3">
{featuredProjects.map((item) => ( {featuredProjects.map((item) => (
<Card key={item.slug} className="bg-muted/85 transition hover:border-input"> <AppCard key={item.slug} interactive>
<CardContent className="p-4"> <CardContent className="p-5">
<Link href={`/${localeKey}/portfolio/${item.slug}`} className="group block"> <Link
<p className="text-sm text-subtle"> href={getLocalizedPath(localeKey, `/portfolio/${item.slug}`)}
className="group block"
>
<p className="text-sm text-muted-foreground/80">
{pickText(item.category, localeKey)} - {item.year} {pickText(item.category, localeKey)} - {item.year}
</p> </p>
<h3 className="mt-2 text-lg font-semibold text-fg"> <h3 className="mt-2 text-lg font-semibold text-foreground">
{pickText(item.title, localeKey)} {pickText(item.title, localeKey)}
</h3> </h3>
<p className="mt-2 text-sm text-muted"> <p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)} {pickText(item.summary, localeKey)}
</p> </p>
<span className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong"> <span className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80 group-hover:text-foreground">
{copy.toPortfolio} {t("toPortfolio")}
<ArrowRight className="h-4 w-4" /> <ArrowRight className="h-4 w-4" />
</span> </span>
</Link> </Link>
</CardContent> </CardContent>
</Card> </AppCard>
))} ))}
</div> </div>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
<MotionFade delay={0.1}> <MotionFade delay={0.1}>
<Card> <AppCard>
<CardContent className="p-6 lg:p-8"> <CardContent className="p-6 lg:p-8">
<div className="mb-6 flex items-center justify-between gap-4"> <div className="mb-6 flex items-center justify-between gap-4">
<div> <div>
<h2 className="text-2xl font-semibold text-fg"> <h2 className="text-2xl font-semibold text-foreground">
{copy.productsTitle} {t("productsTitle")}
</h2> </h2>
<p className="mt-2 text-sm text-muted"> <p className="mt-2 text-sm text-muted-foreground">
{copy.productsText} {t("productsText")}
</p> </p>
</div> </div>
<Boxes className="h-5 w-5 text-subtle" /> <Boxes className="h-5 w-5 text-muted-foreground" />
</div> </div>
<div className="grid gap-4 md:grid-cols-3"> <div className="grid gap-4 md:grid-cols-3">
{featuredProducts.map((item) => ( {featuredProducts.map((item) => (
<Card key={item.slug} className="bg-muted/85 transition hover:border-input"> <AppCard key={item.slug} interactive>
<CardContent className="p-4"> <CardContent className="p-5">
<Link href={`/${localeKey}/products/${item.slug}`} className="group block"> <Link
<p className="text-sm text-subtle"> href={getLocalizedPath(localeKey, `/products/${item.slug}`)}
className="group block"
>
<p className="text-sm text-muted-foreground/80">
{pickText(item.segment, localeKey)} {pickText(item.segment, localeKey)}
</p> </p>
<h3 className="mt-2 text-lg font-semibold text-fg"> <h3 className="mt-2 text-lg font-semibold text-foreground">
{pickText(item.name, localeKey)} {pickText(item.name, localeKey)}
</h3> </h3>
<p className="mt-2 text-sm text-muted"> <p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)} {pickText(item.summary, localeKey)}
</p> </p>
<p className="mt-3 text-sm font-medium text-muted-strong"> <p className="mt-3 text-sm font-medium text-foreground/80">
{pickText(item.price, localeKey)} {pickText(item.price, localeKey)}
</p> </p>
</Link> </Link>
</CardContent> </CardContent>
</Card> </AppCard>
))} ))}
</div> </div>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
<MotionFade delay={0.15}> <MotionFade delay={0.15}>
<Card className="bg-foreground text-background"> <AppCard level="inverse">
<CardContent className="p-6 lg:p-8"> <CardContent className="p-6 lg:p-8">
<div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between"> <div className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<div> <div>
<p className="inline-flex items-center gap-2 text-sm font-medium opacity-80"> <p className="inline-flex items-center gap-2 text-sm font-medium text-surface-inverse-foreground/80">
<Mail className="h-4 w-4" /> <Mail className="h-4 w-4" />
{copy.ctaTitle} {t("ctaTitle")}
</p> </p>
<p className="mt-2 max-w-2xl text-sm opacity-90 sm:text-base"> <p className="mt-2 max-w-2xl text-sm text-surface-inverse-foreground/88 sm:text-base">
{copy.ctaText} {t("ctaText")}
</p> </p>
</div> </div>
<Button asChild variant="secondary"> <Button asChild variant="secondary">
<Link href={`/${localeKey}/contact`}> <Link href={getLocalizedPath(localeKey, "/contact")}>
{copy.toContact} {t("toContact")}
<ArrowRight className="h-4 w-4" /> <ArrowRight className="h-4 w-4" />
</Link> </Link>
</Button> </Button>
</div> </div>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
</div> </Container>
); );
} }
+95 -81
View File
@@ -1,10 +1,18 @@
import type { Metadata } from "next";
import { ArrowLeft, CalendarDays, FolderKanban, Tag } from "lucide-react"; import { ArrowLeft, CalendarDays, FolderKanban, Tag } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { routing } from "@/i18n/routing"; import { routing } from "@/i18n/routing";
import { getPortfolioItem, pickText, portfolioItems, resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { getPortfolioItem, pickText, portfolioItems } from "@/lib/site-data";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type PortfolioItemPageProps = { type PortfolioItemPageProps = {
params: { params: {
@@ -22,7 +30,30 @@ export function generateStaticParams() {
); );
} }
export default function PortfolioItemPage({ export async function generateMetadata({
params: { locale, slug },
}: PortfolioItemPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const item = getPortfolioItem(slug);
if (!item) {
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/portfolio/${slug}`,
title: "Portfolio",
description: "Portfolio item",
});
}
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/portfolio/${slug}`,
title: pickText(item.title, localeKey),
description: pickText(item.summary, localeKey),
});
}
export default async function PortfolioItemPage({
params: { locale, slug }, params: { locale, slug },
}: PortfolioItemPageProps) { }: PortfolioItemPageProps) {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
@@ -32,100 +63,83 @@ export default function PortfolioItemPage({
notFound(); notFound();
} }
const copy = const t = await getTranslations({ locale: localeKey, namespace: "portfolioDetail" });
localeKey === "de"
? {
back: "Zurueck zum Portfolio",
challenge: "Herausforderung",
solution: "Loesung",
outcome: "Ergebnis",
challengeText:
"Das Projekt brauchte eine klare Informationsarchitektur und schnellere Ladezeiten.",
solutionText:
"Wir haben Design, Komponenten und Content in einem modularen System aufgebaut.",
outcomeText:
"Das Team kann Inhalte schneller ausrollen und Nutzer finden schneller zum Ziel.",
}
: {
back: "Back to portfolio",
challenge: "Challenge",
solution: "Solution",
outcome: "Outcome",
challengeText:
"The project needed clearer information architecture and faster performance.",
solutionText:
"We built design, components and content in a modular system.",
outcomeText:
"The team ships content faster and users reach goals more quickly.",
};
return ( 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"> <Container size="wide" className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade> <MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10"> <AppCard level={3}>
<Link <CardContent className="p-6 lg:p-10">
href={`/${localeKey}/portfolio`} <Button asChild variant="ghost" className="h-auto px-0 py-0 text-sm">
className="inline-flex items-center gap-2 text-sm text-muted transition hover:text-fg" <Link href={getLocalizedPath(localeKey, "/portfolio")}>
>
<ArrowLeft className="h-4 w-4" /> <ArrowLeft className="h-4 w-4" />
{copy.back} {t("back")}
</Link> </Link>
<h1 className="mt-5 text-3xl font-semibold text-fg sm:text-4xl"> </Button>
<h1 className="mt-5 text-3xl font-semibold text-foreground sm:text-4xl">
{pickText(item.title, localeKey)} {pickText(item.title, localeKey)}
</h1> </h1>
<p className="mt-4 text-base text-muted sm:text-lg"> <p className="mt-4 text-base text-muted-foreground sm:text-lg">
{pickText(item.summary, localeKey)} {pickText(item.summary, localeKey)}
</p> </p>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-muted"> <div className="mt-6 flex flex-wrap gap-3 text-sm text-foreground/80">
<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)} icon: Tag,
</span> label: pickText(item.category, localeKey),
<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} icon: CalendarDays,
</span> label: item.year,
<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} icon: FolderKanban,
</span> label: item.slug,
},
].map((meta) => {
const Icon = meta.icon;
return (
<AppCard key={meta.label} level={2}>
<CardContent className="flex items-center gap-2 p-3">
<Icon className="h-4 w-4 text-brand-primary" />
{meta.label}
</CardContent>
</AppCard>
);
})}
</div> </div>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
<div className="grid gap-4 md:grid-cols-3"> <div className="grid gap-4 md:grid-cols-3">
<MotionFade delay={0.05}> {[
<article className="rounded-2xl border border-default bg-surface p-5 "> {
<h2 className="text-lg font-semibold text-fg"> title: t("challenge"),
{copy.challenge} text: t("challengeText"),
</h2> },
<p className="mt-2 text-sm text-muted"> {
{copy.challengeText} title: t("solution"),
</p> text: t("solutionText"),
</article> },
</MotionFade> {
<MotionFade delay={0.1}> title: t("outcome"),
<article className="rounded-2xl border border-default bg-surface p-5 "> text: t("outcomeText"),
<h2 className="text-lg font-semibold text-fg"> },
{copy.solution} ].map((section, index) => (
</h2> <MotionFade key={section.title} delay={0.05 * (index + 1)}>
<p className="mt-2 text-sm text-muted"> <AppCard>
{copy.solutionText} <CardContent className="p-5">
</p> <h2 className="text-lg font-semibold text-foreground">{section.title}</h2>
</article> <p className="mt-2 text-sm text-muted-foreground">{section.text}</p>
</MotionFade> </CardContent>
<MotionFade delay={0.15}> </AppCard>
<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-muted">
{copy.outcomeText}
</p>
</article>
</MotionFade> </MotionFade>
))}
</div> </div>
</div> </Container>
); );
} }
+45 -30
View File
@@ -1,8 +1,15 @@
import type { Metadata } from "next";
import { ArrowUpRight, CalendarDays, FolderKanban } from "lucide-react"; import { ArrowUpRight, CalendarDays, FolderKanban } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { pickText, portfolioItems, resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { pickText, portfolioItems } from "@/lib/site-data";
type PortfolioPageProps = { type PortfolioPageProps = {
params: { params: {
@@ -10,68 +17,76 @@ type PortfolioPageProps = {
}; };
}; };
export default function PortfolioPage({ params: { locale } }: PortfolioPageProps) { export async function generateMetadata({
params: { locale },
}: PortfolioPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
const copy = return buildLocalizedMetadata({
localeKey === "de" locale: localeKey,
? { pathname: "/portfolio",
title: "Portfolio", title: t("title"),
intro: "Eine Auswahl von Projekten mit Fokus auf Klarheit und Ergebnis.", description: t("intro"),
open: "Projekt oeffnen", });
} }
: {
title: "Portfolio", export default async function PortfolioPage({ params: { locale } }: PortfolioPageProps) {
intro: "Selected projects with a focus on clarity and outcomes.", const localeKey = resolveLocale(locale);
open: "Open project", const t = await getTranslations({ locale: localeKey, namespace: "portfolioPage" });
};
return ( 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"> <Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade> <MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10"> <AppCard level={3}>
<CardContent className="p-6 lg:p-10">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<FolderKanban className="h-5 w-5 text-muted-strong" /> <FolderKanban className="h-5 w-5 text-brand-primary" />
<h1 className="text-3xl font-semibold text-fg sm:text-4xl"> <h1 className="text-3xl font-semibold text-foreground sm:text-4xl">
{copy.title} {t("title")}
</h1> </h1>
</div> </div>
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg"> <p className="mt-4 max-w-3xl text-base text-muted-foreground sm:text-lg">
{copy.intro} {t("intro")}
</p> </p>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
<section className="grid gap-4 md:grid-cols-2"> <section className="grid gap-4 md:grid-cols-2">
{portfolioItems.map((item, index) => ( {portfolioItems.map((item, index) => (
<MotionFade key={item.slug} delay={index * 0.05}> <MotionFade key={item.slug} delay={index * 0.05}>
<AppCard interactive>
<CardContent className="p-5">
<Link <Link
href={`/${localeKey}/portfolio/${item.slug}`} href={getLocalizedPath(localeKey, `/portfolio/${item.slug}`)}
className="group block rounded-2xl border border-default bg-surface p-5 transition group-hover-border-strong " className="group block"
> >
<div className="flex items-center justify-between gap-3"> <div className="flex items-center justify-between gap-3">
<p className="text-sm text-subtle"> <p className="text-sm text-muted-foreground/80">
{pickText(item.category, localeKey)} {pickText(item.category, localeKey)}
</p> </p>
<p className="inline-flex items-center gap-1 text-xs text-subtle"> <p className="inline-flex items-center gap-1 text-xs text-muted-foreground/80">
<CalendarDays className="h-3.5 w-3.5" /> <CalendarDays className="h-3.5 w-3.5" />
{item.year} {item.year}
</p> </p>
</div> </div>
<h2 className="mt-3 text-xl font-semibold text-fg"> <h2 className="mt-3 text-xl font-semibold text-foreground">
{pickText(item.title, localeKey)} {pickText(item.title, localeKey)}
</h2> </h2>
<p className="mt-2 text-sm text-muted"> <p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)} {pickText(item.summary, localeKey)}
</p> </p>
<p className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong"> <p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80 group-hover:text-foreground">
{copy.open} {t("open")}
<ArrowUpRight className="h-4 w-4" /> <ArrowUpRight className="h-4 w-4" />
</p> </p>
</Link> </Link>
</CardContent>
</AppCard>
</MotionFade> </MotionFade>
))} ))}
</section> </section>
</div> </Container>
); );
} }
+87 -63
View File
@@ -1,10 +1,18 @@
import type { Metadata } from "next";
import { ArrowLeft, BadgeEuro, Boxes, Layers2 } from "lucide-react"; import { ArrowLeft, BadgeEuro, Boxes, Layers2 } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { routing } from "@/i18n/routing"; import { routing } from "@/i18n/routing";
import { getProductItem, pickText, productItems, resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { getProductItem, pickText, productItems } from "@/lib/site-data";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type ProductPageProps = { type ProductPageProps = {
params: { params: {
@@ -22,7 +30,30 @@ export function generateStaticParams() {
); );
} }
export default function ProductPage({ params: { locale, slug } }: ProductPageProps) { export async function generateMetadata({
params: { locale, slug },
}: ProductPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale);
const item = getProductItem(slug);
if (!item) {
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/products/${slug}`,
title: "Products",
description: "Product page",
});
}
return buildLocalizedMetadata({
locale: localeKey,
pathname: `/products/${slug}`,
title: pickText(item.name, localeKey),
description: pickText(item.summary, localeKey),
});
}
export default async function ProductPage({ params: { locale, slug } }: ProductPageProps) {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const item = getProductItem(slug); const item = getProductItem(slug);
@@ -30,87 +61,80 @@ export default function ProductPage({ params: { locale, slug } }: ProductPagePro
notFound(); notFound();
} }
const copy = const t = await getTranslations({ locale: localeKey, namespace: "productDetail" });
localeKey === "de"
? {
back: "Zurueck zu Produkten",
included: "Inklusive",
stepOne: "Kickoff und Scope Klarheit",
stepTwo: "Setup von Design und Komponenten",
stepThree: "Implementierung und Uebergabe",
action: "Kontakt fuer Angebot",
}
: {
back: "Back to products",
included: "Included",
stepOne: "Kickoff and scope clarity",
stepTwo: "Design and component setup",
stepThree: "Implementation and handover",
action: "Contact for proposal",
};
return ( 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"> <Container size="wide" className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade> <MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10"> <AppCard level={3}>
<Link <CardContent className="p-6 lg:p-10">
href={`/${localeKey}/products`} <Button asChild variant="ghost" className="h-auto px-0 py-0 text-sm">
className="inline-flex items-center gap-2 text-sm text-muted transition hover:text-fg" <Link href={getLocalizedPath(localeKey, "/products")}>
>
<ArrowLeft className="h-4 w-4" /> <ArrowLeft className="h-4 w-4" />
{copy.back} {t("back")}
</Link> </Link>
</Button>
<h1 className="mt-5 text-3xl font-semibold text-fg sm:text-4xl"> <h1 className="mt-5 text-3xl font-semibold text-foreground sm:text-4xl">
{pickText(item.name, localeKey)} {pickText(item.name, localeKey)}
</h1> </h1>
<p className="mt-4 text-base text-muted sm:text-lg"> <p className="mt-4 text-base text-muted-foreground sm:text-lg">
{pickText(item.summary, localeKey)} {pickText(item.summary, localeKey)}
</p> </p>
<div className="mt-6 flex flex-wrap gap-3 text-sm text-muted"> <div className="mt-6 flex flex-wrap gap-3 text-sm text-foreground/80">
<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)} icon: Layers2,
</span> label: pickText(item.segment, localeKey),
<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)} icon: BadgeEuro,
</span> label: pickText(item.price, localeKey),
<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} icon: Boxes,
</span> label: item.slug,
},
].map((meta) => {
const Icon = meta.icon;
return (
<AppCard key={meta.label} level={2}>
<CardContent className="flex items-center gap-2 p-3">
<Icon className="h-4 w-4 text-brand-primary" />
{meta.label}
</CardContent>
</AppCard>
);
})}
</div> </div>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
<MotionFade delay={0.05}> <MotionFade delay={0.05}>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-8"> <AppCard>
<h2 className="text-xl font-semibold text-fg"> <CardContent className="p-6 lg:p-8">
{copy.included} <h2 className="text-xl font-semibold text-foreground">{t("included")}</h2>
</h2>
<ul className="mt-4 grid gap-3 sm:grid-cols-3"> <ul className="mt-4 grid gap-3 sm:grid-cols-3">
{[copy.stepOne, copy.stepTwo, copy.stepThree].map((step, index) => ( {[t("stepOne"), t("stepTwo"), t("stepThree")].map((step, index) => (
<li <AppCard key={step} level={2}>
key={step} <CardContent className="p-4">
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-pill bg-surface-1 text-xs font-semibold text-foreground/80">
>
<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} {index + 1}
</span> </span>
<p>{step}</p> <p className="text-sm text-foreground/80">{step}</p>
</li> </CardContent>
</AppCard>
))} ))}
</ul> </ul>
<Link <Button asChild className="mt-6">
href={`/${localeKey}/contact`} <Link href={getLocalizedPath(localeKey, "/contact")}>{t("action")}</Link>
className="mt-6 inline-flex rounded-lg bg-inverse px-4 py-2.5 text-sm font-medium text-inverse transition hover:opacity-90 " </Button>
> </CardContent>
{copy.action} </AppCard>
</Link>
</section>
</MotionFade> </MotionFade>
</div> </Container>
); );
} }
+46 -31
View File
@@ -1,8 +1,15 @@
import type { Metadata } from "next";
import { ArrowUpRight, Boxes, CircleDollarSign } from "lucide-react"; import { ArrowUpRight, Boxes, CircleDollarSign } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { pickText, productItems, resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { pickText, productItems } from "@/lib/site-data";
type ProductsPageProps = { type ProductsPageProps = {
params: { params: {
@@ -10,66 +17,74 @@ type ProductsPageProps = {
}; };
}; };
export default function ProductsPage({ params: { locale } }: ProductsPageProps) { export async function generateMetadata({
params: { locale },
}: ProductsPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "productsPage" });
const copy = return buildLocalizedMetadata({
localeKey === "de" locale: localeKey,
? { pathname: "/products",
title: "Produkte", title: t("title"),
intro: "Pakete fuer Teams von Start bis Skalierung.", description: t("intro"),
open: "Produkt oeffnen", });
} }
: {
title: "Products", export default async function ProductsPage({ params: { locale } }: ProductsPageProps) {
intro: "Packages for teams from early stage to scale.", const localeKey = resolveLocale(locale);
open: "Open product", const t = await getTranslations({ locale: localeKey, namespace: "productsPage" });
};
return ( 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"> <Container className="flex flex-col gap-section py-10 lg:py-14">
<MotionFade> <MotionFade>
<section className="rounded-3xl border border-default bg-surface p-6 lg:p-10"> <AppCard level={3}>
<CardContent className="p-6 lg:p-10">
<div className="flex items-center gap-3"> <div className="flex items-center gap-3">
<Boxes className="h-5 w-5 text-muted-strong" /> <Boxes className="h-5 w-5 text-brand-primary" />
<h1 className="text-3xl font-semibold text-fg sm:text-4xl"> <h1 className="text-3xl font-semibold text-foreground sm:text-4xl">
{copy.title} {t("title")}
</h1> </h1>
</div> </div>
<p className="mt-4 max-w-3xl text-base text-muted sm:text-lg"> <p className="mt-4 max-w-3xl text-base text-muted-foreground sm:text-lg">
{copy.intro} {t("intro")}
</p> </p>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
<section className="grid gap-4 md:grid-cols-3"> <section className="grid gap-4 md:grid-cols-3">
{productItems.map((item, index) => ( {productItems.map((item, index) => (
<MotionFade key={item.slug} delay={index * 0.05}> <MotionFade key={item.slug} delay={index * 0.05}>
<AppCard interactive>
<CardContent className="p-5">
<Link <Link
href={`/${localeKey}/products/${item.slug}`} href={getLocalizedPath(localeKey, `/products/${item.slug}`)}
className="group block rounded-2xl border border-default bg-surface p-5 transition group-hover-border-strong " className="group block"
> >
<p className="text-sm text-subtle"> <p className="text-sm text-muted-foreground/80">
{pickText(item.segment, localeKey)} {pickText(item.segment, localeKey)}
</p> </p>
<h2 className="mt-3 text-xl font-semibold text-fg"> <h2 className="mt-3 text-xl font-semibold text-foreground">
{pickText(item.name, localeKey)} {pickText(item.name, localeKey)}
</h2> </h2>
<p className="mt-2 text-sm text-muted"> <p className="mt-2 text-sm text-muted-foreground">
{pickText(item.summary, localeKey)} {pickText(item.summary, localeKey)}
</p> </p>
<p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong"> <p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80">
<CircleDollarSign className="h-4 w-4" /> <CircleDollarSign className="h-4 w-4 text-brand-secondary" />
{pickText(item.price, localeKey)} {pickText(item.price, localeKey)}
</p> </p>
<p className="group-hover-fg mt-4 inline-flex items-center gap-2 text-sm font-medium text-muted-strong"> <p className="mt-4 inline-flex items-center gap-2 text-sm font-medium text-foreground/80 group-hover:text-foreground">
{copy.open} {t("open")}
<ArrowUpRight className="h-4 w-4" /> <ArrowUpRight className="h-4 w-4" />
</p> </p>
</Link> </Link>
</CardContent>
</AppCard>
</MotionFade> </MotionFade>
))} ))}
</section> </section>
</div> </Container>
); );
} }
+39 -36
View File
@@ -1,8 +1,15 @@
import type { Metadata } from "next";
import { CheckCircle2 } from "lucide-react"; import { CheckCircle2 } from "lucide-react";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type SuccessPageProps = { type SuccessPageProps = {
params: { params: {
@@ -10,51 +17,47 @@ type SuccessPageProps = {
}; };
}; };
export default function SuccessPage({ params: { locale } }: SuccessPageProps) { export async function generateMetadata({
params: { locale },
}: SuccessPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
const copy = return buildLocalizedMetadata({
localeKey === "de" locale: localeKey,
? { pathname: "/success",
title: "Danke fuer deine Nachricht", title: t("title"),
text: "Wir haben deine Anfrage erhalten und melden uns zeitnah.", description: t("text"),
home: "Zur Startseite", });
contact: "Zur Kontaktseite",
} }
: {
title: "Thank you for your message", export default async function SuccessPage({ params: { locale } }: SuccessPageProps) {
text: "We received your request and will reply shortly.", const localeKey = resolveLocale(locale);
home: "Go to homepage", const t = await getTranslations({ locale: localeKey, namespace: "successPage" });
contact: "Back to contact",
};
return ( return (
<div className="mx-auto flex w-full max-w-4xl px-4 py-12 sm:px-6 lg:px-8 lg:py-16"> <Container size="narrow" className="py-12 lg:py-16">
<MotionFade className="w-full"> <MotionFade className="w-full">
<section className="w-full rounded-3xl border border-default bg-surface p-8 text-center "> <AppCard level={3}>
<CheckCircle2 className="mx-auto h-12 w-12 text-emerald-500" /> <CardContent className="p-8 text-center">
<h1 className="mt-4 text-3xl font-semibold text-fg sm:text-4xl"> <CheckCircle2 className="mx-auto h-12 w-12 text-status-success" />
{copy.title} <h1 className="mt-4 text-3xl font-semibold text-foreground sm:text-4xl">
{t("title")}
</h1> </h1>
<p className="mx-auto mt-3 max-w-2xl text-base text-muted"> <p className="mx-auto mt-3 max-w-2xl text-base text-muted-foreground">
{copy.text} {t("text")}
</p> </p>
<div className="mt-6 flex flex-wrap items-center justify-center gap-3"> <div className="mt-6 flex flex-wrap items-center justify-center gap-3">
<Link <Button asChild>
href={`/${localeKey}`} <Link href={getLocalizedPath(localeKey)}>{t("home")}</Link>
className="inline-flex rounded-lg bg-inverse px-4 py-2.5 text-sm font-medium text-inverse transition hover:opacity-90 " </Button>
> <Button asChild variant="outline">
{copy.home} <Link href={getLocalizedPath(localeKey, "/contact")}>{t("contact")}</Link>
</Link> </Button>
<Link
href={`/${localeKey}/contact`}
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>
</div> </div>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
</div> </Container>
); );
} }
+72 -58
View File
@@ -1,10 +1,17 @@
import type { Metadata } from "next";
import { Sparkles } from "lucide-react"; import { Sparkles } from "lucide-react";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { ThemeToggle } from "@/components/theme-toggle"; import { ThemeToggle } from "@/components/theme-toggle";
import { resolveLocale } from "@/lib/site-data"; import { buildLocalizedMetadata } from "@/lib/metadata";
import { getLocalizedPath, resolveLocale } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent } from "@/components/ui/card";
type ComingSoonPageProps = { type ComingSoonPageProps = {
params: { params: {
@@ -12,73 +19,75 @@ type ComingSoonPageProps = {
}; };
}; };
export default function ComingSoonPage({ params: { locale } }: ComingSoonPageProps) { export async function generateMetadata({
params: { locale },
}: ComingSoonPageProps): Promise<Metadata> {
const localeKey = resolveLocale(locale); const localeKey = resolveLocale(locale);
const targetLocale = localeKey === "de" ? "en" : "de"; const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
const languageLabel = targetLocale.toUpperCase();
const copy = return buildLocalizedMetadata({
localeKey === "de" locale: localeKey,
? { pathname: "/coming-soon",
badge: "Coming Soon", title: `${t("badge")} | moh-sass`,
titleStart: "Etwas", description: t("description"),
titleAccent: "Neues", });
titleEnd: "ist auf dem Weg.",
description:
"Meine Website ist aktuell im Wartungsmodus. Ich finalisiere Inhalte und den letzten Feinschliff vor dem Launch.",
note:
"Danke fuer deine Geduld. Bald geht eine klarere, schnellere und staerkere Version live.",
} }
: {
badge: "Coming Soon", export default async function ComingSoonPage({
titleStart: "Something", params: { locale },
titleAccent: "new", }: ComingSoonPageProps) {
titleEnd: "is on the way.", const localeKey = resolveLocale(locale);
description: const localeOptions = ["de", "en", "ar"] as const;
"My website is currently in maintenance mode. I am finalizing content and polish before launch.", const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
note: const tNav = await getTranslations({ locale: localeKey, namespace: "navigation" });
"Thank you for your patience. A cleaner, faster, and stronger version is launching soon.",
};
return ( return (
<div className="relative min-h-screen overflow-hidden bg-app"> <div className="relative min-h-screen overflow-hidden bg-background">
<div <div className="surface-grid absolute inset-0 opacity-30" />
className="pointer-events-none absolute inset-0" <div className="absolute inset-0 bg-[radial-gradient(circle_at_top,hsl(var(--brand-primary)/0.18),transparent_42%),radial-gradient(circle_at_bottom_right,hsl(var(--brand-secondary)/0.14),transparent_36%)]" />
style={{
background:
"radial-gradient(circle at 14% 18%, color-mix(in oklab, var(--color-brand-secondary) 36%, transparent), transparent 48%), radial-gradient(circle at 86% 82%, color-mix(in oklab, var(--color-brand-primary) 32%, transparent), transparent 50%)",
}}
/>
<div className="pointer-events-none absolute left-1/2 top-[-120px] h-[340px] w-[340px] -translate-x-1/2 rounded-full bg-[color-mix(in_oklab,var(--color-brand-secondary)_32%,transparent)] blur-[96px]" /> <Container className="relative flex min-h-screen items-center py-14">
<div className="relative mx-auto flex min-h-screen w-full max-w-6xl items-center px-4 py-14 sm:px-6 lg:px-8">
<MotionFade className="w-full"> <MotionFade className="w-full">
<section className="brand-glow relative mx-auto max-w-4xl overflow-hidden rounded-[2.25rem] border border-default bg-surface-elevated p-7 text-center shadow-[0_24px_70px_-26px_rgba(0,0,0,0.35)] sm:p-10 lg:p-14"> <AppCard
<div className="pointer-events-none absolute -right-24 -top-24 h-72 w-72 rounded-full bg-[color-mix(in_oklab,var(--color-brand-secondary)_30%,transparent)] blur-[90px]" /> level={3}
<div className="pointer-events-none absolute -bottom-24 -left-24 h-80 w-80 rounded-full bg-[color-mix(in_oklab,var(--color-brand-primary)_28%,transparent)] blur-[110px]" /> className="brand-glow mx-auto max-w-4xl overflow-hidden border-border/70"
>
<CardContent className="relative p-7 text-center sm:p-10 lg:p-14">
<div className="pointer-events-none absolute -right-20 -top-20 h-64 w-64 rounded-full bg-brand-secondary/15 blur-3xl" />
<div className="pointer-events-none absolute -bottom-24 -left-16 h-72 w-72 rounded-full bg-brand-primary/15 blur-3xl" />
<div className="relative"> <div className="relative">
<div className="mx-auto mb-8 flex w-fit items-center gap-2 rounded-xl border border-strong bg-surface px-2 py-2"> <div className="mx-auto mb-8 flex w-fit items-center gap-2 rounded-surface border border-border bg-surface-1 px-2 py-2 shadow-sm">
<ThemeToggle /> <ThemeToggle ariaLabel={tNav("themeToggle")} />
<Link <div className="flex items-center gap-2">
href={`/${targetLocale}/coming-soon`} {localeOptions.map((targetLocale) => (
className="inline-flex h-9 min-w-11 items-center justify-center rounded-md border border-strong px-3 text-xs font-semibold tracking-wide text-muted-strong transition hover-surface-soft" <Button
aria-label={`Switch language to ${targetLocale}`} key={targetLocale}
asChild
type="button"
variant={targetLocale === localeKey ? "secondary" : "outline"}
size="sm"
> >
{languageLabel} <Link
href={getLocalizedPath(targetLocale, "/coming-soon")}
aria-label={targetLocale.toUpperCase()}
>
{targetLocale.toUpperCase()}
</Link> </Link>
</Button>
))}
</div>
</div> </div>
<p className="inline-flex items-center gap-2 rounded-full border border-default bg-surface px-3 py-1 text-xs font-semibold uppercase tracking-[0.14em] text-muted-strong"> <p className="inline-flex items-center gap-2 rounded-pill border border-border bg-surface-1 px-3 py-1 text-xs font-semibold uppercase tracking-[0.14em] text-foreground/80">
<Sparkles className="h-3.5 w-3.5" /> <Sparkles className="h-3.5 w-3.5 text-brand-secondary" />
{copy.badge} {t("badge")}
</p> </p>
<div className="mt-7 flex items-center justify-center"> <div className="mt-7 flex items-center justify-center">
<Image <Image
src="/logos/light-primary.svg" src="/logos/light-primary.svg"
alt="Logo" alt="mohfarawati"
width={190} width={190}
height={44} height={44}
className="block h-auto w-[150px] dark:hidden sm:w-[190px]" className="block h-auto w-[150px] dark:hidden sm:w-[190px]"
@@ -86,7 +95,7 @@ export default function ComingSoonPage({ params: { locale } }: ComingSoonPagePro
/> />
<Image <Image
src="/logos/dark-primary.svg" src="/logos/dark-primary.svg"
alt="Logo" alt="mohfarawati"
width={190} width={190}
height={44} height={44}
className="hidden h-auto w-[150px] dark:block sm:w-[190px]" className="hidden h-auto w-[150px] dark:block sm:w-[190px]"
@@ -94,19 +103,24 @@ export default function ComingSoonPage({ params: { locale } }: ComingSoonPagePro
/> />
</div> </div>
<h1 className="mx-auto mt-7 max-w-3xl text-4xl font-semibold tracking-tight text-fg sm:text-5xl lg:text-6xl"> <h1 className="text-balance mx-auto mt-7 max-w-3xl text-4xl font-semibold tracking-tight text-foreground sm:text-5xl lg:text-6xl">
{copy.titleStart} <span className="brand-gradient-text">{copy.titleAccent}</span> {copy.titleEnd} {t("titleStart")}{" "}
<span className="brand-gradient-text">{t("titleAccent")}</span>{" "}
{t("titleEnd")}
</h1> </h1>
<p className="mx-auto mt-5 max-w-2xl text-base leading-relaxed text-muted-strong sm:text-lg"> <p className="mx-auto mt-5 max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg">
{copy.description} {t("description")}
</p> </p>
<p className="mx-auto mt-6 max-w-2xl text-sm text-subtle sm:text-base">{copy.note}</p> <p className="mx-auto mt-6 max-w-2xl text-sm text-foreground/72 sm:text-base">
{t("note")}
</p>
</div> </div>
</section> </CardContent>
</AppCard>
</MotionFade> </MotionFade>
</div> </Container>
</div> </div>
); );
} }
+2 -2
View File
@@ -4,8 +4,8 @@ import { NextIntlClientProvider } from "next-intl";
import { getMessages, setRequestLocale } from "next-intl/server"; import { getMessages, setRequestLocale } from "next-intl/server";
import { notFound } from "next/navigation"; import { notFound } from "next/navigation";
import { ThemeProvider } from "@/components/theme-provider";
import { routing } from "@/i18n/routing"; import { routing } from "@/i18n/routing";
import { getDirection } from "@/lib/locale";
type LocaleLayoutProps = { type LocaleLayoutProps = {
children: ReactNode; children: ReactNode;
@@ -37,7 +37,7 @@ export default async function LocaleLayout({
return ( return (
<NextIntlClientProvider messages={messages}> <NextIntlClientProvider messages={messages}>
<ThemeProvider>{children}</ThemeProvider> <div lang={locale} dir={getDirection(locale)}>{children}</div>
</NextIntlClientProvider> </NextIntlClientProvider>
); );
} }
+126 -217
View File
@@ -3,98 +3,131 @@
@tailwind utilities; @tailwind utilities;
:root { :root {
--background: 220 23% 97%; --background: 210 20% 98%;
--foreground: 222 22% 11%; --foreground: 222 30% 12%;
--card: 0 0% 100%; --card: 0 0% 100%;
--card-foreground: 222 22% 11%; --card-foreground: 222 30% 12%;
--popover: 0 0% 100%; --popover: 0 0% 100%;
--popover-foreground: 222 22% 11%; --popover-foreground: 222 30% 12%;
--primary: 10 74% 50%; --primary: 214 84% 42%;
--primary-foreground: 210 40% 98%; --primary-foreground: 210 40% 98%;
--secondary: 214 19% 93%; --secondary: 210 24% 94%;
--secondary-foreground: 222 22% 11%; --secondary-foreground: 222 30% 12%;
--muted: 215 20% 92%; --muted: 210 20% 95%;
--muted-foreground: 219 15% 35%; --muted-foreground: 215 16% 38%;
--accent: 44 93% 55%; --accent: 191 78% 42%;
--accent-foreground: 222 22% 11%; --accent-foreground: 210 40% 98%;
--destructive: 0 72% 45%; --destructive: 0 72% 47%;
--destructive-foreground: 210 40% 98%; --destructive-foreground: 210 40% 98%;
--surface: 0 0% 100%; --surface-1: 0 0% 100%;
--surface-soft: 215 18% 93%; --surface-2: 210 20% 96%;
--surface-elevated: 0 0% 99%; --surface-3: 210 24% 93%;
--border: 215 20% 88%; --surface-inverse: 222 34% 14%;
--input: 215 20% 83%; --surface-inverse-foreground: 210 40% 98%;
--ring: 10 74% 50%;
--radius: 0.85rem; --border: 214 22% 88%;
--radius-card: 1rem; --border-strong: 214 20% 80%;
--radius-input: 0.7rem; --input: 214 20% 84%;
--radius-sidebar: 1rem; --ring: 214 84% 42%;
--shadow-xs: 0 1px 2px 0 hsl(220 30% 10% / 0.06); --status-success: 145 63% 42%;
--shadow-sm: 0 6px 18px -14px hsl(220 32% 20% / 0.18); --status-success-soft: 145 58% 92%;
--shadow-md: 0 18px 35px -24px hsl(220 32% 20% / 0.24); --status-warning: 36 92% 44%;
--shadow-lg: 0 24px 55px -30px hsl(220 32% 20% / 0.3); --status-warning-soft: 41 96% 90%;
--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%; --brand-primary: 214 84% 42%;
--sidebar-foreground: 223 18% 24%; --brand-secondary: 191 78% 42%;
--sidebar-primary: 10 74% 50%;
--radius-surface: 0rem;
--radius-nested: 0rem;
--radius-pill: 9999px;
--shadow-xs: 0 1px 2px hsl(220 26% 18% / 0.05);
--shadow-sm: 0 12px 30px -20px hsl(220 32% 18% / 0.16);
--shadow-md: 0 22px 48px -28px hsl(220 32% 18% / 0.2);
--shadow-lg: 0 28px 70px -34px hsl(220 32% 18% / 0.28);
--shadow-card: 0 20px 46px -30px hsl(220 32% 18% / 0.2);
--shadow-panel: 0 18px 50px -32px hsl(220 32% 18% / 0.18);
--shadow-sidebar: inset 0 1px 0 hsl(0 0% 100% / 0.7);
--focus-ring: 0 0 0 3px hsl(var(--ring) / 0.18);
--container-narrow: 48rem;
--container-default: 72rem;
--container-wide: 80rem;
--container-admin: 88rem;
--header-height: 4.5rem;
--section-space: 3.5rem;
--content-space: 1.5rem;
--sidebar-background: 210 22% 95%;
--sidebar-foreground: 222 24% 18%;
--sidebar-primary: 214 84% 42%;
--sidebar-primary-foreground: 210 40% 98%; --sidebar-primary-foreground: 210 40% 98%;
--sidebar-accent: 220 24% 91%; --sidebar-accent: 210 20% 90%;
--sidebar-accent-foreground: 222 20% 15%; --sidebar-accent-foreground: 222 24% 18%;
--sidebar-border: 216 20% 85%; --sidebar-border: 214 20% 84%;
--sidebar-ring: 10 74% 50%; --sidebar-ring: 214 84% 42%;
--focus-ring: 0 0 0 2px hsl(var(--ring) / 0.35);
} }
.dark { .dark {
--background: 223 32% 7%; --background: 222 33% 8%;
--foreground: 216 36% 93%; --foreground: 210 25% 92%;
--card: 221 29% 11%; --card: 222 28% 11%;
--card-foreground: 216 36% 93%; --card-foreground: 210 25% 92%;
--popover: 221 29% 11%; --popover: 222 28% 11%;
--popover-foreground: 216 36% 93%; --popover-foreground: 210 25% 92%;
--primary: 10 80% 56%; --primary: 205 88% 64%;
--primary-foreground: 216 36% 93%; --primary-foreground: 222 33% 8%;
--secondary: 221 23% 18%; --secondary: 222 18% 18%;
--secondary-foreground: 216 36% 93%; --secondary-foreground: 210 25% 92%;
--muted: 221 21% 20%; --muted: 222 18% 16%;
--muted-foreground: 218 17% 76%; --muted-foreground: 215 16% 72%;
--accent: 44 92% 52%; --accent: 190 76% 57%;
--accent-foreground: 221 29% 11%; --accent-foreground: 222 33% 8%;
--destructive: 0 72% 50%; --destructive: 0 72% 58%;
--destructive-foreground: 216 36% 93%; --destructive-foreground: 210 40% 98%;
--surface: 221 29% 11%; --surface-1: 222 28% 11%;
--surface-soft: 220 24% 15%; --surface-2: 222 22% 14%;
--surface-elevated: 220 21% 20%; --surface-3: 222 18% 17%;
--border: 221 21% 24%; --surface-inverse: 210 40% 98%;
--input: 221 20% 27%; --surface-inverse-foreground: 222 33% 8%;
--ring: 10 80% 56%;
--shadow-xs: 0 1px 2px 0 hsl(220 40% 2% / 0.5); --border: 221 18% 21%;
--shadow-sm: 0 8px 20px -12px hsl(220 40% 2% / 0.65); --border-strong: 221 18% 28%;
--shadow-md: 0 18px 36px -20px hsl(220 40% 2% / 0.75); --input: 221 18% 26%;
--shadow-lg: 0 28px 60px -28px hsl(220 40% 2% / 0.85); --ring: 205 88% 64%;
--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%; --status-success: 145 68% 66%;
--sidebar-foreground: 216 28% 86%; --status-success-soft: 145 36% 18%;
--sidebar-primary: 10 80% 56%; --status-warning: 42 96% 66%;
--sidebar-primary-foreground: 216 36% 93%; --status-warning-soft: 35 40% 18%;
--sidebar-accent: 221 23% 17%;
--sidebar-accent-foreground: 216 36% 93%; --brand-primary: 205 88% 64%;
--sidebar-border: 221 20% 21%; --brand-secondary: 190 76% 57%;
--sidebar-ring: 10 80% 56%;
--shadow-xs: 0 1px 2px hsl(220 50% 2% / 0.42);
--shadow-sm: 0 14px 30px -20px hsl(220 50% 2% / 0.48);
--shadow-md: 0 24px 48px -28px hsl(220 50% 2% / 0.58);
--shadow-lg: 0 34px 78px -34px hsl(220 50% 2% / 0.72);
--shadow-card: 0 20px 52px -28px hsl(220 50% 2% / 0.55);
--shadow-panel: 0 22px 56px -32px hsl(220 50% 2% / 0.52);
--shadow-sidebar: inset 0 1px 0 hsl(210 25% 92% / 0.06);
--sidebar-background: 222 25% 10%;
--sidebar-foreground: 210 18% 86%;
--sidebar-primary: 205 88% 64%;
--sidebar-primary-foreground: 222 33% 8%;
--sidebar-accent: 221 18% 18%;
--sidebar-accent-foreground: 210 25% 92%;
--sidebar-border: 221 18% 22%;
--sidebar-ring: 205 88% 64%;
} }
html { html {
@@ -114,132 +147,28 @@ html.dark {
body { body {
@apply min-h-screen bg-background text-foreground antialiased; @apply min-h-screen bg-background text-foreground antialiased;
} }
}
body { a {
color: hsl(var(--foreground)); @apply transition-colors;
background: hsl(var(--background)); }
} }
::selection { ::selection {
background: hsl(var(--primary) / 0.82); background: hsl(var(--primary) / 0.2);
color: hsl(var(--primary-foreground)); color: hsl(var(--foreground));
} }
@layer utilities { @layer utilities {
.bg-app { .text-balance {
background-color: hsl(var(--background)); text-wrap: balance;
} }
.bg-surface {
background-color: hsl(var(--surface));
}
.bg-surface-soft {
background-color: hsl(var(--surface-soft));
}
.bg-surface-elevated {
background-color: hsl(var(--surface-elevated));
}
.bg-inverse {
background-color: hsl(var(--foreground));
}
.text-fg {
color: hsl(var(--foreground));
}
.text-muted {
color: hsl(var(--muted-foreground));
}
.text-muted-strong {
color: hsl(var(--foreground) / 0.86);
}
.text-subtle {
color: hsl(var(--muted-foreground) / 0.88);
}
.text-inverse {
color: hsl(var(--background));
}
.border-default {
border-color: hsl(var(--border));
}
.border-strong {
border-color: hsl(var(--input));
}
.status-success {
background-color: hsl(142 70% 45% / 0.15);
color: hsl(142 72% 34%);
}
.status-warning {
background-color: hsl(38 92% 56% / 0.17);
color: hsl(33 92% 34%);
}
.status-danger {
background-color: hsl(var(--destructive) / 0.18);
color: hsl(var(--destructive));
}
.hover-surface-soft:hover {
background-color: hsl(var(--surface-soft));
}
.hover-fg:hover {
color: hsl(var(--foreground));
}
.group:hover .group-hover-fg {
color: hsl(var(--foreground));
}
.group:hover .group-hover-border-strong {
border-color: hsl(var(--input));
}
.btn-primary {
background-color: hsl(var(--primary));
color: hsl(var(--primary-foreground));
}
.btn-primary:hover {
filter: brightness(0.95);
}
.btn-secondary {
border: 1px solid hsl(var(--input));
color: hsl(var(--foreground) / 0.88);
background-color: transparent;
}
.btn-secondary:hover {
background-color: hsl(var(--surface-soft));
}
.field-surface {
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: var(--focus-ring);
}
.brand-gradient-text { .brand-gradient-text {
background: linear-gradient(120deg, hsl(var(--primary)), hsl(var(--accent))); background-image: linear-gradient(
135deg,
hsl(var(--brand-primary)),
hsl(var(--brand-secondary))
);
-webkit-background-clip: text; -webkit-background-clip: text;
background-clip: text; background-clip: text;
color: transparent; color: transparent;
@@ -247,35 +176,15 @@ body {
.brand-glow { .brand-glow {
box-shadow: box-shadow:
0 10px 40px -16px hsl(var(--primary) / 0.45), 0 22px 60px -34px hsl(var(--brand-primary) / 0.38),
0 8px 32px -18px hsl(var(--accent) / 0.45); 0 18px 44px -32px hsl(var(--brand-secondary) / 0.28);
} }
.float-slow { .surface-grid {
animation: float-slow 9s ease-in-out infinite; background-image:
} linear-gradient(hsl(var(--border) / 0.45) 1px, transparent 1px),
linear-gradient(90deg, hsl(var(--border) / 0.45) 1px, transparent 1px);
.float-medium { background-size: 24px 24px;
animation: float-medium 7s ease-in-out infinite; background-position: center center;
}
}
@keyframes float-slow {
0%,
100% {
transform: translateY(0px) translateX(0px) scale(1);
}
50% {
transform: translateY(-12px) translateX(10px) scale(1.04);
}
}
@keyframes float-medium {
0%,
100% {
transform: translateY(0px) translateX(0px) scale(1);
}
50% {
transform: translateY(10px) translateX(-8px) scale(1.03);
} }
} }
+11 -3
View File
@@ -1,19 +1,27 @@
import type { Metadata } from "next"; import type { Metadata } from "next";
import { getLocale } from "next-intl/server";
import { ThemeProvider } from "@/components/theme-provider";
import { getDirection } from "@/lib/locale";
import "./globals.css"; import "./globals.css";
export const metadata: Metadata = { export const metadata: Metadata = {
title: "moh-sass", title: "moh-sass",
description: "Multilingual Next.js base project", description: "Multilingual Next.js base project",
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://mohfarawati.de"),
}; };
export default function RootLayout({ export default async function RootLayout({
children, children,
}: Readonly<{ }: Readonly<{
children: React.ReactNode; children: React.ReactNode;
}>) { }>) {
const locale = await getLocale().catch(() => "de");
return ( return (
<html lang="de" suppressHydrationWarning> <html lang={locale} dir={getDirection(locale)} suppressHydrationWarning>
<body>{children}</body> <body>
<ThemeProvider>{children}</ThemeProvider>
</body>
</html> </html>
); );
} }
-5
View File
@@ -1,5 +0,0 @@
import { redirect } from "next/navigation";
export default function RootPage() {
redirect("/de");
}
+139
View File
@@ -0,0 +1,139 @@
import { ArrowLeft, LogOut, Power } from "lucide-react";
import Link from "next/link";
import { revalidatePath } from "next/cache";
import { redirect } from "next/navigation";
import { AppHeader } from "@/components/layout/app-header";
import { AppShell } from "@/components/layout/app-shell";
import { AppSidebar } from "@/components/layout/app-sidebar";
import { ThemeToggle } from "@/components/theme-toggle";
import { routing } from "@/i18n/routing";
import { getLocalizedPath } from "@/lib/locale";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
import { getMaintenanceMode, setMaintenanceMode } from "@/lib/app-config";
import { getRootNavigation } from "@/lib/root-navigation";
import { AppCard } from "@/components/ui/app-card";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
export const dynamic = "force-dynamic";
const copy = {
title: "Wartungsmodus",
subtitle: "Steuerung fuer den globalen Maintenance Status.",
overview: "Uebersicht",
maintenance: "Wartungsmodus",
uiKit: "UI Kit",
maintenanceText: "Wenn aktiv, werden alle Seiten auf die Coming Soon Seite weitergeleitet.",
maintenanceOn: "Aktiv",
maintenanceOff: "Inaktiv",
enableMaintenance: "Wartungsmodus aktivieren",
disableMaintenance: "Wartungsmodus deaktivieren",
logout: "Ausloggen",
backToSite: "Zur Website",
};
export default async function RootMaintenancePage() {
const authenticated = isAdminAuthenticated();
if (!authenticated) {
redirect("/root");
}
const maintenanceEnabled = await getMaintenanceMode();
async function logoutAction() {
"use server";
clearAdminSessionCookie();
redirect("/root");
}
async function updateMaintenanceMode(formData: FormData) {
"use server";
if (!isAdminAuthenticated()) {
redirect("/root");
}
const nextValue = formData.get("enabled") === "true";
await setMaintenanceMode(nextValue);
revalidatePath("/", "layout");
revalidatePath("/coming-soon");
revalidatePath("/root");
revalidatePath("/root/maintenance");
for (const appLocale of routing.locales) {
revalidatePath(getLocalizedPath(appLocale), "layout");
revalidatePath(getLocalizedPath(appLocale, "/coming-soon"));
}
redirect("/root/maintenance");
}
const sidebarItems = getRootNavigation(copy, "maintenance");
return (
<AppShell
sidebar={
<AppSidebar
title={copy.title}
description={copy.subtitle}
items={sidebarItems}
footer={
<div className="space-y-2">
<div className="flex items-center gap-2">
<ThemeToggle ariaLabel="Theme wechseln" />
</div>
<Button asChild variant="outline" className="w-full justify-start">
<Link href={getLocalizedPath("de")}>
<ArrowLeft className="h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
<form action={logoutAction}>
<Button type="submit" variant="destructive" className="w-full justify-start">
<LogOut className="h-4 w-4" />
{copy.logout}
</Button>
</form>
</div>
}
/>
}
header={
<AppHeader
title={copy.title}
description={copy.subtitle}
actions={
<Badge variant={maintenanceEnabled ? "warning" : "success"}>
{maintenanceEnabled ? copy.maintenanceOn : copy.maintenanceOff}
</Badge>
}
/>
}
>
<AppCard>
<CardHeader>
<CardTitle className="text-xl">{copy.title}</CardTitle>
<CardDescription>{copy.maintenanceText}</CardDescription>
</CardHeader>
<CardContent>
<form action={updateMaintenanceMode}>
<input
type="hidden"
name="enabled"
value={maintenanceEnabled ? "false" : "true"}
/>
<Button type="submit">
<Power className="h-4 w-4" />
{maintenanceEnabled ? copy.disableMaintenance : copy.enableMaintenance}
</Button>
</form>
</CardContent>
</AppCard>
</AppShell>
);
}
+104 -184
View File
@@ -1,22 +1,19 @@
import { import { ArrowLeft, ExternalLink, LockKeyhole, LogOut } from "lucide-react";
ArrowLeft,
BarChart3,
Boxes,
FolderKanban,
LayoutDashboard,
LockKeyhole,
LogOut,
Power,
ShieldAlert,
Users2,
} from "lucide-react";
import { revalidatePath } from "next/cache";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import Link from "next/link"; import Link from "next/link";
import { redirect } from "next/navigation";
import { AppHeader } from "@/components/layout/app-header";
import { AppShell } from "@/components/layout/app-shell";
import { AppSidebar } from "@/components/layout/app-sidebar";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade"; import { MotionFade } from "@/components/motion-fade";
import { routing } from "@/i18n/routing"; import { ThemeToggle } from "@/components/theme-toggle";
import { getLocalizedPath } from "@/lib/locale";
import { AppCard } from "@/components/ui/app-card";
import { Button } from "@/components/ui/button";
import { CardContent, CardDescription, CardHeader } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { import {
clearAdminSessionCookie, clearAdminSessionCookie,
getAdminLockState, getAdminLockState,
@@ -27,17 +24,8 @@ import {
resetAdminFailedAttempts, resetAdminFailedAttempts,
setAdminSessionCookie, setAdminSessionCookie,
} from "@/lib/admin-auth"; } from "@/lib/admin-auth";
import { getMaintenanceMode, setMaintenanceMode } from "@/lib/app-config"; import { getMaintenanceMode } from "@/lib/app-config";
import { resolveLocale } from "@/lib/site-data"; import { getRootNavigation } from "@/lib/root-navigation";
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 = { type RootPageProps = {
searchParams?: { searchParams?: {
@@ -47,9 +35,34 @@ type RootPageProps = {
export const dynamic = "force-dynamic"; export const dynamic = "force-dynamic";
const copy = {
title: "Uebersicht",
subtitle: "Interner Bereich fuer Kennzahlen und zentrale Navigation.",
overview: "Uebersicht",
maintenance: "Wartungsmodus",
maintenanceTitle: "Wartungsmodus",
maintenanceVisitorsClosed: "Website fuer Besucher geschlossen",
maintenanceDescription:
"Wenn aktiv, werden alle Seiten auf die Coming Soon Seite weitergeleitet.",
maintenanceOpen: "Website fuer Besucher offen",
maintenanceAction: "Zur Wartungsseite",
uiKitTitle: "UI Kit",
uiKitDescription: "Globale Referenz fuer Cards, Buttons, Inputs und Surface Levels.",
uiKitAction: "Zur UI Kit",
loginTitle: "Root Login",
loginText: "Nur autorisierte Nutzer duerfen diesen Bereich verwenden.",
passwordLabel: "Passwort",
loginButton: "Einloggen",
invalidLogin: "Falsches Passwort.",
lockedLogin: "Zu viele Fehlversuche. Bitte spaeter erneut versuchen.",
configMissing: "ADMIN_PASSWORD und ADMIN_AUTH_SECRET fehlen in env.",
basicAuthMissing: "ROOT_BASIC_AUTH_USER und ROOT_BASIC_AUTH_PASS fehlen in env.",
logout: "Ausloggen",
backToSite: "Zur Website",
uiKit: "UI Kit",
};
export default async function RootPage({ searchParams }: RootPageProps) { export default async function RootPage({ searchParams }: RootPageProps) {
const requestLocale = cookies().get("NEXT_LOCALE")?.value;
const localeKey = resolveLocale(requestLocale ?? "de");
const authConfigured = isAdminAuthConfigured(); const authConfigured = isAdminAuthConfigured();
const basicConfigured = Boolean( const basicConfigured = Boolean(
process.env.ROOT_BASIC_AUTH_USER && process.env.ROOT_BASIC_AUTH_PASS, process.env.ROOT_BASIC_AUTH_USER && process.env.ROOT_BASIC_AUTH_PASS,
@@ -89,121 +102,39 @@ export default async function RootPage({ searchParams }: RootPageProps) {
redirect("/root"); redirect("/root");
} }
async function updateMaintenanceMode(formData: FormData) {
"use server";
if (!isAdminAuthenticated()) {
redirect("/root");
}
const nextValue = formData.get("enabled") === "true";
await setMaintenanceMode(nextValue);
revalidatePath("/", "layout");
revalidatePath("/root");
for (const appLocale of routing.locales) {
revalidatePath(`/${appLocale}`, "layout");
revalidatePath(`/${appLocale}/coming-soon`);
}
redirect("/root");
}
const copy =
resolveLocale(requestLocale ?? localeKey) === "de"
? {
title: "Root",
subtitle: "Interner Bereich fuer Kennzahlen und Wartungssteuerung.",
activeUsers: "Aktive Nutzer",
projects: "Laufende Projekte",
products: "Aktive Produkte",
conversion: "Conversion",
updates: "Letzte Updates",
updateOne: "Kontaktformular wurde ueberarbeitet.",
updateTwo: "Neue Produktseite fuer Growth Kit vorbereitet.",
updateThree: "Portfolio-Daten fuer Q2 aktualisiert.",
maintenanceTitle: "Wartungsmodus",
maintenanceText:
"Wenn aktiv, werden alle Seiten auf die Coming Soon Seite weitergeleitet.",
maintenanceOn: "Aktiv",
maintenanceOff: "Inaktiv",
enableMaintenance: "Wartungsmodus aktivieren",
disableMaintenance: "Wartungsmodus deaktivieren",
loginTitle: "Root Login",
loginText: "Nur autorisierte Nutzer duerfen diesen Bereich verwenden.",
passwordLabel: "Passwort",
loginButton: "Einloggen",
invalidLogin: "Falsches Passwort.",
lockedLogin: "Zu viele Fehlversuche. Bitte spaeter erneut versuchen.",
configMissing: "ADMIN_PASSWORD und ADMIN_AUTH_SECRET fehlen in env.",
basicAuthMissing:
"ROOT_BASIC_AUTH_USER und ROOT_BASIC_AUTH_PASS fehlen in env.",
logout: "Ausloggen",
backToSite: "Zur Website",
}
: {
title: "Root",
subtitle: "Internal area for metrics and maintenance controls.",
activeUsers: "Active users",
projects: "Running projects",
products: "Active products",
conversion: "Conversion",
updates: "Latest updates",
updateOne: "Contact form layout updated.",
updateTwo: "New Growth Kit product page prepared.",
updateThree: "Portfolio data updated for Q2.",
maintenanceTitle: "Maintenance mode",
maintenanceText:
"When enabled, all site routes are redirected to the coming soon page.",
maintenanceOn: "Enabled",
maintenanceOff: "Disabled",
enableMaintenance: "Enable maintenance mode",
disableMaintenance: "Disable maintenance mode",
loginTitle: "Root login",
loginText: "Only authorized users can access this area.",
passwordLabel: "Password",
loginButton: "Sign in",
invalidLogin: "Invalid password.",
lockedLogin: "Too many failed attempts. Please try again later.",
configMissing: "ADMIN_PASSWORD and ADMIN_AUTH_SECRET are missing in env.",
basicAuthMissing:
"ROOT_BASIC_AUTH_USER and ROOT_BASIC_AUTH_PASS are missing in env.",
logout: "Sign out",
backToSite: "Back to site",
};
if (!authenticated) { if (!authenticated) {
return ( 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"> <Container size="narrow" className="py-12">
<MotionFade> <MotionFade>
<Card> <AppCard level={3}>
<CardHeader> <CardHeader>
<p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground"> <p className="inline-flex items-center gap-2 text-sm font-medium text-muted-foreground">
<LockKeyhole className="h-4 w-4" /> <LockKeyhole className="h-4 w-4 text-brand-primary" />
{copy.loginTitle} {copy.loginTitle}
</p> </p>
<CardDescription>{copy.loginText}</CardDescription> <CardDescription>{copy.loginText}</CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent>
{!authConfigured ? ( {!authConfigured ? (
<p className="mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive"> <p className="mb-4 rounded-nested border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
{copy.configMissing} {copy.configMissing}
</p> </p>
) : null} ) : null}
{!basicConfigured ? ( {!basicConfigured ? (
<p className="mb-4 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive"> <p className="mb-4 rounded-nested border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive">
{copy.basicAuthMissing} {copy.basicAuthMissing}
</p> </p>
) : null} ) : null}
{searchParams?.error === "invalid" ? ( {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"> <p className="mb-4 rounded-nested border border-status-warning/30 bg-status-warning-soft px-3 py-2 text-sm text-status-warning">
{copy.invalidLogin} {copy.invalidLogin}
</p> </p>
) : null} ) : null}
{searchParams?.error === "locked" || lockState.locked ? ( {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"> <p className="mb-4 rounded-nested border border-status-warning/30 bg-status-warning-soft px-3 py-2 text-sm text-status-warning">
{copy.lockedLogin} {copy.lockedLogin}
</p> </p>
) : null} ) : null}
@@ -211,30 +142,22 @@ export default async function RootPage({ searchParams }: RootPageProps) {
<form action={loginAction} className="space-y-3"> <form action={loginAction} className="space-y-3">
<Label htmlFor="password">{copy.passwordLabel}</Label> <Label htmlFor="password">{copy.passwordLabel}</Label>
<Input id="password" type="password" name="password" required /> <Input id="password" type="password" name="password" required />
<Button type="submit" disabled={!authConfigured || !basicConfigured || lockState.locked}> <Button
<LockKeyhole className="mr-2 h-4 w-4" /> type="submit"
disabled={!authConfigured || !basicConfigured || lockState.locked}
>
<LockKeyhole className="h-4 w-4" />
{copy.loginButton} {copy.loginButton}
</Button> </Button>
</form> </form>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
</div> </Container>
); );
} }
const stats = [ const sidebarItems = getRootNavigation(copy, "overview");
{ label: copy.activeUsers, value: "1,280", icon: Users2 },
{ label: copy.projects, value: "24", icon: FolderKanban },
{ label: copy.products, value: "8", icon: Boxes },
{ 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 ( return (
<AppShell <AppShell
@@ -244,12 +167,23 @@ export default async function RootPage({ searchParams }: RootPageProps) {
description={copy.subtitle} description={copy.subtitle}
items={sidebarItems} items={sidebarItems}
footer={ footer={
<div className="space-y-2">
<div className="flex items-center gap-2">
<ThemeToggle ariaLabel="Theme wechseln" />
</div>
<Button asChild variant="outline" className="w-full justify-start">
<Link href={getLocalizedPath("de")}>
<ArrowLeft className="h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
<form action={logoutAction}> <form action={logoutAction}>
<Button type="submit" variant="outline" className="w-full justify-start"> <Button type="submit" variant="destructive" className="w-full justify-start">
<LogOut className="mr-2 h-4 w-4" /> <LogOut className="h-4 w-4" />
{copy.logout} {copy.logout}
</Button> </Button>
</form> </form>
</div>
} }
/> />
} }
@@ -258,73 +192,59 @@ export default async function RootPage({ searchParams }: RootPageProps) {
title={copy.title} title={copy.title}
description={copy.subtitle} description={copy.subtitle}
actions={ actions={
<> maintenanceEnabled ? (
<Badge variant={maintenanceEnabled ? "warning" : "success"}> <Button asChild variant="destructive">
{maintenanceEnabled ? copy.maintenanceOn : copy.maintenanceOff} <Link href="/root/maintenance">
</Badge> {copy.maintenanceVisitorsClosed}
<Button asChild variant="outline">
<Link href={`/${localeKey}`}>
<ArrowLeft className="mr-2 h-4 w-4" />
{copy.backToSite}
</Link> </Link>
</Button> </Button>
</> ) : null
} }
/> />
} }
> >
<div className="grid gap-6"> <div className="grid gap-6">
<section className="grid gap-4 lg:grid-cols-2">
<MotionFade delay={0.05}> <MotionFade delay={0.05}>
<Card id="maintenance"> <AppCard level={2}>
<CardHeader> <CardHeader>
<CardTitle className="text-xl">{copy.maintenanceTitle}</CardTitle> <CardDescription>{copy.maintenanceTitle}</CardDescription>
<CardDescription>{copy.maintenanceText}</CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent className="space-y-4">
<form action={updateMaintenanceMode}> <p className="text-lg font-semibold text-foreground">
<input type="hidden" name="enabled" value={maintenanceEnabled ? "false" : "true"} /> {maintenanceEnabled ? copy.maintenanceVisitorsClosed : copy.maintenanceOpen}
<Button type="submit"> </p>
<Power className="mr-2 h-4 w-4" /> <p className="text-sm text-muted-foreground">
{maintenanceEnabled ? copy.disableMaintenance : copy.enableMaintenance} {copy.maintenanceDescription}
</p>
<Button asChild variant={maintenanceEnabled ? "destructive" : "outline"}>
<Link href="/root/maintenance">
{copy.maintenanceAction}
<ExternalLink className="h-4 w-4" />
</Link>
</Button> </Button>
</form>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </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 delay={0.1}> <MotionFade delay={0.1}>
<Card id="updates"> <AppCard level={2}>
<CardHeader> <CardHeader>
<CardTitle className="text-xl">{copy.updates}</CardTitle> <CardDescription>{copy.uiKitTitle}</CardDescription>
</CardHeader> </CardHeader>
<CardContent> <CardContent className="space-y-4">
<ul className="space-y-3"> <p className="text-lg font-semibold text-foreground">{copy.uiKitTitle}</p>
{[copy.updateOne, copy.updateTwo, copy.updateThree].map((item) => ( <p className="text-sm text-muted-foreground">{copy.uiKitDescription}</p>
<li key={item} className="rounded-[var(--radius-input)] border border-border bg-muted px-4 py-3 text-sm text-muted-foreground"> <Button asChild variant="outline">
{item} <Link href="/root/ui-kit">
</li> {copy.uiKitAction}
))} <ExternalLink className="h-4 w-4" />
</ul> </Link>
</Button>
</CardContent> </CardContent>
</Card> </AppCard>
</MotionFade> </MotionFade>
</section>
</div> </div>
</AppShell> </AppShell>
); );
+76
View File
@@ -0,0 +1,76 @@
import { ArrowLeft, LogOut } from "lucide-react";
import Link from "next/link";
import { redirect } from "next/navigation";
import { AppHeader } from "@/components/layout/app-header";
import { AppShell } from "@/components/layout/app-shell";
import { AppSidebar } from "@/components/layout/app-sidebar";
import { ThemeToggle } from "@/components/theme-toggle";
import { getLocalizedPath } from "@/lib/locale";
import { clearAdminSessionCookie, isAdminAuthenticated } from "@/lib/admin-auth";
import { getRootNavigation } from "@/lib/root-navigation";
import { Button } from "@/components/ui/button";
import { UiKitShowcase } from "@/components/ui/ui-kit-showcase";
export const dynamic = "force-dynamic";
const copy = {
title: "UI Kit",
subtitle: "Globale Referenz fuer das visuelle System im Root Bereich.",
maintenance: "Wartungsmodus",
overview: "Uebersicht",
uiKit: "UI Kit",
logout: "Ausloggen",
backToSite: "Zur Website",
};
export default async function RootUiKitPage() {
const authenticated = isAdminAuthenticated();
if (!authenticated) {
redirect("/root");
}
async function logoutAction() {
"use server";
clearAdminSessionCookie();
redirect("/root");
}
const sidebarItems = getRootNavigation(copy, "ui-kit");
return (
<AppShell
sidebar={
<AppSidebar
title={copy.title}
description={copy.subtitle}
items={sidebarItems}
footer={
<div className="space-y-2">
<div className="flex items-center gap-2">
<ThemeToggle ariaLabel="Theme wechseln" />
</div>
<Button asChild variant="outline" className="w-full justify-start">
<Link href={getLocalizedPath("de")}>
<ArrowLeft className="h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
<form action={logoutAction}>
<Button type="submit" variant="destructive" className="w-full justify-start">
<LogOut className="h-4 w-4" />
{copy.logout}
</Button>
</form>
</div>
}
/>
}
header={<AppHeader title={copy.title} description={copy.subtitle} />}
>
<UiKitShowcase localeKey="de" />
</AppShell>
);
}
+3 -4
View File
@@ -11,11 +11,10 @@
"prefix": "" "prefix": ""
}, },
"aliases": { "aliases": {
"components": "@/src/components", "components": "@/components",
"utils": "@/lib/utils", "utils": "@/lib/utils",
"ui": "@/src/components/ui", "ui": "@/components/ui",
"lib": "@/lib", "lib": "@/lib"
"hooks": "@/src/hooks"
}, },
"iconLibrary": "lucide" "iconLibrary": "lucide"
} }
-44
View File
@@ -1,44 +0,0 @@
import Link from "next/link";
import { useLocale, useTranslations } from "next-intl";
const navItems = [
{ key: "home", path: "" },
{ key: "portfolio", path: "/portfolio" },
{ key: "products", path: "/products" },
{ key: "about", path: "/about" },
{ key: "contact", path: "/contact" },
];
type FooterProps = {
isAdmin?: boolean;
};
export function Footer({ isAdmin = false }: FooterProps) {
const locale = useLocale();
const tNav = useTranslations("navigation");
const tFooter = useTranslations("footer");
return (
<footer className="border-t border-default bg-surface-soft">
<div className="mx-auto flex w-full max-w-6xl flex-col gap-4 px-4 py-8 sm:px-6 lg:px-8">
<nav className="flex flex-wrap gap-4 text-sm">
{navItems.map((item) => (
<Link
key={item.key}
href={`/${locale}${item.path}`}
className="text-muted transition hover:text-fg"
>
{tNav(item.key)}
</Link>
))}
{isAdmin ? (
<a href="/root" className="text-muted transition hover:text-fg">
{tNav("root")}
</a>
) : null}
</nav>
<p className="text-xs text-subtle">{tFooter("copyright", { year: new Date().getFullYear() })}</p>
</div>
</footer>
);
}
@@ -1,6 +1,7 @@
import type { ReactNode } from "react"; import type { ReactNode } from "react";
import { Card, CardContent } from "@/src/components/ui/card"; import { AppCard } from "@/components/ui/app-card";
import { CardContent } from "@/components/ui/card";
type AppHeaderProps = { type AppHeaderProps = {
title: string; title: string;
@@ -10,14 +11,20 @@ type AppHeaderProps = {
export function AppHeader({ title, description, actions }: AppHeaderProps) { export function AppHeader({ title, description, actions }: AppHeaderProps) {
return ( return (
<Card> <AppCard level={3}>
<CardContent className="flex flex-wrap items-start justify-between gap-4 p-6 lg:p-8"> <CardContent className="flex flex-wrap items-start justify-between gap-5 p-6 lg:p-8">
<div> <div className="space-y-2">
<h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-4xl">{title}</h1> <h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-4xl">
{description ? <p className="mt-2 max-w-3xl text-sm text-muted-foreground sm:text-base">{description}</p> : null} {title}
</h1>
{description ? (
<p className="max-w-3xl text-sm text-muted-foreground sm:text-base">
{description}
</p>
) : null}
</div> </div>
{actions ? <div className="flex items-center gap-2">{actions}</div> : null} {actions ? <div className="flex items-center gap-2">{actions}</div> : null}
</CardContent> </CardContent>
</Card> </AppCard>
); );
} }
+27
View File
@@ -0,0 +1,27 @@
import type { ReactNode } from "react";
import { Container } from "@/components/layout/container";
import { cn } from "@/lib/utils";
type AppShellProps = {
sidebar: ReactNode;
header: ReactNode;
children: ReactNode;
className?: string;
};
export function AppShell({ sidebar, header, children, className }: AppShellProps) {
return (
<div className="min-h-screen bg-background py-6 lg:py-8">
<Container size="admin">
<div className="flex gap-6">
<aside className="hidden w-72 shrink-0 md:block">{sidebar}</aside>
<div className={cn("flex min-w-0 flex-1 flex-col gap-6", className)}>
{header}
<main>{children}</main>
</div>
</div>
</Container>
</div>
);
}
@@ -2,8 +2,9 @@ import Link from "next/link";
import type { LucideIcon } from "lucide-react"; import type { LucideIcon } from "lucide-react";
import type { ReactNode } from "react"; import type { ReactNode } from "react";
import { AppCard } from "@/components/ui/app-card";
import { CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { Card, CardContent, CardHeader, CardTitle } from "@/src/components/ui/card";
type SidebarItem = { type SidebarItem = {
label: string; label: string;
@@ -19,22 +20,28 @@ type AppSidebarProps = {
footer?: ReactNode; footer?: ReactNode;
}; };
export function AppSidebar({ title, description, items, footer }: AppSidebarProps) { export function AppSidebar({
title,
description,
items,
footer,
}: AppSidebarProps) {
return ( return (
<Card className="sticky top-6 overflow-hidden border-sidebar-border bg-sidebar text-sidebar-foreground shadow-sidebar"> <AppCard className="sticky top-6 overflow-hidden bg-sidebar text-sidebar-foreground shadow-sidebar">
<CardHeader className="pb-4"> <CardHeader className="pb-4">
<CardTitle className="text-base font-semibold">{title}</CardTitle> <CardTitle className="text-base font-semibold">{title}</CardTitle>
<p className="text-sm text-sidebar-foreground/70">{description}</p> <p className="text-sm text-sidebar-foreground/72">{description}</p>
</CardHeader> </CardHeader>
<CardContent className="space-y-1 px-3 pb-3 pt-0"> <CardContent className="space-y-1 px-3 pb-3 pt-0">
{items.map((item) => { {items.map((item) => {
const Icon = item.icon; const Icon = item.icon;
return ( return (
<Link <Link
key={item.label} key={item.label}
href={item.href} href={item.href}
className={cn( className={cn(
"flex items-center gap-2 rounded-[var(--radius-sidebar)] px-3 py-2 text-sm transition", "flex items-center gap-2 rounded-nested px-3 py-2 text-sm transition-colors",
item.active item.active
? "bg-sidebar-primary text-sidebar-primary-foreground" ? "bg-sidebar-primary text-sidebar-primary-foreground"
: "text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground", : "text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
@@ -47,6 +54,6 @@ export function AppSidebar({ title, description, items, footer }: AppSidebarProp
})} })}
</CardContent> </CardContent>
{footer ? <div className="border-t border-sidebar-border px-4 py-3">{footer}</div> : null} {footer ? <div className="border-t border-sidebar-border px-4 py-3">{footer}</div> : null}
</Card> </AppCard>
); );
} }
+43
View File
@@ -0,0 +1,43 @@
import * as React from "react";
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const containerVariants = cva("mx-auto w-full px-4 sm:px-6 lg:px-8", {
variants: {
size: {
default: "max-w-layout",
narrow: "max-w-narrow",
wide: "max-w-wide",
admin: "max-w-admin",
},
},
defaultVariants: {
size: "default",
},
});
export interface ContainerProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof containerVariants> {
asChild?: boolean;
}
const Container = React.forwardRef<HTMLDivElement, ContainerProps>(
({ className, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "div";
return (
<Comp
ref={ref}
className={cn(containerVariants({ size }), className)}
{...props}
/>
);
},
);
Container.displayName = "Container";
export { Container, containerVariants };
+37
View File
@@ -0,0 +1,37 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { Button } from "@/components/ui/button";
import { AppLocale, getLocalizedPath, stripLocalePrefix } from "@/lib/locale";
type LocaleToggleProps = {
locale: string;
};
export function LocaleToggle({ locale }: LocaleToggleProps) {
const pathname = usePathname();
const locales: AppLocale[] = ["de", "en", "ar"];
const currentPath = stripLocalePrefix(pathname);
const currentLocale = (["de", "en", "ar"].includes(locale) ? locale : "de") as AppLocale;
return (
<div className="flex items-center gap-2">
{locales.map((targetLocale) => (
<Button
key={targetLocale}
asChild
type="button"
variant={targetLocale === currentLocale ? "secondary" : "outline"}
size="sm"
className="text-xs"
>
<Link href={getLocalizedPath(targetLocale, currentPath)}>
{targetLocale.toUpperCase()}
</Link>
</Button>
))}
</div>
);
}
+49
View File
@@ -0,0 +1,49 @@
import Link from "next/link";
import { useLocale, useTranslations } from "next-intl";
import { Container } from "@/components/layout/container";
import { getLocalizedPath } from "@/lib/locale";
const navItems = [
{ key: "home", path: "" },
{ key: "portfolio", path: "/portfolio" },
{ key: "products", path: "/products" },
{ key: "about", path: "/about" },
{ key: "contact", path: "/contact" },
];
type SiteFooterProps = {
isAdmin?: boolean;
};
export function SiteFooter({ isAdmin = false }: SiteFooterProps) {
const locale = useLocale();
const tNav = useTranslations("navigation");
const tFooter = useTranslations("footer");
return (
<footer className="border-t border-border bg-surface-2">
<Container className="flex flex-col gap-4 py-8">
<nav className="flex flex-wrap gap-x-5 gap-y-3 text-sm">
{navItems.map((item) => (
<Link
key={item.key}
href={getLocalizedPath(locale, item.path || "/")}
className="text-muted-foreground hover:text-foreground"
>
{tNav(item.key)}
</Link>
))}
{isAdmin ? (
<a href="/root" className="text-muted-foreground hover:text-foreground">
{tNav("root")}
</a>
) : null}
</nav>
<p className="text-xs text-muted-foreground/80">
{tFooter("copyright", { year: new Date().getFullYear() })}
</p>
</Container>
</footer>
);
}
+132
View File
@@ -0,0 +1,132 @@
"use client";
import { Menu, X } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import { useLocale, useTranslations } from "next-intl";
import { useState } from "react";
import { Container } from "@/components/layout/container";
import { LocaleToggle } from "@/components/layout/locale-toggle";
import { ThemeToggle } from "@/components/theme-toggle";
import { Button } from "@/components/ui/button";
import { getLocalizedPath } from "@/lib/locale";
const navItems = [
{ key: "home", path: "" },
{ key: "portfolio", path: "/portfolio" },
{ key: "products", path: "/products" },
{ key: "about", path: "/about" },
{ key: "contact", path: "/contact" },
];
type SiteHeaderProps = {
isAdmin?: boolean;
};
function NavLinks({
isAdmin,
onNavigate,
}: {
isAdmin: boolean;
onNavigate?: () => void;
}) {
const locale = useLocale();
const t = useTranslations("navigation");
return (
<>
{navItems.map((item) => (
<Link
key={item.key}
href={getLocalizedPath(locale, item.path || "/")}
className="text-sm text-muted-foreground hover:text-foreground"
onClick={onNavigate}
>
{t(item.key)}
</Link>
))}
{isAdmin ? (
<a
href="/root"
className="text-sm text-muted-foreground hover:text-foreground"
onClick={onNavigate}
>
{t("root")}
</a>
) : null}
</>
);
}
export function SiteHeader({ isAdmin = false }: SiteHeaderProps) {
const [isOpen, setIsOpen] = useState(false);
const locale = useLocale();
const t = useTranslations("navigation");
return (
<header className="sticky top-0 z-40 border-b border-border/80 bg-background/88 backdrop-blur-chrome">
<Container>
<div className="flex min-h-header items-center justify-between gap-4">
<div className="flex items-center gap-4">
<Link
href={getLocalizedPath(locale)}
className="inline-flex items-center rounded-nested border border-border bg-surface-1 px-3 py-2 shadow-xs"
>
<Image
src="/logos/light-primary.svg"
alt="mohfarawati"
width={140}
height={24}
className="block h-6 w-auto dark:hidden"
priority
/>
<Image
src="/logos/dark-primary.svg"
alt="mohfarawati"
width={140}
height={24}
className="hidden h-6 w-auto dark:block"
priority
/>
</Link>
<nav className="hidden items-center gap-5 md:flex">
<NavLinks isAdmin={isAdmin} />
</nav>
</div>
<div className="hidden items-center gap-2 md:flex">
<ThemeToggle ariaLabel={t("themeToggle")} />
<LocaleToggle locale={locale} />
</div>
<Button
type="button"
onClick={() => setIsOpen((open) => !open)}
variant="outline"
size="icon"
className="md:hidden"
aria-label={isOpen ? t("closeMenu") : t("openMenu")}
>
{isOpen ? <X className="h-4 w-4" /> : <Menu className="h-4 w-4" />}
</Button>
</div>
</Container>
{isOpen ? (
<div className="border-t border-border/80 bg-surface-1 md:hidden">
<Container className="py-4">
<nav className="flex flex-col gap-3">
<NavLinks isAdmin={isAdmin} onNavigate={() => setIsOpen(false)} />
</nav>
<div className="mt-4 flex items-center gap-2">
<ThemeToggle ariaLabel={t("themeToggle")} />
<LocaleToggle locale={locale} />
</div>
</Container>
</div>
) : null}
</header>
);
}
-120
View File
@@ -1,120 +0,0 @@
"use client";
import { Menu, X } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import { useLocale, useTranslations } from "next-intl";
import { useState } from "react";
import { ThemeToggle } from "@/components/theme-toggle";
import { Button } from "@/src/components/ui/button";
const navItems = [
{ key: "home", path: "" },
{ key: "portfolio", path: "/portfolio" },
{ key: "products", path: "/products" },
{ key: "about", path: "/about" },
{ key: "contact", path: "/contact" },
];
type NavbarProps = {
isAdmin?: boolean;
};
export function Navbar({ isAdmin = false }: NavbarProps) {
const [isOpen, setIsOpen] = useState(false);
const locale = useLocale();
const t = useTranslations("navigation");
return (
<header className="sticky top-0 z-40 border-b border-default bg-surface backdrop-blur">
<div className="mx-auto flex w-full max-w-6xl items-center justify-between gap-4 px-4 py-3 sm:px-6 lg:px-8">
<div className="flex items-center gap-3">
<Link
href={`/${locale}`}
className="inline-flex items-center rounded-md border border-input bg-card px-3 py-2 shadow-xs"
>
<Image
src="/logos/light-primary.svg"
alt="mohfarawati logo"
width={140}
height={24}
className="block h-6 w-auto dark:hidden"
priority
/>
<Image
src="/logos/dark-primary.svg"
alt="mohfarawati logo"
width={140}
height={24}
className="hidden h-6 w-auto dark:block"
priority
/>
</Link>
<nav className="hidden items-center gap-5 md:flex">
{navItems.map((item) => (
<Link
key={item.key}
href={`/${locale}${item.path}`}
className="text-sm text-muted transition hover:text-fg"
>
{t(item.key)}
</Link>
))}
{isAdmin ? (
<a href="/root" className="text-sm text-muted transition hover:text-fg">
{t("root")}
</a>
) : null}
</nav>
</div>
<div className="hidden items-center gap-2 md:flex">
<ThemeToggle />
<Button type="button" variant="outline" size="sm" className="text-xs">
{t("languagePlaceholder")}
</Button>
</div>
<Button
type="button"
onClick={() => setIsOpen((open) => !open)}
variant="outline"
size="icon"
className="md:hidden"
aria-label={isOpen ? t("closeMenu") : t("openMenu")}
>
{isOpen ? <X className="h-4 w-4" /> : <Menu className="h-4 w-4" />}
</Button>
</div>
{isOpen ? (
<div className="border-t border-default px-4 py-4 md:hidden">
<nav className="flex flex-col gap-3">
{navItems.map((item) => (
<Link
key={item.key}
href={`/${locale}${item.path}`}
className="text-sm text-muted"
onClick={() => setIsOpen(false)}
>
{t(item.key)}
</Link>
))}
{isAdmin ? (
<a href="/root" className="text-sm text-muted" onClick={() => setIsOpen(false)}>
{t("root")}
</a>
) : null}
</nav>
<div className="mt-4 flex items-center gap-2">
<ThemeToggle />
<Button type="button" variant="outline" size="sm" className="text-xs">
{t("languagePlaceholder")}
</Button>
</div>
</div>
) : null}
</header>
);
}
+9 -4
View File
@@ -3,9 +3,14 @@
import { Moon, Sun } from "lucide-react"; import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes"; import { useTheme } from "next-themes";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Button } from "@/src/components/ui/button";
export function ThemeToggle() { import { Button } from "@/components/ui/button";
type ThemeToggleProps = {
ariaLabel?: string;
};
export function ThemeToggle({ ariaLabel = "Toggle theme" }: ThemeToggleProps) {
const { setTheme, theme, resolvedTheme } = useTheme(); const { setTheme, theme, resolvedTheme } = useTheme();
const [mounted, setMounted] = useState(false); const [mounted, setMounted] = useState(false);
@@ -15,7 +20,7 @@ export function ThemeToggle() {
if (!mounted) { if (!mounted) {
return ( return (
<Button type="button" variant="outline" size="icon" aria-label="Toggle theme"> <Button type="button" variant="outline" size="icon" aria-label={ariaLabel}>
<Moon className="h-4 w-4" /> <Moon className="h-4 w-4" />
</Button> </Button>
); );
@@ -25,7 +30,7 @@ export function ThemeToggle() {
const isDark = activeTheme === "dark"; const isDark = activeTheme === "dark";
return ( return (
<Button type="button" variant="outline" size="icon" onClick={() => setTheme(isDark ? "light" : "dark")} aria-label="Toggle theme"> <Button type="button" variant="outline" size="icon" onClick={() => setTheme(isDark ? "light" : "dark")} aria-label={ariaLabel}>
{isDark ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />} {isDark ? <Sun className="h-4 w-4" /> : <Moon className="h-4 w-4" />}
</Button> </Button>
); );
+59
View File
@@ -0,0 +1,59 @@
import * as React from "react";
import { cva, type VariantProps } from "class-variance-authority";
import { Card } from "@/components/ui/card";
import { cn } from "@/lib/utils";
const appCardVariants = cva(
"rounded-surface border transition-all duration-200",
{
variants: {
level: {
1: "border-border bg-surface-1 text-foreground shadow-card",
2: "border-border bg-surface-2 text-foreground shadow-sm",
3: "border-border/90 bg-surface-3 text-foreground shadow-panel",
inverse: "border-transparent bg-surface-inverse text-surface-inverse-foreground shadow-lg",
},
padding: {
none: "",
sm: "p-4",
md: "p-6",
lg: "p-8",
},
interactive: {
true: "hover:-translate-y-0.5 hover:border-border-strong hover:shadow-md",
false: "",
},
},
defaultVariants: {
level: 1,
padding: "none",
interactive: false,
},
},
);
export interface AppCardProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof appCardVariants> {}
const AppCard = React.forwardRef<HTMLDivElement, AppCardProps>(
({ className, level, padding, interactive, ...props }, ref) => (
<Card
ref={ref}
className={cn(
appCardVariants({
level,
padding,
interactive,
}),
className,
)}
{...props}
/>
),
);
AppCard.displayName = "AppCard";
export { AppCard, appCardVariants };
@@ -4,15 +4,15 @@ import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
const badgeVariants = cva( const badgeVariants = cva(
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", "inline-flex items-center rounded-pill border px-2.5 py-1 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{ {
variants: { variants: {
variant: { variant: {
default: "border-transparent bg-primary text-primary-foreground", default: "border-transparent bg-primary text-primary-foreground",
secondary: "border-transparent bg-secondary text-secondary-foreground", secondary: "border-transparent bg-secondary text-secondary-foreground",
outline: "text-foreground", outline: "border-border bg-surface-1 text-foreground",
success: "border-transparent bg-emerald-600/20 text-emerald-700 dark:text-emerald-300", success: "border-transparent bg-status-success-soft text-status-success",
warning: "border-transparent bg-amber-500/20 text-amber-700 dark:text-amber-300", warning: "border-transparent bg-status-warning-soft text-status-warning",
}, },
}, },
defaultVariants: { defaultVariants: {
@@ -21,7 +21,9 @@ const badgeVariants = cva(
}, },
); );
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {} export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}
function Badge({ className, variant, ...props }: BadgeProps) { function Badge({ className, variant, ...props }: BadgeProps) {
return <div className={cn(badgeVariants({ variant }), className)} {...props} />; return <div className={cn(badgeVariants({ variant }), className)} {...props} />;
@@ -5,21 +5,21 @@ import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
const buttonVariants = cva( const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-nested text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
{ {
variants: { variants: {
variant: { variant: {
default: "bg-primary text-primary-foreground shadow-xs hover:brightness-95", default: "bg-primary text-primary-foreground shadow-xs hover:brightness-95",
secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/85", secondary: "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
outline: "border border-input bg-background shadow-xs hover:bg-muted", outline: "border border-border bg-surface-1 text-foreground shadow-xs hover:border-border-strong hover:bg-surface-2",
ghost: "hover:bg-muted hover:text-foreground", ghost: "text-muted-foreground hover:bg-muted hover:text-foreground",
link: "text-primary underline-offset-4 hover:underline", link: "rounded-none text-primary underline-offset-4 hover:underline",
destructive: "bg-destructive text-destructive-foreground shadow-xs hover:brightness-95", destructive: "bg-destructive text-destructive-foreground shadow-xs hover:brightness-95",
}, },
size: { size: {
default: "h-10 px-4 py-2", default: "h-10 px-4 py-2",
sm: "h-9 rounded-md px-3", sm: "h-9 px-3",
lg: "h-11 rounded-md px-8", lg: "h-11 px-6",
icon: "h-10 w-10", icon: "h-10 w-10",
}, },
}, },
@@ -40,9 +40,16 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => { ({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"; const Comp = asChild ? Slot : "button";
return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />; return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
);
}, },
); );
Button.displayName = "Button"; Button.displayName = "Button";
export { Button, buttonVariants }; export { Button, buttonVariants };
@@ -7,38 +7,59 @@ const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElemen
<div <div
ref={ref} ref={ref}
className={cn( className={cn(
"rounded-[var(--radius-card)] border border-border bg-card text-card-foreground shadow-card", "rounded-surface border border-border bg-surface-1 text-card-foreground shadow-card",
className, className,
)} )}
{...props} {...props}
/> />
), ),
); );
Card.displayName = "Card"; Card.displayName = "Card";
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, ...props }, ref) => <div ref={ref} className={cn("flex flex-col space-y-1.5 p-6", className)} {...props} />, ({ className, ...props }, ref) => (
<div ref={ref} className={cn("flex flex-col gap-1.5 p-6", className)} {...props} />
),
); );
CardHeader.displayName = "CardHeader"; CardHeader.displayName = "CardHeader";
const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>( const CardTitle = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLHeadingElement>>(
({ className, ...props }, ref) => <h3 ref={ref} className={cn("text-2xl font-semibold leading-none tracking-tight", className)} {...props} />, ({ className, ...props }, ref) => (
<h3
ref={ref}
className={cn("text-2xl font-semibold leading-none tracking-tight", className)}
{...props}
/>
),
); );
CardTitle.displayName = "CardTitle"; CardTitle.displayName = "CardTitle";
const CardDescription = React.forwardRef<HTMLParagraphElement, React.HTMLAttributes<HTMLParagraphElement>>( const CardDescription = React.forwardRef<
({ className, ...props }, ref) => <p ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />, HTMLParagraphElement,
); React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<p ref={ref} className={cn("text-sm text-muted-foreground", className)} {...props} />
));
CardDescription.displayName = "CardDescription"; CardDescription.displayName = "CardDescription";
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, ...props }, ref) => <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />, ({ className, ...props }, ref) => (
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
),
); );
CardContent.displayName = "CardContent"; CardContent.displayName = "CardContent";
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>( const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, ...props }, ref) => <div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} />, ({ className, ...props }, ref) => (
<div ref={ref} className={cn("flex items-center p-6 pt-0", className)} {...props} />
),
); );
CardFooter.displayName = "CardFooter"; CardFooter.displayName = "CardFooter";
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }; export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
+21
View File
@@ -0,0 +1,21 @@
import * as React from "react";
import { cn } from "@/lib/utils";
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-nested border border-input bg-surface-1 px-3 py-2 text-sm text-foreground ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
ref={ref}
{...props}
/>
),
);
Input.displayName = "Input";
export { Input };
+17
View File
@@ -0,0 +1,17 @@
import * as React from "react";
import { cn } from "@/lib/utils";
function Label({
className,
...props
}: React.LabelHTMLAttributes<HTMLLabelElement>) {
return (
<label
className={cn("text-sm font-medium text-foreground/90", className)}
{...props}
/>
);
}
export { Label };
@@ -6,7 +6,11 @@ type SeparatorProps = React.HTMLAttributes<HTMLDivElement> & {
orientation?: "horizontal" | "vertical"; orientation?: "horizontal" | "vertical";
}; };
function Separator({ className, orientation = "horizontal", ...props }: SeparatorProps) { function Separator({
className,
orientation = "horizontal",
...props
}: SeparatorProps) {
return ( return (
<div <div
className={cn( className={cn(
+114
View File
@@ -0,0 +1,114 @@
"use client";
import * as React from "react";
import { cn } from "@/lib/utils";
type TabsContextValue = {
value: string;
setValue: (value: string) => void;
};
const TabsContext = React.createContext<TabsContextValue | null>(null);
function useTabsContext() {
const context = React.useContext(TabsContext);
if (!context) {
throw new Error("Tabs components must be used within Tabs.");
}
return context;
}
type TabsProps = {
defaultValue: string;
children: React.ReactNode;
className?: string;
};
function Tabs({ defaultValue, children, className }: TabsProps) {
const [value, setValue] = React.useState(defaultValue);
return (
<TabsContext.Provider value={{ value, setValue }}>
<div className={cn("w-full", className)}>{children}</div>
</TabsContext.Provider>
);
}
function TabsList({
className,
...props
}: React.HTMLAttributes<HTMLDivElement>) {
return (
<div
className={cn(
"inline-flex h-auto flex-wrap items-center gap-2 rounded-surface border border-border bg-surface-2 p-1.5",
className,
)}
{...props}
/>
);
}
type TabsTriggerProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
value: string;
};
function TabsTrigger({
className,
value,
onClick,
...props
}: TabsTriggerProps) {
const { value: activeValue, setValue } = useTabsContext();
const isActive = activeValue === value;
return (
<button
type="button"
className={cn(
"inline-flex items-center justify-center rounded-nested px-3 py-2 text-sm font-medium text-muted-foreground transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
isActive && "bg-surface-1 text-foreground shadow-xs",
className,
)}
onClick={(event) => {
setValue(value);
onClick?.(event);
}}
{...props}
/>
);
}
type TabsContentProps = React.HTMLAttributes<HTMLDivElement> & {
value: string;
};
function TabsContent({
className,
value,
children,
...props
}: TabsContentProps) {
const { value: activeValue } = useTabsContext();
if (activeValue !== value) {
return null;
}
return (
<div
className={cn(
"mt-6 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className,
)}
{...props}
>
{children}
</div>
);
}
export { Tabs, TabsContent, TabsList, TabsTrigger };
+20
View File
@@ -0,0 +1,20 @@
import * as React from "react";
import { cn } from "@/lib/utils";
const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"textarea">>(
({ className, ...props }, ref) => (
<textarea
className={cn(
"flex min-h-[112px] w-full rounded-nested border border-input bg-surface-1 px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
ref={ref}
{...props}
/>
),
);
Textarea.displayName = "Textarea";
export { Textarea };
+522
View File
@@ -0,0 +1,522 @@
import { Layers3, Type } from "lucide-react";
import { AppCard } from "@/components/ui/app-card";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import {
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
type UiKitShowcaseProps = {
localeKey: "de" | "en";
};
function UiKitSection({
title,
description,
children,
}: {
title: string;
description: string;
children: React.ReactNode;
}) {
return (
<AppCard>
<CardHeader>
<CardTitle className="text-xl">{title}</CardTitle>
<CardDescription>{description}</CardDescription>
</CardHeader>
<CardContent>{children}</CardContent>
</AppCard>
);
}
export function UiKitShowcase({ localeKey }: UiKitShowcaseProps) {
const copy =
localeKey === "de"
? {
title: "UI Kit",
intro:
"Zentrale Referenz fuer globale Oberflaechen, Steuerelemente und verschachtelte Ebenen.",
cards: "Cards",
buttons: "Buttons",
inputs: "Inputs",
badges: "Badges",
tabs: "Tabs",
surfaces: "Surfaces",
typography: "Typography",
headers: "Headers",
cardsDesc:
"Aussenflaechen, innere Karten und verschachtelte Ebenen mit einheitlicher Hierarchie.",
buttonsDesc:
"Globale Button Varianten und Groessen aus einer zentralen Quelle.",
inputsDesc:
"Gemeinsame Feldzustande mit derselben inneren Radius- und Oberflaechenlogik.",
badgesDesc:
"Kleine Statusmarken mit minimaler, konsistenter Formensprache.",
surfacesDesc:
"Die gesamte Oberflaechenhierarchie basiert auf Level 1 bis 3 und einer inversen Ebene.",
typographyDesc:
"Typografische Grundstufen fuer Seiten, Sektionen und Metainformationen.",
headersDesc:
"Header Muster fuer Seiten und Sektionen innerhalb des Systems.",
tabsDesc:
"Tabs bleiben in einer Route und verwenden dieselbe verschachtelte Steuerlogik.",
outerCard: "Aeussere Card",
surfaceLevel: "Surface Level 1",
innerCard: "Innere Card",
nestedContent: "Verschachtelte Inhalte nutzen den zweiten Radius und eine weichere Oberflaeche.",
nestedSurface: "Verschachtelte Ebene",
nestedSurfaceText: "Mehr Tiefe ohne einen neuen Component Stil zu erfinden.",
interactiveOuterCard: "Interaktive aeussere Card",
hoverText: "Das Hover Verhalten bleibt an dieselbe Oberflaechenebene gebunden.",
inverseOuterCard: "Inverse aeussere Card",
inverseOuterCardText: "Nur verwenden, wenn ein starker Kontrastblock wirklich noetig ist.",
default: "Standard",
secondary: "Sekundaer",
outline: "Outline",
ghost: "Ghost",
destructive: "Destruktiv",
linkButton: "Link Button",
small: "Klein",
large: "Gross",
iconButton: "Icon Button",
disabled: "Deaktiviert",
defaultInput: "Standard Input",
placeholderText: "Platzhaltertext",
filledInput: "Gefuellter Input",
filledValue: "Gefuellter Wert",
disabledInput: "Deaktivierter Input",
disabledState: "Deaktivierter Zustand",
focusPreview: "Focus Vorschau",
focusedLook: "Fokussierte Ansicht",
errorPreview: "Fehler Vorschau",
invalidValue: "Ungueltiger Wert",
textarea: "Textarea",
textareaValue: "Laengerer Feldzustand fuer mehrzeilige Inhalte.",
success: "Erfolg",
warning: "Warnung",
first: "Erste",
second: "Zweite",
third: "Dritte",
firstTabText: "Inhalt des ersten Tabs innerhalb einer Level 1 Oberflaeche.",
secondTabText: "Inhalt des zweiten Tabs mit derselben globalen Hierarchie.",
thirdTabText: "Inhalt des dritten Tabs ohne lokale Sonderstile.",
surfaceOne: "Surface 1",
surfaceOneText: "Aeussere und primaere Container.",
surfaceTwo: "Surface 2",
surfaceTwoText: "Innere und unterstuetzende Panels.",
surfaceThree: "Surface 3",
surfaceThreeText: "Mehr Betonung ohne neue Styling-Zweige.",
inverse: "Inverse",
inverseText: "Reserviert fuer bewusst eingesetzte Kontrastbloecke.",
eyebrow: "Eyebrow",
pageHeading: "Seitenueberschrift",
pageHeadingText: "Begleitender Absatz fuer primaere Seiteneinfuehrungen und Zusammenfassungen.",
sectionHeading: "Abschnittsueberschrift",
sectionHeadingText: "Fuer gruppierte Bereiche innerhalb einer aeusseren Seitenoberflaeche.",
strongSupportingText: "Betonter Begleittext",
pageHeader: "Seitenheader",
outerSurfaceHeader: "Header der aeusseren Oberflaeche",
outerSurfaceHeaderText: "Dieses Muster wird fuer Seitensektionen mit staerkerer Hierarchie genutzt.",
sectionHeader: "Abschnittsheader",
nestedBlockHeading: "Ueberschrift des verschachtelten Blocks",
nestedBlockHeadingText: "Innerhalb einer aeusseren Card verwenden, wenn Inhalte bereits gruppiert sind."
}
: {
title: "UI Kit",
intro:
"Central reference for global surfaces, controls, and nested interface levels.",
cards: "Cards",
buttons: "Buttons",
inputs: "Inputs",
badges: "Badges",
tabs: "Tabs",
surfaces: "Surfaces",
typography: "Typography",
headers: "Headers",
cardsDesc:
"Outer surfaces, inner cards, and nested levels with one consistent hierarchy.",
buttonsDesc:
"Global button variants and sizes from one shared source of truth.",
inputsDesc:
"Shared field states using the same inner radius and surface logic.",
badgesDesc:
"Small status markers with a minimal and consistent shape language.",
surfacesDesc:
"The full surface hierarchy is built on level 1 through 3 and one inverse layer.",
typographyDesc:
"Typography foundations for pages, sections, and supporting copy.",
headersDesc:
"Header patterns for pages and sections inside the system.",
tabsDesc:
"Tabs stay within one route and use the same nested control logic.",
outerCard: "Outer card",
surfaceLevel: "Surface level 1",
innerCard: "Inner card",
nestedContent: "Nested content uses the secondary radius and a softer surface.",
nestedSurface: "Nested surface",
nestedSurfaceText: "Deeper emphasis without inventing a new component style.",
interactiveOuterCard: "Interactive outer card",
hoverText: "Hover behavior stays attached to the same surface level.",
inverseOuterCard: "Inverse outer card",
inverseOuterCardText: "Use only when a strong contrast block is truly needed.",
default: "Default",
secondary: "Secondary",
outline: "Outline",
ghost: "Ghost",
destructive: "Destructive",
linkButton: "Link button",
small: "Small",
large: "Large",
iconButton: "Icon button",
disabled: "Disabled",
defaultInput: "Default input",
placeholderText: "Placeholder text",
filledInput: "Filled input",
filledValue: "Filled value",
disabledInput: "Disabled input",
disabledState: "Disabled state",
focusPreview: "Focus-style preview",
focusedLook: "Focused look",
errorPreview: "Error-style preview",
invalidValue: "Invalid value",
textarea: "Textarea",
textareaValue: "Longer field state for multiline content.",
success: "Success",
warning: "Warning",
first: "First",
second: "Second",
third: "Third",
firstTabText: "First tab content inside a level 1 surface.",
secondTabText: "Second tab content using the same global hierarchy.",
thirdTabText: "Third tab content without local custom styling.",
surfaceOne: "Surface 1",
surfaceOneText: "Outer and primary containers.",
surfaceTwo: "Surface 2",
surfaceTwoText: "Inner and supporting panels.",
surfaceThree: "Surface 3",
surfaceThreeText: "Raised emphasis without new styling branches.",
inverse: "Inverse",
inverseText: "Reserved for deliberate high-contrast blocks.",
eyebrow: "Eyebrow",
pageHeading: "Page heading",
pageHeadingText: "Supporting paragraph text for primary page introductions and summaries.",
sectionHeading: "Section heading",
sectionHeadingText: "Use this for grouped blocks inside an outer page surface.",
strongSupportingText: "Strong supporting text",
pageHeader: "Page header",
outerSurfaceHeader: "Outer surface header",
outerSurfaceHeaderText: "This pattern is used for page-level sections that need stronger hierarchy.",
sectionHeader: "Section header",
nestedBlockHeading: "Nested block heading",
nestedBlockHeadingText: "Use inside an outer card when content is already grouped."
};
return (
<div className="flex flex-col gap-section">
<AppCard level={3}>
<CardContent className="flex flex-col gap-4 p-6 lg:p-10">
<div className="inline-flex w-fit items-center gap-2 rounded-pill border border-border bg-surface-1 px-3 py-1 text-xs font-semibold uppercase tracking-[0.14em] text-foreground/80">
<Layers3 className="h-3.5 w-3.5 text-brand-secondary" />
{copy.title}
</div>
<div className="space-y-3">
<h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-5xl">
{copy.title}
</h1>
<p className="max-w-3xl text-base text-muted-foreground sm:text-lg">
{copy.intro}
</p>
</div>
</CardContent>
</AppCard>
<Tabs defaultValue="cards">
<TabsList>
<TabsTrigger value="cards">{copy.cards}</TabsTrigger>
<TabsTrigger value="buttons">{copy.buttons}</TabsTrigger>
<TabsTrigger value="inputs">{copy.inputs}</TabsTrigger>
<TabsTrigger value="badges">{copy.badges}</TabsTrigger>
<TabsTrigger value="tabs">{copy.tabs}</TabsTrigger>
<TabsTrigger value="surfaces">{copy.surfaces}</TabsTrigger>
<TabsTrigger value="typography">{copy.typography}</TabsTrigger>
<TabsTrigger value="headers">{copy.headers}</TabsTrigger>
</TabsList>
<TabsContent value="cards">
<UiKitSection title={copy.cards} description={copy.cardsDesc}>
<div className="grid gap-6 lg:grid-cols-2">
<AppCard level={1}>
<CardContent className="space-y-4 p-6">
<div>
<p className="text-sm font-medium text-muted-foreground">{copy.outerCard}</p>
<h3 className="mt-1 text-lg font-semibold text-foreground">{copy.surfaceLevel}</h3>
</div>
<AppCard level={2}>
<CardContent className="space-y-3 p-5">
<div>
<p className="text-sm font-medium text-muted-foreground">{copy.innerCard}</p>
<p className="mt-1 text-sm text-muted-foreground">
{copy.nestedContent}
</p>
</div>
<AppCard level={3}>
<CardContent className="space-y-2 p-4">
<p className="text-sm font-medium text-foreground">{copy.nestedSurface}</p>
<p className="text-sm text-muted-foreground">
{copy.nestedSurfaceText}
</p>
</CardContent>
</AppCard>
</CardContent>
</AppCard>
</CardContent>
</AppCard>
<div className="grid gap-4">
<AppCard level={1} interactive>
<CardContent className="p-5">
<p className="text-sm font-medium text-muted-foreground">{copy.interactiveOuterCard}</p>
<p className="mt-2 text-sm text-muted-foreground">
{copy.hoverText}
</p>
</CardContent>
</AppCard>
<AppCard level="inverse">
<CardContent className="p-5">
<p className="text-sm font-medium text-surface-inverse-foreground/80">
{copy.inverseOuterCard}
</p>
<p className="mt-2 text-sm text-surface-inverse-foreground/88">
{copy.inverseOuterCardText}
</p>
</CardContent>
</AppCard>
</div>
</div>
</UiKitSection>
</TabsContent>
<TabsContent value="buttons">
<UiKitSection title={copy.buttons} description={copy.buttonsDesc}>
<div className="grid gap-6 lg:grid-cols-2">
<AppCard level={2}>
<CardContent className="flex flex-wrap gap-3 p-5">
<Button>{copy.default}</Button>
<Button variant="secondary">{copy.secondary}</Button>
<Button variant="outline">{copy.outline}</Button>
<Button variant="ghost">{copy.ghost}</Button>
<Button variant="destructive">{copy.destructive}</Button>
<Button variant="link">{copy.linkButton}</Button>
</CardContent>
</AppCard>
<AppCard level={2}>
<CardContent className="flex flex-wrap items-center gap-3 p-5">
<Button size="sm">{copy.small}</Button>
<Button>{copy.default}</Button>
<Button size="lg">{copy.large}</Button>
<Button size="icon" aria-label={copy.iconButton}>
<Layers3 className="h-4 w-4" />
</Button>
<Button disabled>{copy.disabled}</Button>
</CardContent>
</AppCard>
</div>
</UiKitSection>
</TabsContent>
<TabsContent value="inputs">
<UiKitSection title={copy.inputs} description={copy.inputsDesc}>
<div className="grid gap-6 lg:grid-cols-2">
<AppCard level={2}>
<CardContent className="grid gap-4 p-5">
<Label className="grid gap-2">
{copy.defaultInput}
<Input placeholder={copy.placeholderText} />
</Label>
<Label className="grid gap-2">
{copy.filledInput}
<Input defaultValue={copy.filledValue} />
</Label>
<Label className="grid gap-2">
{copy.disabledInput}
<Input disabled defaultValue={copy.disabledState} />
</Label>
</CardContent>
</AppCard>
<AppCard level={2}>
<CardContent className="grid gap-4 p-5">
<Label className="grid gap-2">
{copy.focusPreview}
<Input
defaultValue={copy.focusedLook}
className="ring-2 ring-ring ring-offset-2"
readOnly
/>
</Label>
<Label className="grid gap-2">
{copy.errorPreview}
<Input
defaultValue={copy.invalidValue}
className="border-destructive text-destructive focus-visible:ring-destructive"
readOnly
/>
</Label>
<Label className="grid gap-2">
{copy.textarea}
<Textarea defaultValue={copy.textareaValue} />
</Label>
</CardContent>
</AppCard>
</div>
</UiKitSection>
</TabsContent>
<TabsContent value="badges">
<UiKitSection title={copy.badges} description={copy.badgesDesc}>
<div className="flex flex-wrap gap-3">
<Badge>{copy.default}</Badge>
<Badge variant="secondary">{copy.secondary}</Badge>
<Badge variant="outline">{copy.outline}</Badge>
<Badge variant="success">{copy.success}</Badge>
<Badge variant="warning">{copy.warning}</Badge>
</div>
</UiKitSection>
</TabsContent>
<TabsContent value="tabs">
<UiKitSection title={copy.tabs} description={copy.tabsDesc}>
<AppCard level={2}>
<CardContent className="space-y-4 p-5">
<Tabs defaultValue="first">
<TabsList>
<TabsTrigger value="first">{copy.first}</TabsTrigger>
<TabsTrigger value="second">{copy.second}</TabsTrigger>
<TabsTrigger value="third">{copy.third}</TabsTrigger>
</TabsList>
<TabsContent value="first">
<AppCard level={1}>
<CardContent className="p-4 text-sm text-muted-foreground">
{copy.firstTabText}
</CardContent>
</AppCard>
</TabsContent>
<TabsContent value="second">
<AppCard level={1}>
<CardContent className="p-4 text-sm text-muted-foreground">
{copy.secondTabText}
</CardContent>
</AppCard>
</TabsContent>
<TabsContent value="third">
<AppCard level={1}>
<CardContent className="p-4 text-sm text-muted-foreground">
{copy.thirdTabText}
</CardContent>
</AppCard>
</TabsContent>
</Tabs>
</CardContent>
</AppCard>
</UiKitSection>
</TabsContent>
<TabsContent value="surfaces">
<UiKitSection title={copy.surfaces} description={copy.surfacesDesc}>
<div className="grid gap-4 md:grid-cols-2 xl:grid-cols-4">
<AppCard level={1}>
<CardContent className="p-5">
<p className="font-medium">{copy.surfaceOne}</p>
<p className="mt-2 text-sm text-muted-foreground">{copy.surfaceOneText}</p>
</CardContent>
</AppCard>
<AppCard level={2}>
<CardContent className="p-5">
<p className="font-medium">{copy.surfaceTwo}</p>
<p className="mt-2 text-sm text-muted-foreground">{copy.surfaceTwoText}</p>
</CardContent>
</AppCard>
<AppCard level={3}>
<CardContent className="p-5">
<p className="font-medium">{copy.surfaceThree}</p>
<p className="mt-2 text-sm text-muted-foreground">{copy.surfaceThreeText}</p>
</CardContent>
</AppCard>
<AppCard level="inverse">
<CardContent className="p-5">
<p className="font-medium text-surface-inverse-foreground">{copy.inverse}</p>
<p className="mt-2 text-sm text-surface-inverse-foreground/88">{copy.inverseText}</p>
</CardContent>
</AppCard>
</div>
</UiKitSection>
</TabsContent>
<TabsContent value="typography">
<UiKitSection title={copy.typography} description={copy.typographyDesc}>
<div className="space-y-6">
<div className="space-y-2">
<p className="text-sm font-medium uppercase tracking-[0.14em] text-muted-foreground">
{copy.eyebrow}
</p>
<h1 className="text-4xl font-semibold tracking-tight text-foreground">
{copy.pageHeading}
</h1>
<p className="max-w-2xl text-base text-muted-foreground">
{copy.pageHeadingText}
</p>
</div>
<AppCard level={2}>
<CardContent className="space-y-3 p-5">
<h2 className="text-2xl font-semibold text-foreground">{copy.sectionHeading}</h2>
<p className="text-sm text-muted-foreground">
{copy.sectionHeadingText}
</p>
<p className="text-sm font-medium text-foreground/82">{copy.strongSupportingText}</p>
</CardContent>
</AppCard>
</div>
</UiKitSection>
</TabsContent>
<TabsContent value="headers">
<UiKitSection title={copy.headers} description={copy.headersDesc}>
<div className="grid gap-6 lg:grid-cols-2">
<AppCard level={3}>
<CardContent className="space-y-3 p-6">
<div className="inline-flex w-fit items-center gap-2 rounded-pill border border-border bg-surface-1 px-3 py-1 text-xs font-semibold uppercase tracking-[0.14em] text-foreground/80">
<Type className="h-3.5 w-3.5 text-brand-primary" />
{copy.pageHeader}
</div>
<h2 className="text-3xl font-semibold tracking-tight text-foreground">
{copy.outerSurfaceHeader}
</h2>
<p className="text-base text-muted-foreground">
{copy.outerSurfaceHeaderText}
</p>
</CardContent>
</AppCard>
<AppCard level={2}>
<CardContent className="space-y-3 p-5">
<p className="text-sm font-medium text-muted-foreground">{copy.sectionHeader}</p>
<h3 className="text-xl font-semibold text-foreground">{copy.nestedBlockHeading}</h3>
<p className="text-sm text-muted-foreground">
{copy.nestedBlockHeadingText}
</p>
</CardContent>
</AppCard>
</div>
</UiKitSection>
</TabsContent>
</Tabs>
</div>
);
}
+4 -1
View File
@@ -1,6 +1,9 @@
import { defineRouting } from "next-intl/routing"; import { defineRouting } from "next-intl/routing";
export const routing = defineRouting({ export const routing = defineRouting({
locales: ["en", "de"], locales: ["de", "en", "ar"],
defaultLocale: "de", defaultLocale: "de",
localePrefix: "as-needed",
localeCookie: false,
localeDetection: false,
}); });
+41
View File
@@ -0,0 +1,41 @@
import { routing } from "@/i18n/routing";
export type AppLocale = (typeof routing.locales)[number];
export function resolveLocale(locale: string): AppLocale {
if (locale === "en" || locale === "ar") {
return locale;
}
return routing.defaultLocale;
}
export function getDirection(locale: string): "ltr" | "rtl" {
return resolveLocale(locale) === "ar" ? "rtl" : "ltr";
}
export function stripLocalePrefix(pathname: string): string {
for (const locale of routing.locales) {
if (pathname === `/${locale}`) {
return "/";
}
if (pathname.startsWith(`/${locale}/`)) {
return pathname.slice(locale.length + 1);
}
}
return pathname || "/";
}
export function getLocalizedPath(locale: string, pathname = "/"): string {
const localeKey = resolveLocale(locale);
const normalizedPath = pathname === "" ? "/" : pathname;
const strippedPath = stripLocalePrefix(normalizedPath);
if (localeKey === routing.defaultLocale) {
return strippedPath;
}
return strippedPath === "/" ? `/${localeKey}` : `/${localeKey}${strippedPath}`;
}
+56
View File
@@ -0,0 +1,56 @@
import type { Metadata } from "next";
import { routing } from "@/i18n/routing";
import { AppLocale, getLocalizedPath, resolveLocale } from "@/lib/locale";
function getSiteUrl(): URL {
return new URL(process.env.NEXT_PUBLIC_SITE_URL ?? "https://mohfarawati.de");
}
function toAbsoluteUrl(pathname: string): string {
return new URL(pathname, getSiteUrl()).toString();
}
export function buildLocaleAlternates(pathname: string) {
const languages = Object.fromEntries(
routing.locales.map((locale) => [locale, toAbsoluteUrl(getLocalizedPath(locale, pathname))]),
) as Record<AppLocale, string>;
return {
canonical: toAbsoluteUrl(getLocalizedPath(routing.defaultLocale, pathname)),
languages: {
...languages,
"x-default": toAbsoluteUrl(getLocalizedPath(routing.defaultLocale, pathname)),
},
};
}
type LocalizedMetadataInput = {
locale: string;
pathname: string;
title: string;
description: string;
};
export function buildLocalizedMetadata({
locale,
pathname,
title,
description,
}: LocalizedMetadataInput): Metadata {
const localeKey = resolveLocale(locale);
return {
title,
description,
alternates: buildLocaleAlternates(pathname),
openGraph: {
title,
description,
url: toAbsoluteUrl(getLocalizedPath(localeKey, pathname)),
siteName: "moh-sass",
locale: localeKey,
type: "website",
},
};
}
+40
View File
@@ -0,0 +1,40 @@
import { LayoutDashboard, ShieldAlert, SwatchBook, type LucideIcon } from "lucide-react";
type RootNavigationCopy = {
overview: string;
maintenance: string;
uiKit: string;
};
export type RootNavItem = {
label: string;
href: string;
icon: LucideIcon;
active?: boolean;
};
export function getRootNavigation(
copy: RootNavigationCopy,
active: "overview" | "maintenance" | "ui-kit",
): RootNavItem[] {
return [
{
label: copy.overview,
href: "/root",
icon: LayoutDashboard,
active: active === "overview",
},
{
label: copy.maintenance,
href: "/root/maintenance",
icon: ShieldAlert,
active: active === "maintenance",
},
{
label: copy.uiKit,
href: "/root/ui-kit",
icon: SwatchBook,
active: active === "ui-kit",
},
];
}
+25 -5
View File
@@ -1,4 +1,4 @@
export type AppLocale = "de" | "en"; import type { AppLocale } from "@/lib/locale";
type LocalizedText = Record<AppLocale, string>; type LocalizedText = Record<AppLocale, string>;
@@ -24,14 +24,17 @@ export const portfolioItems: PortfolioItem[] = [
title: { title: {
de: "Brand Redesign", de: "Brand Redesign",
en: "Brand Redesign", en: "Brand Redesign",
ar: "إعادة تصميم الهوية",
}, },
summary: { summary: {
de: "Modernes Redesign fuer eine digitale Marke mit klarer Struktur.", de: "Modernes Redesign fuer eine digitale Marke mit klarer Struktur.",
en: "Modern redesign for a digital brand with a clear system.", en: "Modern redesign for a digital brand with a clear system.",
ar: "إعادة تصميم حديثة لعلامة رقمية مع بنية واضحة.",
}, },
category: { category: {
de: "Branding", de: "Branding",
en: "Branding", en: "Branding",
ar: "الهوية",
}, },
year: "2025", year: "2025",
}, },
@@ -40,14 +43,17 @@ export const portfolioItems: PortfolioItem[] = [
title: { title: {
de: "Commerce Relaunch", de: "Commerce Relaunch",
en: "Commerce Relaunch", en: "Commerce Relaunch",
ar: "إعادة إطلاق المتجر",
}, },
summary: { summary: {
de: "Relaunch eines Shops mit Fokus auf Performance und Conversion.", de: "Relaunch eines Shops mit Fokus auf Performance und Conversion.",
en: "Store relaunch focused on performance and conversion.", en: "Store relaunch focused on performance and conversion.",
ar: "إعادة إطلاق متجر مع تركيز على الأداء والتحويل.",
}, },
category: { category: {
de: "E-Commerce", de: "E-Commerce",
en: "E-Commerce", en: "E-Commerce",
ar: "التجارة الإلكترونية",
}, },
year: "2024", year: "2024",
}, },
@@ -56,14 +62,17 @@ export const portfolioItems: PortfolioItem[] = [
title: { title: {
de: "SaaS Dashboard", de: "SaaS Dashboard",
en: "SaaS Dashboard", en: "SaaS Dashboard",
ar: "لوحة تحكم SaaS",
}, },
summary: { summary: {
de: "Admin Dashboard fuer Teams mit klaren KPIs und Reports.", de: "Admin Dashboard fuer Teams mit klaren KPIs und Reports.",
en: "Admin dashboard for teams with clear KPIs and reports.", en: "Admin dashboard for teams with clear KPIs and reports.",
ar: "لوحة تحكم إدارية للفرق مع مؤشرات وتقارير واضحة.",
}, },
category: { category: {
de: "Web App", de: "Web App",
en: "Web App", en: "Web App",
ar: "تطبيق ويب",
}, },
year: "2024", year: "2024",
}, },
@@ -72,14 +81,17 @@ export const portfolioItems: PortfolioItem[] = [
title: { title: {
de: "Campaign Site", de: "Campaign Site",
en: "Campaign Site", en: "Campaign Site",
ar: "موقع حملة",
}, },
summary: { summary: {
de: "Landing Seite fuer Produktkampagnen mit schneller Iteration.", de: "Landing Seite fuer Produktkampagnen mit schneller Iteration.",
en: "Landing experience for product campaigns and quick iteration.", en: "Landing experience for product campaigns and quick iteration.",
ar: "صفحة هبوط لحملات المنتجات مع تنفيذ سريع.",
}, },
category: { category: {
de: "Marketing", de: "Marketing",
en: "Marketing", en: "Marketing",
ar: "التسويق",
}, },
year: "2023", year: "2023",
}, },
@@ -91,18 +103,22 @@ export const productItems: ProductItem[] = [
name: { name: {
de: "Starter Kit", de: "Starter Kit",
en: "Starter Kit", en: "Starter Kit",
ar: "Starter Kit",
}, },
summary: { summary: {
de: "Basis Paket fuer den schnellen Start von neuen Projekten.", de: "Basis Paket fuer den schnellen Start von neuen Projekten.",
en: "Base package for launching new projects quickly.", en: "Base package for launching new projects quickly.",
ar: "باقة أساسية لبدء المشاريع الجديدة بسرعة.",
}, },
segment: { segment: {
de: "Small Teams", de: "Small Teams",
en: "Small Teams", en: "Small Teams",
ar: "الفرق الصغيرة",
}, },
price: { price: {
de: "ab 990 EUR", de: "ab 990 EUR",
en: "from 990 EUR", en: "from 990 EUR",
ar: "ابتداءً من 990 EUR",
}, },
}, },
{ {
@@ -110,18 +126,22 @@ export const productItems: ProductItem[] = [
name: { name: {
de: "Growth Kit", de: "Growth Kit",
en: "Growth Kit", en: "Growth Kit",
ar: "Growth Kit",
}, },
summary: { summary: {
de: "Skalierbares Paket fuer wachsende Produkte und Prozesse.", de: "Skalierbares Paket fuer wachsende Produkte und Prozesse.",
en: "Scalable package for growing products and processes.", en: "Scalable package for growing products and processes.",
ar: "باقة قابلة للتوسع للمنتجات والعمليات المتنامية.",
}, },
segment: { segment: {
de: "Scaleups", de: "Scaleups",
en: "Scaleups", en: "Scaleups",
ar: "الشركات المتوسعة",
}, },
price: { price: {
de: "ab 2490 EUR", de: "ab 2490 EUR",
en: "from 2490 EUR", en: "from 2490 EUR",
ar: "ابتداءً من 2490 EUR",
}, },
}, },
{ {
@@ -129,26 +149,26 @@ export const productItems: ProductItem[] = [
name: { name: {
de: "Enterprise Kit", de: "Enterprise Kit",
en: "Enterprise Kit", en: "Enterprise Kit",
ar: "Enterprise Kit",
}, },
summary: { summary: {
de: "Massgeschneiderte Loesung fuer grosse Teams und komplexe Systeme.", de: "Massgeschneiderte Loesung fuer grosse Teams und komplexe Systeme.",
en: "Tailored solution for large teams and complex systems.", en: "Tailored solution for large teams and complex systems.",
ar: "حل مخصص للفرق الكبيرة والأنظمة المعقدة.",
}, },
segment: { segment: {
de: "Enterprise", de: "Enterprise",
en: "Enterprise", en: "Enterprise",
ar: "المؤسسات",
}, },
price: { price: {
de: "auf Anfrage", de: "auf Anfrage",
en: "on request", en: "on request",
ar: "عند الطلب",
}, },
}, },
]; ];
export function resolveLocale(locale: string): AppLocale {
return locale === "en" ? "en" : "de";
}
export function pickText(text: LocalizedText, locale: AppLocale): string { export function pickText(text: LocalizedText, locale: AppLocale): string {
return text[locale]; return text[locale];
} }
+98
View File
@@ -0,0 +1,98 @@
{
"navigation": {
"home": "الرئيسية",
"portfolio": "الأعمال",
"products": "المنتجات",
"about": "من أنا",
"contact": "تواصل",
"root": "Root",
"openMenu": "فتح القائمة",
"closeMenu": "إغلاق القائمة",
"themeToggle": "تبديل المظهر"
},
"footer": {
"copyright": "© {year} moh-sass. جميع الحقوق محفوظة."
},
"comingSoon": {
"badge": "Coming Soon",
"titleStart": "شيء",
"titleAccent": "جديد",
"titleEnd": "في الطريق.",
"description": "الموقع حالياً في وضع الصيانة. عم أنهي المحتوى واللمسات الأخيرة قبل الإطلاق.",
"note": "شكراً على صبرك. قريباً ستنطلق نسخة أوضح وأسرع وأقوى."
},
"homepage": {
"heroKicker": "Digital Studio",
"heroTitle": "مواقع ومنتجات تنطلق بسرعة.",
"heroText": "هذه الصفحة الرئيسية تشكل قاعدة لانطلاقة تسويقية ومنتجية متعددة اللغات.",
"portfolioTitle": "أعمال مميزة",
"portfolioText": "منطقة تجريبية لعرض مشاريع مختارة.",
"productsTitle": "منتجات مميزة",
"productsText": "منطقة تجريبية لأهم العروض والمنتجات.",
"ctaTitle": "جاهز للخطوة التالية؟",
"ctaText": "فيك تراسلني لنحدد النطاق الأنسب لمشروعك.",
"toPortfolio": "عرض الأعمال",
"toProducts": "عرض المنتجات",
"toContact": "تواصل معي",
"heroCardTitle": "إطلاق سريع",
"heroCardText": "هيكل ومحتوى ومكونات تساعد على نمو سريع وواضح."
},
"portfolioPage": {
"title": "الأعمال",
"intro": "مجموعة مشاريع مختارة مع تركيز على الوضوح والنتائج.",
"open": "فتح المشروع"
},
"productsPage": {
"title": "المنتجات",
"intro": "باقات للفرق من البداية حتى التوسع.",
"open": "فتح المنتج"
},
"aboutPage": {
"title": "من أنا",
"intro": "أبني تجارب رقمية واضحة للعلامات والمنتجات والفرق.",
"valuesTitle": "كيف أعمل",
"valueA": "الاستراتيجية أولاً",
"valueAText": "كل مشروع يبدأ بهدف واضح ونطاق وأولويات محددة.",
"valueB": "أنظمة نظيفة",
"valueBText": "أعتمد على مكونات قابلة للصيانة وبنية واضحة.",
"valueC": "تعاون قريب",
"valueCText": "دورات قصيرة مع ملاحظات مباشرة طوال التنفيذ.",
"processTitle": "آلية العمل",
"processOne": "اكتشاف وتحديد الهدف",
"processTwo": "تصميم ونمذجة أولية",
"processThree": "بناء واختبار وإطلاق"
},
"contactPage": {
"title": "تواصل",
"intro": "ابعث لي هدفك باختصار وسأعود إليك بسرعة.",
"name": "الاسم",
"email": "البريد الإلكتروني",
"message": "الرسالة",
"submit": "إرسال",
"preview": "فتح صفحة النجاح",
"city": "برلين، ألمانيا"
},
"successPage": {
"title": "شكراً على رسالتك",
"text": "وصلني طلبك وسأرد عليك قريباً.",
"home": "العودة للرئيسية",
"contact": "العودة إلى التواصل"
},
"portfolioDetail": {
"back": "العودة إلى الأعمال",
"challenge": "التحدي",
"solution": "الحل",
"outcome": "النتيجة",
"challengeText": "كان المشروع بحاجة إلى هيكل معلومات أوضح وأداء أسرع.",
"solutionText": "تم بناء التصميم والمكونات والمحتوى ضمن نظام مرن ومترابط.",
"outcomeText": "أصبح نشر المحتوى أسرع ووصول المستخدمين إلى أهدافهم أوضح."
},
"productDetail": {
"back": "العودة إلى المنتجات",
"included": "يشمل",
"stepOne": "جلسة انطلاق وتوضيح النطاق",
"stepTwo": "إعداد التصميم والمكونات",
"stepThree": "تنفيذ وتسليم",
"action": "تواصل لطلب عرض"
}
}
+82 -6
View File
@@ -3,20 +3,96 @@
"home": "Start", "home": "Start",
"portfolio": "Portfolio", "portfolio": "Portfolio",
"products": "Produkte", "products": "Produkte",
"about": "Ueber uns", "about": "Ueber mich",
"contact": "Kontakt", "contact": "Kontakt",
"root": "Root", "root": "Root",
"openMenu": "Menue oeffnen", "openMenu": "Menue oeffnen",
"closeMenu": "Menue schliessen", "closeMenu": "Menue schliessen",
"languagePlaceholder": "DE | EN" "themeToggle": "Theme wechseln"
}, },
"footer": { "footer": {
"copyright": "© {year} moh-sass. Alle Rechte vorbehalten." "copyright": "© {year} moh-sass. Alle Rechte vorbehalten."
}, },
"comingSoon": {
"badge": "Coming Soon",
"titleStart": "Etwas",
"titleAccent": "Neues",
"titleEnd": "ist auf dem Weg.",
"description": "Meine Website ist aktuell im Wartungsmodus. Ich finalisiere Inhalte und den letzten Feinschliff vor dem Launch.",
"note": "Danke fuer deine Geduld. Bald geht eine klarere, schnellere und staerkere Version live."
},
"homepage": { "homepage": {
"kicker": "Willkommen", "heroKicker": "Digital Studio",
"title": "Mehrsprachiger Next.js Start", "heroTitle": "Webseiten und Produkte, die schnell liefern.",
"description": "Diese Startseite nutzt next-intl und ist fuer weitere Sprachen vorbereitet.", "heroText": "Diese Startseite ist die Basis fuer ein mehrsprachiges Marketing- und Produkt-Setup.",
"sectionPlaceholder": "Diese Seite ist bereit fuer deinen Inhalt." "portfolioTitle": "Featured Projects",
"portfolioText": "Platzhalter fuer ausgewaehlte Kundenprojekte.",
"productsTitle": "Featured Products",
"productsText": "Platzhalter fuer die wichtigsten Produktangebote.",
"ctaTitle": "Bereit fuer den naechsten Schritt?",
"ctaText": "Wir planen zusammen den passenden Scope fuer dein Projekt.",
"toPortfolio": "Portfolio ansehen",
"toProducts": "Produkte ansehen",
"toContact": "Kontakt aufnehmen",
"heroCardTitle": "Schneller Rollout",
"heroCardText": "Struktur, Content und Komponenten fuer schnelles Wachstum."
},
"portfolioPage": {
"title": "Portfolio",
"intro": "Eine Auswahl von Projekten mit Fokus auf Klarheit und Ergebnis.",
"open": "Projekt oeffnen"
},
"productsPage": {
"title": "Produkte",
"intro": "Pakete fuer Teams von Start bis Skalierung.",
"open": "Produkt oeffnen"
},
"aboutPage": {
"title": "Ueber mich",
"intro": "Ich baue klare digitale Erlebnisse fuer Marken, Produkte und Teams.",
"valuesTitle": "Wie ich arbeite",
"valueA": "Strategie zuerst",
"valueAText": "Jedes Projekt startet mit Zielbild, Scope und Prioritaeten.",
"valueB": "Saubere Systeme",
"valueBText": "Ich setze auf wartbare Komponenten und klare Strukturen.",
"valueC": "Enge Zusammenarbeit",
"valueCText": "Kurze Schleifen mit direktem Feedback im gesamten Ablauf.",
"processTitle": "Mein Ablauf",
"processOne": "Discovery und Zieldefinition",
"processTwo": "Design und Prototyping",
"processThree": "Build, Test und Launch"
},
"contactPage": {
"title": "Kontakt",
"intro": "Schreib mir kurz dein Ziel und ich melde mich zeitnah.",
"name": "Name",
"email": "E-Mail",
"message": "Nachricht",
"submit": "Senden",
"preview": "Success Seite ansehen",
"city": "Berlin, Deutschland"
},
"successPage": {
"title": "Danke fuer deine Nachricht",
"text": "Ich habe deine Anfrage erhalten und melde mich zeitnah.",
"home": "Zur Startseite",
"contact": "Zur Kontaktseite"
},
"portfolioDetail": {
"back": "Zurueck zum Portfolio",
"challenge": "Herausforderung",
"solution": "Loesung",
"outcome": "Ergebnis",
"challengeText": "Das Projekt brauchte eine klare Informationsarchitektur und schnellere Ladezeiten.",
"solutionText": "Ich habe Design, Komponenten und Content in einem modularen System aufgebaut.",
"outcomeText": "Inhalte koennen schneller ausgerollt werden und Nutzer finden schneller zum Ziel."
},
"productDetail": {
"back": "Zurueck zu Produkten",
"included": "Inklusive",
"stepOne": "Kickoff und Scope Klarheit",
"stepTwo": "Setup von Design und Komponenten",
"stepThree": "Implementierung und Uebergabe",
"action": "Kontakt fuer Angebot"
} }
} }
+81 -5
View File
@@ -8,15 +8,91 @@
"root": "Root", "root": "Root",
"openMenu": "Open menu", "openMenu": "Open menu",
"closeMenu": "Close menu", "closeMenu": "Close menu",
"languagePlaceholder": "DE | EN" "themeToggle": "Toggle theme"
}, },
"footer": { "footer": {
"copyright": "© {year} moh-sass. All rights reserved." "copyright": "© {year} moh-sass. All rights reserved."
}, },
"comingSoon": {
"badge": "Coming Soon",
"titleStart": "Something",
"titleAccent": "new",
"titleEnd": "is on the way.",
"description": "My website is currently in maintenance mode. I am finalizing content and polish before launch.",
"note": "Thank you for your patience. A cleaner, faster, and stronger version is launching soon."
},
"homepage": { "homepage": {
"kicker": "Welcome", "heroKicker": "Digital Studio",
"title": "Modern multilingual starter", "heroTitle": "Websites and products that ship fast.",
"description": "This homepage is wired with next-intl and ready for additional locales.", "heroText": "This homepage is a starter for a multilingual marketing and product setup.",
"sectionPlaceholder": "This page is ready for your content." "portfolioTitle": "Featured Projects",
"portfolioText": "Placeholder area for highlighted client projects.",
"productsTitle": "Featured Products",
"productsText": "Placeholder area for top product offerings.",
"ctaTitle": "Ready for your next step?",
"ctaText": "We can shape the right project scope together.",
"toPortfolio": "View portfolio",
"toProducts": "View products",
"toContact": "Contact me",
"heroCardTitle": "Fast rollout",
"heroCardText": "Structure, content, and components for rapid growth."
},
"portfolioPage": {
"title": "Portfolio",
"intro": "Selected projects with a focus on clarity and outcomes.",
"open": "Open project"
},
"productsPage": {
"title": "Products",
"intro": "Packages for teams from early stage to scale.",
"open": "Open product"
},
"aboutPage": {
"title": "About",
"intro": "I build clear digital experiences for brands, products, and teams.",
"valuesTitle": "How I work",
"valueA": "Strategy first",
"valueAText": "Each project starts with goals, scope, and priorities.",
"valueB": "Clean systems",
"valueBText": "I rely on maintainable components and clear structure.",
"valueC": "Close collaboration",
"valueCText": "Short loops with direct feedback across the full process.",
"processTitle": "My process",
"processOne": "Discovery and goal definition",
"processTwo": "Design and prototyping",
"processThree": "Build, test, and launch"
},
"contactPage": {
"title": "Contact",
"intro": "Share your goal and I will get back quickly.",
"name": "Name",
"email": "Email",
"message": "Message",
"submit": "Submit",
"preview": "Open success page",
"city": "Berlin, Germany"
},
"successPage": {
"title": "Thank you for your message",
"text": "I received your request and will reply shortly.",
"home": "Go to homepage",
"contact": "Back to contact"
},
"portfolioDetail": {
"back": "Back to portfolio",
"challenge": "Challenge",
"solution": "Solution",
"outcome": "Outcome",
"challengeText": "The project needed clearer information architecture and faster performance.",
"solutionText": "I built design, components, and content in a modular system.",
"outcomeText": "Content ships faster and users reach goals more quickly."
},
"productDetail": {
"back": "Back to products",
"included": "Included",
"stepOne": "Kickoff and scope clarity",
"stepTwo": "Design and component setup",
"stepThree": "Implementation and handover",
"action": "Contact for proposal"
} }
} }
+9 -1
View File
@@ -3,6 +3,7 @@ import { NextResponse } from "next/server";
import type { NextRequest } from "next/server"; import type { NextRequest } from "next/server";
import { routing } from "./i18n/routing"; import { routing } from "./i18n/routing";
import { getLocalizedPath } from "./lib/locale";
const intlMiddleware = createMiddleware(routing); const intlMiddleware = createMiddleware(routing);
const ADMIN_SESSION_COOKIE = "moh_admin_session"; const ADMIN_SESSION_COOKIE = "moh_admin_session";
@@ -139,6 +140,13 @@ export default async function middleware(request: NextRequest) {
const isRootBaseRoute = pathname === "/root" || pathname.startsWith("/root/"); const isRootBaseRoute = pathname === "/root" || pathname.startsWith("/root/");
const isRootRoute = isRootBaseRoute; const isRootRoute = isRootBaseRoute;
if (pathname === "/de" || pathname.startsWith("/de/")) {
const redirectUrl = request.nextUrl.clone();
const nextPath = pathname.slice(3) || "/";
redirectUrl.pathname = nextPath;
return NextResponse.redirect(redirectUrl, 308);
}
if (isRootRoute && isRootBasicAuthConfigured() && !isRootBasicAuthValid(request)) { if (isRootRoute && isRootBasicAuthConfigured() && !isRootBasicAuthValid(request)) {
return new NextResponse("Authentication required", { return new NextResponse("Authentication required", {
status: 401, status: 401,
@@ -164,7 +172,7 @@ export default async function middleware(request: NextRequest) {
if (!isAdminAuthenticated) { if (!isAdminAuthenticated) {
const targetLocale = locale ?? routing.defaultLocale; const targetLocale = locale ?? routing.defaultLocale;
const redirectUrl = request.nextUrl.clone(); const redirectUrl = request.nextUrl.clone();
redirectUrl.pathname = `/${targetLocale}/coming-soon`; redirectUrl.pathname = getLocalizedPath(targetLocale, "/coming-soon");
redirectUrl.search = ""; redirectUrl.search = "";
return NextResponse.redirect(redirectUrl); return NextResponse.redirect(redirectUrl);
} }
-24
View File
@@ -1,24 +0,0 @@
import type { ReactNode } from "react";
import { cn } from "@/lib/utils";
type AppShellProps = {
sidebar: ReactNode;
header: ReactNode;
children: ReactNode;
className?: string;
};
export function AppShell({ sidebar, header, children, className }: AppShellProps) {
return (
<div className="min-h-screen bg-background">
<div className="mx-auto flex w-full max-w-[1400px] gap-6 px-4 py-6 sm:px-6 lg:px-8">
<aside className="hidden w-72 shrink-0 md:block">{sidebar}</aside>
<div className={cn("flex min-w-0 flex-1 flex-col gap-6", className)}>
{header}
<main>{children}</main>
</div>
</div>
</div>
);
}
-22
View File
@@ -1,22 +0,0 @@
import * as React from "react";
import { cn } from "@/lib/utils";
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-10 w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
ref={ref}
{...props}
/>
);
},
);
Input.displayName = "Input";
export { Input };
-9
View File
@@ -1,9 +0,0 @@
import * as React from "react";
import { cn } from "@/lib/utils";
function Label({ className, ...props }: React.LabelHTMLAttributes<HTMLLabelElement>) {
return <label className={cn("text-sm font-medium text-foreground/90", className)} {...props} />;
}
export { Label };
-21
View File
@@ -1,21 +0,0 @@
import * as React from "react";
import { cn } from "@/lib/utils";
const Textarea = React.forwardRef<HTMLTextAreaElement, React.ComponentProps<"textarea">>(
({ className, ...props }, ref) => {
return (
<textarea
className={cn(
"flex min-h-[88px] w-full rounded-[var(--radius-input)] border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
className,
)}
ref={ref}
{...props}
/>
);
},
);
Textarea.displayName = "Textarea";
export { Textarea };
+46 -5
View File
@@ -13,10 +13,18 @@ const config: Config = {
extend: { extend: {
colors: { colors: {
border: "hsl(var(--border))", border: "hsl(var(--border))",
"border-strong": "hsl(var(--border-strong))",
input: "hsl(var(--input))", input: "hsl(var(--input))",
ring: "hsl(var(--ring))", ring: "hsl(var(--ring))",
background: "hsl(var(--background))", background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))", foreground: "hsl(var(--foreground))",
surface: {
1: "hsl(var(--surface-1))",
2: "hsl(var(--surface-2))",
3: "hsl(var(--surface-3))",
inverse: "hsl(var(--surface-inverse))",
"inverse-foreground": "hsl(var(--surface-inverse-foreground))",
},
primary: { primary: {
DEFAULT: "hsl(var(--primary))", DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))", foreground: "hsl(var(--primary-foreground))",
@@ -45,6 +53,16 @@ const config: Config = {
DEFAULT: "hsl(var(--popover))", DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))", foreground: "hsl(var(--popover-foreground))",
}, },
brand: {
primary: "hsl(var(--brand-primary))",
secondary: "hsl(var(--brand-secondary))",
},
status: {
success: "hsl(var(--status-success))",
"success-soft": "hsl(var(--status-success-soft))",
warning: "hsl(var(--status-warning))",
"warning-soft": "hsl(var(--status-warning-soft))",
},
sidebar: { sidebar: {
DEFAULT: "hsl(var(--sidebar-background))", DEFAULT: "hsl(var(--sidebar-background))",
foreground: "hsl(var(--sidebar-foreground))", foreground: "hsl(var(--sidebar-foreground))",
@@ -57,11 +75,13 @@ const config: Config = {
}, },
}, },
borderRadius: { borderRadius: {
lg: "var(--radius)", sm: "var(--radius-nested)",
md: "var(--radius-input)", md: "var(--radius-nested)",
sm: "calc(var(--radius-input) - 2px)", lg: "var(--radius-surface)",
card: "var(--radius-card)", xl: "var(--radius-surface)",
sidebar: "var(--radius-sidebar)", surface: "var(--radius-surface)",
nested: "var(--radius-nested)",
pill: "var(--radius-pill)",
}, },
boxShadow: { boxShadow: {
xs: "var(--shadow-xs)", xs: "var(--shadow-xs)",
@@ -69,10 +89,31 @@ const config: Config = {
md: "var(--shadow-md)", md: "var(--shadow-md)",
lg: "var(--shadow-lg)", lg: "var(--shadow-lg)",
card: "var(--shadow-card)", card: "var(--shadow-card)",
panel: "var(--shadow-panel)",
sidebar: "var(--shadow-sidebar)", sidebar: "var(--shadow-sidebar)",
}, },
maxWidth: {
narrow: "var(--container-narrow)",
layout: "var(--container-default)",
wide: "var(--container-wide)",
admin: "var(--container-admin)",
},
height: {
header: "var(--header-height)",
},
minHeight: {
header: "var(--header-height)",
},
spacing: {
section: "var(--section-space)",
content: "var(--content-space)",
},
backdropBlur: {
chrome: "18px",
},
}, },
}, },
plugins: [animate], plugins: [animate],
}; };
export default config; export default config;