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 { HomeLoginForm } from "@/components/auth/home-login-form";
import { Clock } from "@/components/clock";
import { SectionCard } from "@/components/home-section";
import { LanguageSwitcher } from "@/components/language-switcher";
import { Reveal } from "@/components/motion-reveal";
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;
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 ── */}
<Reveal>
<div
@@ -188,7 +189,7 @@ export default async function Home() {
{/* ── Hero ── */}
<Reveal>
<div
className="relative overflow-hidden rounded-2xl border"
className="relative overflow-hidden rounded-3xl border"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
@@ -206,12 +207,12 @@ export default async function Home() {
className="absolute inset-0"
style={{
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 />
<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 }}
>
<div className="flex-1 text-center md:text-left">
@@ -232,7 +233,7 @@ export default async function Home() {
{th("online", { count: online, hotel: hotelName })}
</div>
<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={{
color: "var(--color-text-readable)",
fontFamily: "var(--font-nunito)",
@@ -241,7 +242,7 @@ export default async function Home() {
<TypewriterText text={tp("welcome", { hotelName })} />
</h1>
<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)" }}
>
{th("tagline")}
@@ -322,14 +323,12 @@ export default async function Home() {
].map((s) => (
<div
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={{
background:
"color-mix(in srgb, var(--color-surface) 70%, transparent)",
backdropFilter: "blur(8px)",
WebkitBackdropFilter: "blur(8px)",
borderColor:
"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
@@ -338,7 +337,7 @@ export default async function Home() {
/>
<div className="relative">
<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={{
background:
"color-mix(in srgb, var(--color-primary) 14%, transparent)",
@@ -353,7 +352,7 @@ export default async function Home() {
/>
</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)" }}
>
<AnimatedCounter value={s.value} />
@@ -374,52 +373,24 @@ export default async function Home() {
<div className="flex flex-col gap-4 md:flex-row">
{/* Left: Login & Register */}
<Reveal className="flex w-full flex-col gap-4 md:w-1/3 md:flex-shrink-0">
<div
className="overflow-hidden rounded-xl border"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
}}
<SectionCard
title={th("login")}
icon="/assets/images/icons/navigation/me.png"
bodyClassName="p-4"
>
<div
className="flex items-center gap-2.5 px-4 py-3"
style={{
background:
"linear-gradient(140deg, #1a3a5c 0%, #1e4a6e 20%, #2a5a80 40%, #3a6a90 60%, #4a7aa0 75%, #3a6a90 90%, #2a5a80 100%)",
<HomeLoginForm
captcha={{
provider: captcha.provider,
siteKey: captcha.siteKey || undefined,
field: captcha.field || undefined,
}}
>
<Image
src="/assets/images/icons/navigation/me.png"
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>
nonce={nonce}
/>
</SectionCard>
<Link href="/register" className="relative block group">
<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={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
@@ -435,7 +406,7 @@ export default async function Home() {
/>
</div>
<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={{
marginLeft: "18px",
fontFamily: "var(--font-nunito)",
@@ -447,50 +418,24 @@ export default async function Home() {
</Link>
{latestUsers.length > 0 && (
<div
className="overflow-hidden rounded-xl border"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
backgroundColor: "var(--color-surface)",
}}
<SectionCard
title={tp("latestUsers", { count: users.toLocaleString() })}
icon="/assets/images/icons/navigation/goody.png"
bodyClassName="p-4"
>
<div
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">
<div className="grid grid-cols-4 gap-2">
{latestUsers.map((u) => (
<div
key={u.username}
className="flex flex-col items-center gap-1"
>
<div className="relative overflow-visible">
<UserAvatarThumbnail
figure={u.look}
alt={u.username}
options={{ direction: 3 }}
/>
</div>
<UserAvatarThumbnail
figure={u.look}
alt={u.username}
options={{ direction: 3 }}
/>
<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)" }}
>
{u.username}
@@ -498,187 +443,118 @@ export default async function Home() {
</div>
))}
</div>
</div>
</SectionCard>
)}
</Reveal>
{/* Right: News */}
<Reveal delay={0.15} className="flex w-full flex-col gap-4 md:w-2/3">
<div
className="overflow-hidden rounded-xl border"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
backgroundColor: "var(--color-surface)",
}}
<SectionCard
title={tp("latestNews")}
icon="/assets/images/icons/article.gif"
actionHref="/news"
actionLabel={tp("allNews")}
>
<div
className="flex items-center justify-between px-4 py-3"
style={{
background:
"linear-gradient(140deg, #1a3a5c 0%, #1e4a6e 20%, #2a5a80 40%, #3a6a90 60%, #4a7aa0 75%, #3a6a90 90%, #2a5a80 100%)",
}}
>
<div className="flex items-center gap-2.5">
<Image
src="/assets/images/icons/article.gif"
alt=""
width={18}
height={18}
unoptimized
/>
<h2
className="text-sm font-bold text-white"
style={{ fontFamily: "var(--font-nunito)" }}
>
{tp("latestNews")}
</h2>
</div>
<Link
href="/news"
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>
{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-xl transition-all duration-300 hover:-translate-y-0.5 hover:shadow-lg"
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-xl">
<Image
src={a.image}
alt={a.title}
fill
sizes="(max-width: 768px) 100vw, 400px"
className="rounded-xl object-cover transition-all duration-300 group-hover:scale-105"
/>
<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">
<span className="text-sm font-bold text-white">→</span>
</div>
</Link>
))}
</div>
) : (
<p
className="py-8 text-center text-sm"
style={{ color: "var(--color-text-muted)" }}
>
{tp("noArticles")}
</p>
)}
</div>
</div>
<div
className="absolute bottom-0 left-0 w-full p-2.5"
style={{
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="mt-0.5 text-[11px] font-semibold opacity-80"
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>
</div>
{/* ── Online users ── */}
{recentUsers.length > 0 && (
<Reveal>
<div
className="overflow-hidden rounded-xl border"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
backgroundColor: "var(--color-surface)",
}}
<SectionCard
title={tp("recentUsers")}
icon="/assets/images/icons/navigation/goody.png"
actionHref="/community"
actionLabel={tp("allUsers")}
>
<div
className="flex items-center justify-between px-4 py-3"
style={{
background:
"linear-gradient(140deg, #0A1F0A 0%, #0F2D0F 20%, #153C15 40%, #1B4A1B 60%, #205820 75%, #1A4A1A 90%, #143814 100%)",
}}
>
<div className="flex items-center gap-2.5">
<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)" }}
<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 rounded-lg px-2 py-1.5 transition-all duration-200 hover:scale-110 hover:shadow-md"
style={{
background:
"color-mix(in srgb, var(--color-primary) 5%, transparent)",
}}
>
{tp("recentUsers")}
</h3>
</div>
<Link
href="/community"
className="text-xs font-bold text-white/80 hover:text-white hover:underline"
>
{tp("allUsers")}
</Link>
</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
figure={u.look}
alt={u.username}
options={{ direction: 2 }}
className="rounded-md"
/>
<span
className="max-w-[50px] truncate text-center text-[9px] font-bold leading-tight"
style={{ color: "var(--color-text-readable)" }}
>
<UserAvatarThumbnail
figure={u.look}
alt={u.username}
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>
{u.username}
</span>
</div>
))}
</div>
</div>
</SectionCard>
</Reveal>
)}
{/* ── Bottom CTA ── */}
<Reveal>
<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={{
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:
@@ -686,7 +562,7 @@ export default async function Home() {
}}
>
<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={{
color: "var(--color-text-readable)",
fontFamily: "var(--font-nunito)",
@@ -695,7 +571,7 @@ export default async function Home() {
{tp("joinNow", { hotelName })}
</h2>
<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)" }}
>
{tp("welcomeBody")}
@@ -725,60 +601,33 @@ export default async function Home() {
{/* ── Recent photos ── */}
{recentPhotos.length > 0 && (
<Reveal>
<div
className="overflow-hidden rounded-xl border"
style={{
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
backgroundColor: "var(--color-surface)",
}}
<SectionCard
title={tp("recentPhotos")}
icon="/assets/images/icons/camera.png"
>
<div
className="flex items-center gap-2.5 px-4 py-3"
style={{
background:
"linear-gradient(140deg, #5a2d82 0%, #6b3a9e 20%, #7d47b8 40%, #8f54d0 60%, #7d47b8 75%, #6b3a9e 90%, #5a2d82 100%)",
}}
>
<Image
src="/assets/images/icons/camera.png"
alt=""
width={18}
height={18}
unoptimized
/>
<h3
className="text-sm font-bold text-white"
style={{ fontFamily: "var(--font-nunito)" }}
>
{tp("recentPhotos")}
</h3>
<div className="mx-auto grid max-w-sm grid-cols-4 gap-2">
{recentPhotos.slice(0, 4).map((p) => (
<Link
key={p.id}
href="/photos"
className="block aspect-square overflow-hidden rounded-xl 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="h-full w-full object-cover transition-transform duration-300 hover:scale-105"
unoptimized
/>
</Link>
))}
</div>
<div className="p-4">
<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>
</SectionCard>
</Reveal>
)}
</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>
);
}