Refactor shared hero structure
This commit is contained in:
@@ -3,8 +3,8 @@ import { Sparkles } from "lucide-react";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
|
||||
import { FloatingPreferences } from "@/components/layout/floating-preferences";
|
||||
import { HeroMotionBackdrop } from "@/components/layout/hero-motion-backdrop";
|
||||
import { MotionFade } from "@/components/motion-fade";
|
||||
import { HeroShell, HeroTitle } from "@/components/layout/site-hero";
|
||||
import { getSiteSettings } from "@/lib/app-config";
|
||||
import { buildLocalizedMetadata } from "@/lib/metadata";
|
||||
import { resolveLocale } from "@/lib/locale";
|
||||
@@ -37,52 +37,37 @@ export default async function ComingSoonPage({
|
||||
const localeKey = resolveLocale(locale);
|
||||
const t = await getTranslations({ locale: localeKey, namespace: "comingSoon" });
|
||||
const isArabic = localeKey === "ar";
|
||||
const lines = [
|
||||
{
|
||||
text: t("titleLineOne"),
|
||||
tone: "soft" as const,
|
||||
align: isArabic ? "center" as const : "start" as const,
|
||||
},
|
||||
{
|
||||
text: t("titleLineTwo"),
|
||||
tone: "default" as const,
|
||||
align: isArabic ? "center" as const : "end" as const,
|
||||
},
|
||||
{
|
||||
text: t("titleLineThree"),
|
||||
tone: "accent" as const,
|
||||
align: isArabic ? "center" as const : "start" as const,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="relative min-h-screen overflow-hidden">
|
||||
<FloatingPreferences locale={localeKey} />
|
||||
|
||||
<section className="hero-surface hero-home relative isolate flex min-h-screen items-center justify-center overflow-hidden px-4 pb-10 pt-24 sm:px-6 sm:pt-28 lg:px-8">
|
||||
<HeroMotionBackdrop />
|
||||
<div className="hero-header-bridge" />
|
||||
<div className="hero-content-bridge" />
|
||||
|
||||
<HeroShell className="min-h-screen" showBridges>
|
||||
<MotionFade className="relative z-10 w-full">
|
||||
<div className="mx-auto max-w-[56rem] text-center">
|
||||
<p className="inline-flex items-center gap-2 rounded-full border border-black/6 bg-white/24 px-4 py-2 text-sm font-medium tracking-[-0.02em] text-[hsl(var(--hero-ink)/0.84)] shadow-[0_14px_34px_-24px_rgba(15,23,42,0.18)] backdrop-blur-[18px] dark:border-white/10 dark:bg-white/4 dark:text-foreground/84 dark:shadow-[0_20px_48px_-28px_rgba(0,0,0,0.58)]">
|
||||
<p className="inline-flex items-center gap-2 rounded-pill border border-foreground/8 bg-background/55 px-4 py-2 text-sm font-medium tracking-[0.08em] text-[hsl(var(--hero-ink)/0.84)] shadow-[var(--shadow-sm)] backdrop-blur-[18px] dark:border-foreground/10 dark:bg-background/20 dark:text-foreground/84">
|
||||
<Sparkles className="h-3.5 w-3.5 text-brand-secondary" />
|
||||
{t("kicker")}
|
||||
</p>
|
||||
|
||||
<h1
|
||||
className={
|
||||
isArabic
|
||||
? "mx-auto mt-8 flex max-w-[40rem] flex-col items-center gap-y-2 overflow-visible pb-[0.12em] text-[3.35rem] font-bold leading-[1.12] tracking-normal text-[hsl(var(--hero-ink))] drop-shadow-[0_18px_40px_rgba(15,23,42,0.18)] sm:text-[4.7rem] lg:max-w-[44rem] lg:text-[5.5rem]"
|
||||
: "mx-auto mt-8 flex max-w-[44rem] flex-col gap-y-0.5 overflow-visible pb-[0.2em] text-[3.15rem] font-semibold leading-[0.98] tracking-[-0.05em] text-[hsl(var(--hero-ink))] drop-shadow-[0_18px_40px_rgba(15,23,42,0.22)] sm:text-[4.8rem] lg:max-w-[46rem] lg:gap-y-1 lg:pb-[0.22em] lg:text-[5.85rem]"
|
||||
}
|
||||
>
|
||||
<span
|
||||
className={
|
||||
isArabic
|
||||
? "hero-title-line hero-title-accent-soft self-center whitespace-nowrap"
|
||||
: "hero-title-line hero-title-accent-soft self-start whitespace-nowrap"
|
||||
}
|
||||
>
|
||||
{t("titleLineOne")}
|
||||
</span>
|
||||
<span className={isArabic ? "hero-title-line self-center whitespace-nowrap" : "hero-title-line self-end whitespace-nowrap"}>
|
||||
{t("titleLineTwo")}
|
||||
</span>
|
||||
<span
|
||||
className={
|
||||
isArabic
|
||||
? "hero-title-line hero-title-accent self-center whitespace-nowrap"
|
||||
: "hero-title-line hero-title-accent self-start whitespace-nowrap"
|
||||
}
|
||||
>
|
||||
{t("titleLineThree")}
|
||||
</span>
|
||||
</h1>
|
||||
<HeroTitle locale={localeKey} lines={lines} className="mx-auto mt-8 max-w-[46rem]" />
|
||||
|
||||
<p className="mx-auto mt-8 max-w-[34rem] text-sm leading-7 text-foreground/68 sm:text-base">
|
||||
{t("description")}
|
||||
@@ -93,7 +78,7 @@ export default async function ComingSoonPage({
|
||||
</p>
|
||||
</div>
|
||||
</MotionFade>
|
||||
</section>
|
||||
</HeroShell>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user