style: make home page layout more professional
CI / check (push) Successful in 34s
CI / release (push) Skipped
CI / deploy (push) Successful in 1m1s

Unify the per-section neon gradient headers (blue/green/purple) into a
single consistent SectionCard component with a calm surface header and
hairline divider, constrain the page to a centered max-w-6xl container,
and soften the hero/cards with rounded-3xl corners and subtle shadows.
This commit is contained in:
openhands committed 2026-08-27 15:21:25 +02:00
1 parent 89c1751e79
commit 005af25773
2 files changed
+237 -304

No files matched your search

+153 -304
View File
@@ -8,6 +8,7 @@ import { AmbientOrbs } from "@/components/ambient-orbs";
import { AnimatedCounter } from "@/components/animated-counter"; import { AnimatedCounter } from "@/components/animated-counter";
import { HomeLoginForm } from "@/components/auth/home-login-form"; import { HomeLoginForm } from "@/components/auth/home-login-form";
import { Clock } from "@/components/clock"; import { Clock } from "@/components/clock";
import { SectionCard } from "@/components/home-section";
import { LanguageSwitcher } from "@/components/language-switcher"; import { LanguageSwitcher } from "@/components/language-switcher";
import { Reveal } from "@/components/motion-reveal"; import { Reveal } from "@/components/motion-reveal";
import { UserAvatarThumbnail } from "@/components/shared/user-avatar-thumbnail"; import { UserAvatarThumbnail } from "@/components/shared/user-avatar-thumbnail";
@@ -115,7 +116,7 @@ export default async function Home() {
const nonce = (await headers()).get("x-nonce") ?? undefined; const nonce = (await headers()).get("x-nonce") ?? undefined;
return ( return (
<div className="flex flex-col gap-10 pb-14"> <div className="mx-auto w-full max-w-6xl flex flex-col gap-8 pb-16">
{/* ── Top Bar ── */} {/* ── Top Bar ── */}
<Reveal> <Reveal>
<div <div
@@ -188,7 +189,7 @@ export default async function Home() {
{/* ── Hero ── */} {/* ── Hero ── */}
<Reveal> <Reveal>
<div <div
className="relative overflow-hidden rounded-2xl border" className="relative overflow-hidden rounded-3xl border"
style={{ style={{
borderColor: borderColor:
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)", "color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
@@ -206,12 +207,12 @@ export default async function Home() {
className="absolute inset-0" className="absolute inset-0"
style={{ style={{
background: background:
"linear-gradient(135deg, color-mix(in srgb, var(--color-surface) 90%, transparent) 0%, color-mix(in srgb, var(--color-surface) 35%, transparent) 50%, color-mix(in srgb, var(--color-surface) 10%, transparent) 100%)", "linear-gradient(135deg, color-mix(in srgb, var(--color-surface) 92%, transparent) 0%, color-mix(in srgb, var(--color-surface) 45%, transparent) 50%, color-mix(in srgb, var(--color-surface) 12%, transparent) 100%)",
}} }}
/> />
<AmbientOrbs /> <AmbientOrbs />
<div <div
className="relative flex flex-col md:flex-row items-center gap-8 px-6 py-10 md:px-10 md:py-14" className="relative flex flex-col items-center gap-8 px-6 py-12 md:flex-row md:px-12 md:py-16"
style={{ zIndex: 2 }} style={{ zIndex: 2 }}
> >
<div className="flex-1 text-center md:text-left"> <div className="flex-1 text-center md:text-left">
@@ -232,7 +233,7 @@ export default async function Home() {
{th("online", { count: online, hotel: hotelName })} {th("online", { count: online, hotel: hotelName })}
</div> </div>
<h1 <h1
className="text-4xl md:text-5xl lg:text-6xl font-black leading-[1.05] tracking-tight mb-3" className="text-4xl font-black leading-[1.05] tracking-tight mb-3 md:text-5xl lg:text-6xl"
style={{ style={{
color: "var(--color-text-readable)", color: "var(--color-text-readable)",
fontFamily: "var(--font-nunito)", fontFamily: "var(--font-nunito)",
@@ -241,7 +242,7 @@ export default async function Home() {
<TypewriterText text={tp("welcome", { hotelName })} /> <TypewriterText text={tp("welcome", { hotelName })} />
</h1> </h1>
<p <p
className="text-base md:text-lg leading-relaxed max-w-xl mb-7" className="text-base leading-relaxed max-w-xl mb-7 md:text-lg"
style={{ color: "var(--color-text-muted)" }} style={{ color: "var(--color-text-muted)" }}
> >
{th("tagline")} {th("tagline")}
@@ -322,14 +323,12 @@ export default async function Home() {
].map((s) => ( ].map((s) => (
<div <div
key={s.label} key={s.label}
className="relative overflow-hidden rounded-xl border p-5 text-center transition-all duration-300 hover:-translate-y-1 hover:shadow-xl card-premium" className="relative overflow-hidden rounded-2xl border bg-[var(--color-surface)] p-5 text-center transition-all duration-300 hover:-translate-y-1 hover:shadow-xl"
style={{ style={{
background:
"color-mix(in srgb, var(--color-surface) 70%, transparent)",
backdropFilter: "blur(8px)",
WebkitBackdropFilter: "blur(8px)",
borderColor: borderColor:
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)", "color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
boxShadow:
"0 1px 2px color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
}} }}
> >
<div <div
@@ -338,7 +337,7 @@ export default async function Home() {
/> />
<div className="relative"> <div className="relative">
<div <div
className="w-10 h-10 rounded-xl flex items-center justify-center mx-auto mb-2.5 animate-pulse-glow" className="mx-auto mb-2.5 flex h-10 w-10 items-center justify-center rounded-xl"
style={{ style={{
background: background:
"color-mix(in srgb, var(--color-primary) 14%, transparent)", "color-mix(in srgb, var(--color-primary) 14%, transparent)",
@@ -353,7 +352,7 @@ export default async function Home() {
/> />
</div> </div>
<div <div
className="text-3xl md:text-4xl font-black tracking-tight mb-0.5" className="mb-0.5 text-3xl font-black tracking-tight md:text-4xl"
style={{ color: "var(--color-primary)" }} style={{ color: "var(--color-primary)" }}
> >
<AnimatedCounter value={s.value} /> <AnimatedCounter value={s.value} />
@@ -374,52 +373,24 @@ export default async function Home() {
<div className="flex flex-col gap-4 md:flex-row"> <div className="flex flex-col gap-4 md:flex-row">
{/* Left: Login & Register */} {/* Left: Login & Register */}
<Reveal className="flex w-full flex-col gap-4 md:w-1/3 md:flex-shrink-0"> <Reveal className="flex w-full flex-col gap-4 md:w-1/3 md:flex-shrink-0">
<div <SectionCard
className="overflow-hidden rounded-xl border" title={th("login")}
style={{ icon="/assets/images/icons/navigation/me.png"
borderColor: bodyClassName="p-4"
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
}}
> >
<div <HomeLoginForm
className="flex items-center gap-2.5 px-4 py-3" captcha={{
style={{ provider: captcha.provider,
background: siteKey: captcha.siteKey || undefined,
"linear-gradient(140deg, #1a3a5c 0%, #1e4a6e 20%, #2a5a80 40%, #3a6a90 60%, #4a7aa0 75%, #3a6a90 90%, #2a5a80 100%)", field: captcha.field || undefined,
}} }}
> nonce={nonce}
<Image />
src="/assets/images/icons/navigation/me.png" </SectionCard>
alt=""
width={18}
height={18}
unoptimized
/>
<h2
className="text-sm font-bold text-white"
style={{ fontFamily: "var(--font-nunito)" }}
>
Login
</h2>
</div>
<div
className="p-3"
style={{ backgroundColor: "var(--color-surface)" }}
>
<HomeLoginForm
captcha={{
provider: captcha.provider,
siteKey: captcha.siteKey || undefined,
field: captcha.field || undefined,
}}
nonce={nonce}
/>
</div>
</div>
<Link href="/register" className="relative block group"> <Link href="/register" className="relative block group">
<div <div
className="overflow-hidden rounded-xl border transition-all duration-200 group-hover:shadow-lg" className="overflow-hidden rounded-2xl border transition-all duration-200 group-hover:shadow-lg"
style={{ style={{
borderColor: borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)", "color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
@@ -435,7 +406,7 @@ export default async function Home() {
/> />
</div> </div>
<span <span
className="pointer-events-none absolute inset-0 flex items-center text-2xl md:text-3xl font-extrabold text-white" className="pointer-events-none absolute inset-0 flex items-center text-2xl font-extrabold text-white md:text-3xl"
style={{ style={{
marginLeft: "18px", marginLeft: "18px",
fontFamily: "var(--font-nunito)", fontFamily: "var(--font-nunito)",
@@ -447,50 +418,24 @@ export default async function Home() {
</Link> </Link>
{latestUsers.length > 0 && ( {latestUsers.length > 0 && (
<div <SectionCard
className="overflow-hidden rounded-xl border" title={tp("latestUsers", { count: users.toLocaleString() })}
style={{ icon="/assets/images/icons/navigation/goody.png"
borderColor: bodyClassName="p-4"
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
backgroundColor: "var(--color-surface)",
}}
> >
<div <div className="grid grid-cols-4 gap-2">
className="flex items-center gap-2.5 px-4 py-3"
style={{
background:
"linear-gradient(140deg, #0A1F0A 0%, #0F2D0F 20%, #153C15 40%, #1B4A1B 60%, #205820 75%, #1A4A1A 90%, #143814 100%)",
}}
>
<Image
src="/assets/images/icons/navigation/goody.png"
alt=""
width={18}
height={18}
unoptimized
/>
<h2
className="text-sm font-bold text-white"
style={{ fontFamily: "var(--font-nunito)" }}
>
{tp("latestUsers", { count: users.toLocaleString() })}
</h2>
</div>
<div className="grid grid-cols-4 gap-2 p-3">
{latestUsers.map((u) => ( {latestUsers.map((u) => (
<div <div
key={u.username} key={u.username}
className="flex flex-col items-center gap-1" className="flex flex-col items-center gap-1"
> >
<div className="relative overflow-visible"> <UserAvatarThumbnail
<UserAvatarThumbnail figure={u.look}
figure={u.look} alt={u.username}
alt={u.username} options={{ direction: 3 }}
options={{ direction: 3 }} />
/>
</div>
<span <span
className="text-[11px] font-bold truncate max-w-[64px] text-center leading-tight" className="max-w-[64px] truncate text-center text-[11px] font-bold leading-tight"
style={{ color: "var(--color-text-readable)" }} style={{ color: "var(--color-text-readable)" }}
> >
{u.username} {u.username}
@@ -498,187 +443,118 @@ export default async function Home() {
</div> </div>
))} ))}
</div> </div>
</div> </SectionCard>
)} )}
</Reveal> </Reveal>
{/* Right: News */} {/* Right: News */}
<Reveal delay={0.15} className="flex w-full flex-col gap-4 md:w-2/3"> <Reveal delay={0.15} className="flex w-full flex-col gap-4 md:w-2/3">
<div <SectionCard
className="overflow-hidden rounded-xl border" title={tp("latestNews")}
style={{ icon="/assets/images/icons/article.gif"
borderColor: actionHref="/news"
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)", actionLabel={tp("allNews")}
backgroundColor: "var(--color-surface)",
}}
> >
<div {articles.length > 0 ? (
className="flex items-center justify-between px-4 py-3" <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
style={{ {articles.slice(0, 4).map((a) => (
background: <Link
"linear-gradient(140deg, #1a3a5c 0%, #1e4a6e 20%, #2a5a80 40%, #3a6a90 60%, #4a7aa0 75%, #3a6a90 90%, #2a5a80 100%)", key={a.slug}
}} href={`/news/${a.slug}`}
> className="group relative w-full overflow-hidden rounded-xl transition-all duration-300 hover:-translate-y-0.5 hover:shadow-lg"
<div className="flex items-center gap-2.5"> style={{
<Image height: "200px",
src="/assets/images/icons/article.gif" backgroundColor: "var(--color-background)",
alt="" border:
width={18} "1px solid color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
height={18} }}
unoptimized >
/> <div className="relative h-full w-full overflow-hidden rounded-xl">
<h2 <Image
className="text-sm font-bold text-white" src={a.image}
style={{ fontFamily: "var(--font-nunito)" }} alt={a.title}
> fill
{tp("latestNews")} sizes="(max-width: 768px) 100vw, 400px"
</h2> className="rounded-xl object-cover transition-all duration-300 group-hover:scale-105"
</div> />
<Link <div className="absolute right-2.5 top-2.5 flex h-8 w-8 translate-x-1 items-center justify-center rounded-full bg-black/50 opacity-0 backdrop-blur-sm transition-all duration-300 group-hover:translate-x-0 group-hover:opacity-100">
href="/news" <span className="text-sm font-bold text-white">→</span>
className="text-xs font-bold text-white/80 hover:text-white hover:underline"
>
{tp("allNews")}
</Link>
</div>
<div className="p-4">
{articles.length > 0 ? (
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
{articles.slice(0, 4).map((a) => (
<Link
key={a.slug}
href={`/news/${a.slug}`}
className="group relative w-full overflow-hidden rounded-lg transition-all duration-300 hover:shadow-lg hover:-translate-y-0.5"
style={{
height: "200px",
backgroundColor: "var(--color-background)",
border:
"1px solid color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
}}
>
<div className="relative h-full w-full overflow-hidden rounded-lg">
<Image
src={a.image}
alt={a.title}
fill
sizes="(max-width: 768px) 100vw, 400px"
className="rounded-lg object-cover transition-all duration-300 group-hover:scale-105"
/>
<div className="absolute top-2.5 right-2.5 w-8 h-8 rounded-full flex items-center justify-center bg-black/50 backdrop-blur-sm transition-all duration-300 opacity-0 group-hover:opacity-100 translate-x-1 group-hover:translate-x-0">
<span className="text-white text-sm font-bold">
→
</span>
</div>
<div
className="absolute left-0 w-full p-2.5"
style={{
bottom: 0,
background:
"linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%)",
}}
>
<h3 className="truncate text-base font-bold text-white text-shadow-sm">
{a.title}
</h3>
<p
className="text-[11px] font-semibold mt-0.5 opacity-80"
style={{ color: "var(--color-text-muted)" }}
>
{formatDate(a.createdAt, "date", "")}
</p>
</div>
</div> </div>
</Link> <div
))} className="absolute bottom-0 left-0 w-full p-2.5"
</div> style={{
) : ( background:
<p "linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 100%)",
className="py-8 text-center text-sm" }}
style={{ color: "var(--color-text-muted)" }} >
> <h3 className="truncate text-base font-bold text-white text-shadow-sm">
{tp("noArticles")} {a.title}
</p> </h3>
)} <p
</div> className="mt-0.5 text-[11px] font-semibold opacity-80"
</div> style={{ color: "var(--color-text-muted)" }}
>
{formatDate(a.createdAt, "date", "")}
</p>
</div>
</div>
</Link>
))}
</div>
) : (
<p
className="py-8 text-center text-sm"
style={{ color: "var(--color-text-muted)" }}
>
{tp("noArticles")}
</p>
)}
</SectionCard>
</Reveal> </Reveal>
</div> </div>
{/* ── Online users ── */} {/* ── Online users ── */}
{recentUsers.length > 0 && ( {recentUsers.length > 0 && (
<Reveal> <Reveal>
<div <SectionCard
className="overflow-hidden rounded-xl border" title={tp("recentUsers")}
style={{ icon="/assets/images/icons/navigation/goody.png"
borderColor: actionHref="/community"
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)", actionLabel={tp("allUsers")}
backgroundColor: "var(--color-surface)",
}}
> >
<div <div className="flex flex-wrap justify-center gap-2">
className="flex items-center justify-between px-4 py-3" {recentUsers.slice(0, 12).map((u) => (
style={{ <div
background: key={u.username}
"linear-gradient(140deg, #0A1F0A 0%, #0F2D0F 20%, #153C15 40%, #1B4A1B 60%, #205820 75%, #1A4A1A 90%, #143814 100%)", className="flex flex-col items-center gap-0.5 rounded-lg px-2 py-1.5 transition-all duration-200 hover:scale-110 hover:shadow-md"
}} style={{
> background:
<div className="flex items-center gap-2.5"> "color-mix(in srgb, var(--color-primary) 5%, transparent)",
<Image }}
src="/assets/images/icons/navigation/goody.png"
alt=""
width={18}
height={18}
unoptimized
/>
<h3
className="text-sm font-bold text-white"
style={{ fontFamily: "var(--font-nunito)" }}
> >
{tp("recentUsers")} <UserAvatarThumbnail
</h3> figure={u.look}
</div> alt={u.username}
<Link options={{ direction: 2 }}
href="/community" className="rounded-md"
className="text-xs font-bold text-white/80 hover:text-white hover:underline" />
> <span
{tp("allUsers")} className="max-w-[50px] truncate text-center text-[9px] font-bold leading-tight"
</Link> style={{ color: "var(--color-text-readable)" }}
</div>
<div className="p-4">
<div className="flex flex-wrap justify-center gap-2">
{recentUsers.slice(0, 12).map((u) => (
<div
key={u.username}
className="flex flex-col items-center gap-0.5 px-2 py-1.5 rounded-lg transition-all duration-200 hover:scale-110 hover:shadow-md"
style={{
background:
"color-mix(in srgb, var(--color-primary) 5%, transparent)",
}}
> >
<UserAvatarThumbnail {u.username}
figure={u.look} </span>
alt={u.username} </div>
options={{ direction: 2 }} ))}
className="rounded-md"
/>
<span
className="text-[9px] font-bold truncate max-w-[50px] text-center leading-tight"
style={{ color: "var(--color-text-readable)" }}
>
{u.username}
</span>
</div>
))}
</div>
</div> </div>
</div> </SectionCard>
</Reveal> </Reveal>
)} )}
{/* ── Bottom CTA ── */} {/* ── Bottom CTA ── */}
<Reveal> <Reveal>
<div <div
className="relative overflow-hidden rounded-xl border text-center px-6 py-10" className="relative overflow-hidden rounded-3xl border px-6 py-12 text-center"
style={{ style={{
background: `linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)), color-mix(in srgb, var(--color-surface) 70%, transparent))`, background: `linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 8%, var(--color-surface)), color-mix(in srgb, var(--color-surface) 70%, transparent))`,
borderColor: borderColor:
@@ -686,7 +562,7 @@ export default async function Home() {
}} }}
> >
<h2 <h2
className="text-2xl md:text-3xl font-black tracking-tight mb-2" className="mb-2 text-2xl font-black tracking-tight md:text-3xl"
style={{ style={{
color: "var(--color-text-readable)", color: "var(--color-text-readable)",
fontFamily: "var(--font-nunito)", fontFamily: "var(--font-nunito)",
@@ -695,7 +571,7 @@ export default async function Home() {
{tp("joinNow", { hotelName })} {tp("joinNow", { hotelName })}
</h2> </h2>
<p <p
className="text-sm mb-6 max-w-sm mx-auto" className="mb-6 max-w-sm mx-auto text-sm"
style={{ color: "var(--color-text-muted)" }} style={{ color: "var(--color-text-muted)" }}
> >
{tp("welcomeBody")} {tp("welcomeBody")}
@@ -725,60 +601,33 @@ export default async function Home() {
{/* ── Recent photos ── */} {/* ── Recent photos ── */}
{recentPhotos.length > 0 && ( {recentPhotos.length > 0 && (
<Reveal> <Reveal>
<div <SectionCard
className="overflow-hidden rounded-xl border" title={tp("recentPhotos")}
style={{ icon="/assets/images/icons/camera.png"
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
backgroundColor: "var(--color-surface)",
}}
> >
<div <div className="mx-auto grid max-w-sm grid-cols-4 gap-2">
className="flex items-center gap-2.5 px-4 py-3" {recentPhotos.slice(0, 4).map((p) => (
style={{ <Link
background: key={p.id}
"linear-gradient(140deg, #5a2d82 0%, #6b3a9e 20%, #7d47b8 40%, #8f54d0 60%, #7d47b8 75%, #6b3a9e 90%, #5a2d82 100%)", href="/photos"
}} className="block aspect-square overflow-hidden rounded-xl border transition-all duration-200 hover:shadow-md"
> style={{
<Image borderColor:
src="/assets/images/icons/camera.png" "color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
alt="" }}
width={18} >
height={18} <Image
unoptimized src={p.url}
/> alt=""
<h3 width={200}
className="text-sm font-bold text-white" height={200}
style={{ fontFamily: "var(--font-nunito)" }} className="h-full w-full object-cover transition-transform duration-300 hover:scale-105"
> unoptimized
{tp("recentPhotos")} />
</h3> </Link>
))}
</div> </div>
<div className="p-4"> </SectionCard>
<div className="grid grid-cols-4 gap-2 max-w-sm mx-auto">
{recentPhotos.slice(0, 4).map((p) => (
<Link
key={p.id}
href="/photos"
className="block rounded-lg overflow-hidden aspect-square border transition-all duration-200 hover:shadow-md"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
}}
>
<Image
src={p.url}
alt=""
width={200}
height={200}
className="w-full h-full object-cover hover:scale-105 transition-transform duration-300"
unoptimized
/>
</Link>
))}
</div>
</div>
</div>
</Reveal> </Reveal>
)} )}
</div> </div>
+84
View File
@@ -0,0 +1,84 @@
import Image from "next/image";
import Link from "next/link";
import type { ReactNode } from "react";
interface SectionCardProps {
title: string;
icon?: string;
actionHref?: string;
actionLabel?: string;
children: ReactNode;
className?: string;
bodyClassName?: string;
}
/**
* Consistent, restrained panel used across the home page. Replaces the
* per-section neon gradients with a single calm surface + hairline divider so
* the page reads as professional rather than game-like.
*/
export function SectionCard({
title,
icon,
actionHref,
actionLabel,
children,
className,
bodyClassName,
}: SectionCardProps) {
return (
<div
className={`overflow-hidden rounded-2xl border bg-[var(--color-surface)] ${
className ?? ""
}`}
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
boxShadow:
"0 1px 2px color-mix(in srgb, var(--color-text-muted) 12%, transparent), 0 8px 24px -12px color-mix(in srgb, var(--color-text-muted) 25%, transparent)",
}}
>
<div
className="flex items-center justify-between gap-3 border-b px-5 py-3.5"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
background:
"color-mix(in srgb, var(--color-text-muted) 4%, transparent)",
}}
>
<div className="flex items-center gap-2.5">
{icon && (
<Image
src={icon}
alt=""
width={18}
height={18}
unoptimized
className="opacity-90"
/>
)}
<h2
className="text-sm font-bold tracking-tight"
style={{
fontFamily: "var(--font-nunito)",
color: "var(--color-text-readable)",
}}
>
{title}
</h2>
</div>
{actionHref && actionLabel && (
<Link
href={actionHref}
className="text-xs font-semibold transition-colors hover:text-[var(--color-primary)] hover:underline"
style={{ color: "var(--color-text-muted)" }}
>
{actionLabel}
</Link>
)}
</div>
<div className={bodyClassName ?? "p-5"}>{children}</div>
</div>
);
}