feat: incorporate design elements from habbo.nl, hubbly.pw, leet.ws
Deploy / release (push) Skipped
Deploy / deploy (push) Successful in 1m47s

This commit is contained in:
openhands committed 2026-07-22 14:12:55 +02:00
1 parent 5fe01532ca
commit 8fa59d9d19
2 files changed
+627 -622

No files matched your search

+478 -485
View File
File diff suppressed because it is too large. Load diff
+149 -137
View File
@@ -4,175 +4,187 @@ import Link from "next/link";
import { getTranslations } from "next-intl/server"; import { getTranslations } from "next-intl/server";
import { RegisterForm } from "@/components/auth/register-form"; import { RegisterForm } from "@/components/auth/register-form";
import { cached } from "@/lib/cache"; import { cached } from "@/lib/cache";
import { avatarImageUrl } from "@/lib/format";
import { prisma } from "@/lib/prisma"; import { prisma } from "@/lib/prisma";
import { captchaConfig } from "@/lib/services/captcha"; import { captchaConfig } from "@/lib/services/captcha";
import { siteSettings } from "@/lib/services/site-settings"; import { siteSettings } from "@/lib/services/site-settings";
export default async function RegisterPage() { export default async function RegisterPage() {
const t = await getTranslations("header"); const t = await getTranslations("header");
const [hotelName, cfg] = await Promise.all([ const [hotelName, imagerRaw, cfg] = await Promise.all([
siteSettings.get("hotel_name", "Hotel"), siteSettings.get("hotel_name", "Hotel"),
siteSettings.get(
"habbo_imaging_url",
"https://www.habbo.com/habbo-imaging/avatarimage",
),
captchaConfig(), captchaConfig(),
]); ]);
const imager = imagerRaw ?? "https://www.habbo.com/habbo-imaging/avatarimage";
const nonce = (await headers()).get("x-nonce") ?? undefined; const nonce = (await headers()).get("x-nonce") ?? undefined;
const online = await cached("online_count", 10_000, () => const [online, recentUsers] = await Promise.all([
prisma.user.count({ where: { online: "1" } }), cached("online_count", 10_000, () =>
).catch(() => 0); prisma.user.count({ where: { online: "1" } }),
).catch(() => 0),
prisma.user
.findMany({
where: { online: "1" },
select: { username: true, look: true },
take: 8,
})
.catch(() => []),
]);
return ( return (
<div className="flex flex-col lg:flex-row gap-0 lg:gap-8 min-h-[600px]"> <div className="flex flex-col lg:flex-row gap-8">
{/* ── Left: Reception desk ── */} {/* ── Left panel: Frank + avatars ── */}
<div className="relative lg:w-96 shrink-0 overflow-hidden rounded-none lg:rounded-[2rem] p-1 self-start lg:self-stretch"> <div className="lg:w-80 shrink-0 space-y-4">
<div <div
className="absolute inset-0 rounded-none lg:rounded-[2rem]" className="rounded-2xl border p-6 text-center"
style={{ style={{
background: `linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 60%, var(--color-accent)))`, borderColor:
}} "color-mix(in srgb, var(--color-primary) 25%, transparent)",
/> background: `linear-gradient(160deg, color-mix(in srgb, var(--color-primary) 16%, var(--color-surface)) 0%, color-mix(in srgb, var(--color-primary) 5%, var(--color-background)) 100%)`,
<div
className="relative h-full rounded-none lg:rounded-[1.9rem] flex flex-col items-center text-center px-6 py-10 lg:py-14"
style={{
background: `linear-gradient(160deg, color-mix(in srgb, var(--color-primary) 22%, var(--color-surface)) 0%, color-mix(in srgb, var(--color-primary) 8%, var(--color-background)) 100%)`,
}} }}
> >
<div <Image
className="absolute inset-0 opacity-[0.06]" src="/assets/images/FrankwithBag.gif"
style={{ alt="Frank"
backgroundImage: width={140}
"radial-gradient(circle at 50% 30%, var(--color-primary) 0%, transparent 60%)", height={180}
}} className="object-contain mx-auto drop-shadow-xl"
unoptimized
priority
/> />
<div className="relative flex flex-col items-center gap-5"> <h1
<div className="relative w-40 h-44"> className="text-xl font-black mt-3"
<Image style={{ color: "var(--color-text-readable)" }}
src="/assets/images/FrankwithBag.gif" >
alt="Frank" Join{" "}
fill <span
className="object-contain object-bottom drop-shadow-2xl"
unoptimized
priority
/>
</div>
<div>
<div
className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-wider mb-4"
style={{
background:
"color-mix(in srgb, var(--color-primary) 18%, transparent)",
color: "var(--color-primary-readable, var(--color-primary))",
}}
>
<span
className="w-2 h-2 rounded-full animate-pulse"
style={{ background: "var(--color-success)" }}
/>
{online.toLocaleString()} here now
</div>
<h1
className="text-2xl md:text-3xl font-black tracking-tight"
style={{ color: "var(--color-text-readable)" }}
>
Welcome to{" "}
<span
style={{
color:
"var(--color-primary-readable, var(--color-primary))",
}}
>
{hotelName}
</span>
</h1>
<p
className="text-sm mt-2 max-w-xs mx-auto leading-relaxed"
style={{
color:
"var(--color-text-muted-readable, var(--color-text-muted))",
}}
>
{t("tagline")}
</p>
</div>
<div
className="w-full max-w-[220px] space-y-2.5 py-4 mt-2 rounded-2xl border"
style={{ style={{
borderColor: color: "var(--color-primary-readable, var(--color-primary))",
"color-mix(in srgb, var(--color-primary) 20%, transparent)",
background:
"color-mix(in srgb, var(--color-primary) 8%, transparent)",
}} }}
> >
{[ {hotelName}
{ icon: "🎨", text: "Unique avatar" }, </span>
{ icon: "🏠", text: "Your own room" }, </h1>
{ icon: "💬", text: "Meet new people" },
].map((item) => (
<div
key={item.text}
className="flex items-center gap-2.5 px-4 text-sm font-bold"
style={{ color: "var(--color-text-readable)" }}
>
<span>{item.icon}</span>
<span>{item.text}</span>
</div>
))}
</div>
</div>
</div>
</div>
{/* ── Right: Check-in desk (registration form) ── */}
<div className="flex-1 flex flex-col justify-center pt-8 lg:pt-0">
<div className="max-w-[520px] mx-auto w-full">
<div className="mb-6 text-center lg:text-left">
<h2
className="text-2xl font-black tracking-tight"
style={{ color: "var(--color-text-readable)" }}
>
Create your account
</h2>
<p
className="text-sm mt-1"
style={{
color:
"var(--color-text-muted-readable, var(--color-text-muted))",
}}
>
It takes less than a minute. No email required.
</p>
</div>
<RegisterForm
hotelName={hotelName ?? "Hotel"}
captcha={{
provider: cfg.provider,
siteKey: cfg.siteKey || undefined,
}}
nonce={nonce}
/>
<p <p
className="text-sm text-center mt-6" className="text-xs mt-1 max-w-[200px] mx-auto leading-relaxed"
style={{ style={{
color: color:
"var(--color-text-muted-readable, var(--color-text-muted))", "var(--color-text-muted-readable, var(--color-text-muted))",
}} }}
> >
Already checked in?{" "} {t("tagline")}
<Link </p>
href="/login" <div
className="font-extrabold hover:underline" className="inline-flex items-center gap-1.5 mt-3 text-xs font-bold"
style={{ color: "var(--color-success)" }}
>
<span
className="w-2 h-2 rounded-full animate-pulse"
style={{ background: "var(--color-success)" }}
/>
{online.toLocaleString()} online now
</div>
</div>
{recentUsers.length > 0 && (
<div
className="rounded-xl border p-4"
style={{
background:
"color-mix(in srgb, var(--color-background) 50%, var(--color-surface))",
borderColor:
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
}}
>
<h3
className="text-xs font-extrabold uppercase tracking-wider mb-2.5"
style={{ style={{
color: "var(--color-primary-readable, var(--color-primary))", color:
"var(--color-text-muted-readable, var(--color-text-muted))",
}} }}
> >
Sign in here Who's online
</Link> </h3>
<div className="grid grid-cols-4 gap-1.5">
{recentUsers.map((u) => (
<div
key={u.username}
className="flex flex-col items-center gap-0.5"
>
<Image
src={avatarImageUrl(imager, u.look, {
headOnly: true,
direction: 2,
size: "s",
})}
alt=""
width={30}
height={36}
className="rounded-md"
unoptimized
/>
<span
className="text-[9px] font-bold truncate w-full text-center leading-tight"
style={{ color: "var(--color-text-readable)" }}
>
{u.username}
</span>
</div>
))}
</div>
</div>
)}
<p
className="text-xs text-center"
style={{
color: "var(--color-text-muted-readable, var(--color-text-muted))",
}}
>
Already have an account?{" "}
<Link
href="/login"
className="font-extrabold hover:underline"
style={{
color: "var(--color-primary-readable, var(--color-primary))",
}}
>
Sign in
</Link>
</p>
</div>
{/* ── Right: Registration form ── */}
<div className="flex-1">
<div className="mb-5">
<h2
className="text-xl font-black tracking-tight"
style={{ color: "var(--color-text-readable)" }}
>
Create your account
</h2>
<p
className="text-sm mt-0.5"
style={{
color:
"var(--color-text-muted-readable, var(--color-text-muted))",
}}
>
Free and takes less than a minute
</p> </p>
</div> </div>
<RegisterForm
hotelName={hotelName ?? "Hotel"}
captcha={{
provider: cfg.provider,
siteKey: cfg.siteKey || undefined,
}}
nonce={nonce}
/>
</div> </div>
</div> </div>
); );