feat: redesign home and register pages with professional Habbo-style layout
This commit is contained in:
1 parent
b0ad3a128e
commit
fb0687ec71
2 files changed
+445
-41
No files matched your search
@@ -1,31 +1,131 @@
|
||||
export default function Register() {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gray-100 p-4">
|
||||
<div className="max-w-md w-full bg-white p-8 rounded-lg shadow-lg text-center">
|
||||
<h1 className="text-2xl font-bold mb-4">Konto erstellen</h1>
|
||||
<form className="space-y-4 mb-8">
|
||||
<div>
|
||||
<label className="block text-sm font-medium">Benutzername</label>
|
||||
<input type="text" name="username" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium">E‑Mail</label>
|
||||
<input type="email" name="email" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium">Passwoord</label>
|
||||
<input type="password" name="password" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
|
||||
</div>
|
||||
<div>
|
||||
<label className="block text-sm font-medium">Passwoord opnieuw</label>
|
||||
<input type="password" name="confirmPassword" className="mt-1 w-full px-3 py-2 border rounded focus:ring-blue-500" />
|
||||
</div>
|
||||
</form>
|
||||
<button type="submit" className="w-full bg-green-600 text-white py-2 rounded hover:bg-green-700">Konto erstellen</button>
|
||||
<p className="mt-4">
|
||||
<a href="/" className="text-blue-600 hover:underline">Al een account? Inloggen</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
import { headers } from "next/headers";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { RegisterForm } from "@/components/auth/register-form";
|
||||
import { cached } from "@/lib/cache";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { captchaConfig } from "@/lib/services/captcha";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
|
||||
export default async function RegisterPage() {
|
||||
const t = await getTranslations("header");
|
||||
const [hotelName, cfg] = await Promise.all([
|
||||
siteSettings.get("hotel_name", "Hotel"),
|
||||
captchaConfig(),
|
||||
]);
|
||||
const nonce = (await headers()).get("x-nonce") ?? undefined;
|
||||
|
||||
const online = await cached("online_count", 10_000, () =>
|
||||
prisma.user.count({ where: { online: "1" } }),
|
||||
).catch(() => 0);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col md:flex-row gap-8 items-start">
|
||||
{/* Left: Info / Welcome */}
|
||||
<div className="flex-1 w-full md:sticky md:top-24 space-y-6">
|
||||
<div
|
||||
className="relative overflow-hidden rounded-2xl border p-6"
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-primary) 25%, transparent)",
|
||||
background: `linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 15%, var(--color-surface)), color-mix(in srgb, var(--color-primary) 5%, var(--color-background)))`,
|
||||
}}
|
||||
>
|
||||
<div className="relative flex flex-col items-center text-center gap-4">
|
||||
<div className="relative w-36 h-40">
|
||||
<Image
|
||||
src="/assets/images/FrankwithBag.gif"
|
||||
alt="Frank"
|
||||
fill
|
||||
className="object-contain object-bottom drop-shadow-xl"
|
||||
unoptimized
|
||||
priority
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<h1 className="text-3xl font-extrabold m-0">
|
||||
Join{" "}
|
||||
<span
|
||||
style={{
|
||||
color:
|
||||
"var(--color-primary-readable, var(--color-primary))",
|
||||
}}
|
||||
>
|
||||
{hotelName}
|
||||
</span>
|
||||
</h1>
|
||||
<p
|
||||
className="mt-2 text-base max-w-md"
|
||||
style={{
|
||||
color:
|
||||
"var(--color-text-muted-readable, var(--color-text-muted))",
|
||||
}}
|
||||
>
|
||||
{t("tagline")}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
className="stat-grid w-full max-w-xs"
|
||||
style={{ gridTemplateColumns: "1fr 1fr" }}
|
||||
>
|
||||
<div className="stat-block" style={{ padding: "0.6rem" }}>
|
||||
<div className="stat-block-value">
|
||||
{online.toLocaleString()}
|
||||
</div>
|
||||
<div className="stat-block-label">Online</div>
|
||||
</div>
|
||||
<div className="stat-block" style={{ padding: "0.6rem" }}>
|
||||
<div className="stat-block-value">🎉</div>
|
||||
<div className="stat-block-label">Free to Play</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="card space-y-3" style={{ padding: "1.25rem" }}>
|
||||
{[
|
||||
{ icon: "🎨", text: "Customize your avatar with unique looks" },
|
||||
{ icon: "🏠", text: "Build and design your own rooms" },
|
||||
{ icon: "💬", text: "Chat and make new friends" },
|
||||
{ icon: "🎮", text: "Play games and compete" },
|
||||
].map((item) => (
|
||||
<div
|
||||
key={item.text}
|
||||
className="flex items-center gap-3 text-sm font-semibold"
|
||||
>
|
||||
<span className="text-xl">{item.icon}</span>
|
||||
<span style={{ color: "var(--color-text-readable)" }}>
|
||||
{item.text}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<p
|
||||
className="text-sm text-center"
|
||||
style={{
|
||||
color: "var(--color-text-muted-readable, var(--color-text-muted))",
|
||||
}}
|
||||
>
|
||||
Already have an account?{" "}
|
||||
<Link href="/login" className="font-bold hover:underline">
|
||||
Sign in here
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Right: Register Form */}
|
||||
<div className="w-full md:w-[500px] shrink-0">
|
||||
<RegisterForm
|
||||
hotelName={hotelName ?? "Hotel"}
|
||||
captcha={{
|
||||
provider: cfg.provider,
|
||||
siteKey: cfg.siteKey || undefined,
|
||||
}}
|
||||
nonce={nonce}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user