feat: incorporate design elements from habbo.nl, hubbly.pw, leet.ws
This commit is contained in:
1 parent
5fe01532ca
commit
8fa59d9d19
2 files changed
+627
-622
No files matched your search
+478
-485
File diff suppressed because it is too large.
Load diff
+149
-137
@@ -4,175 +4,187 @@ import Link from "next/link";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
import { RegisterForm } from "@/components/auth/register-form";
|
||||
import { cached } from "@/lib/cache";
|
||||
import { avatarImageUrl } from "@/lib/format";
|
||||
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([
|
||||
const [hotelName, imagerRaw, cfg] = await Promise.all([
|
||||
siteSettings.get("hotel_name", "Hotel"),
|
||||
siteSettings.get(
|
||||
"habbo_imaging_url",
|
||||
"https://www.habbo.com/habbo-imaging/avatarimage",
|
||||
),
|
||||
captchaConfig(),
|
||||
]);
|
||||
const imager = imagerRaw ?? "https://www.habbo.com/habbo-imaging/avatarimage";
|
||||
const nonce = (await headers()).get("x-nonce") ?? undefined;
|
||||
|
||||
const online = await cached("online_count", 10_000, () =>
|
||||
prisma.user.count({ where: { online: "1" } }),
|
||||
).catch(() => 0);
|
||||
const [online, recentUsers] = await Promise.all([
|
||||
cached("online_count", 10_000, () =>
|
||||
prisma.user.count({ where: { online: "1" } }),
|
||||
).catch(() => 0),
|
||||
prisma.user
|
||||
.findMany({
|
||||
where: { online: "1" },
|
||||
select: { username: true, look: true },
|
||||
take: 8,
|
||||
})
|
||||
.catch(() => []),
|
||||
]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col lg:flex-row gap-0 lg:gap-8 min-h-[600px]">
|
||||
{/* ── Left: Reception desk ── */}
|
||||
<div className="relative lg:w-96 shrink-0 overflow-hidden rounded-none lg:rounded-[2rem] p-1 self-start lg:self-stretch">
|
||||
<div className="flex flex-col lg:flex-row gap-8">
|
||||
{/* ── Left panel: Frank + avatars ── */}
|
||||
<div className="lg:w-80 shrink-0 space-y-4">
|
||||
<div
|
||||
className="absolute inset-0 rounded-none lg:rounded-[2rem]"
|
||||
className="rounded-2xl border p-6 text-center"
|
||||
style={{
|
||||
background: `linear-gradient(135deg, var(--color-primary), color-mix(in srgb, var(--color-primary) 60%, var(--color-accent)))`,
|
||||
}}
|
||||
/>
|
||||
<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%)`,
|
||||
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="absolute inset-0 opacity-[0.06]"
|
||||
style={{
|
||||
backgroundImage:
|
||||
"radial-gradient(circle at 50% 30%, var(--color-primary) 0%, transparent 60%)",
|
||||
}}
|
||||
<Image
|
||||
src="/assets/images/FrankwithBag.gif"
|
||||
alt="Frank"
|
||||
width={140}
|
||||
height={180}
|
||||
className="object-contain mx-auto drop-shadow-xl"
|
||||
unoptimized
|
||||
priority
|
||||
/>
|
||||
<div className="relative flex flex-col items-center gap-5">
|
||||
<div className="relative w-40 h-44">
|
||||
<Image
|
||||
src="/assets/images/FrankwithBag.gif"
|
||||
alt="Frank"
|
||||
fill
|
||||
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"
|
||||
<h1
|
||||
className="text-xl font-black mt-3"
|
||||
style={{ color: "var(--color-text-readable)" }}
|
||||
>
|
||||
Join{" "}
|
||||
<span
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-primary) 8%, transparent)",
|
||||
color: "var(--color-primary-readable, var(--color-primary))",
|
||||
}}
|
||||
>
|
||||
{[
|
||||
{ icon: "🎨", text: "Unique avatar" },
|
||||
{ icon: "🏠", text: "Your own room" },
|
||||
{ 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}
|
||||
/>
|
||||
|
||||
{hotelName}
|
||||
</span>
|
||||
</h1>
|
||||
<p
|
||||
className="text-sm text-center mt-6"
|
||||
className="text-xs mt-1 max-w-[200px] mx-auto leading-relaxed"
|
||||
style={{
|
||||
color:
|
||||
"var(--color-text-muted-readable, var(--color-text-muted))",
|
||||
}}
|
||||
>
|
||||
Already checked in?{" "}
|
||||
<Link
|
||||
href="/login"
|
||||
className="font-extrabold hover:underline"
|
||||
{t("tagline")}
|
||||
</p>
|
||||
<div
|
||||
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={{
|
||||
color: "var(--color-primary-readable, var(--color-primary))",
|
||||
color:
|
||||
"var(--color-text-muted-readable, var(--color-text-muted))",
|
||||
}}
|
||||
>
|
||||
Sign in here
|
||||
</Link>
|
||||
Who's online
|
||||
</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>
|
||||
</div>
|
||||
<RegisterForm
|
||||
hotelName={hotelName ?? "Hotel"}
|
||||
captcha={{
|
||||
provider: cfg.provider,
|
||||
siteKey: cfg.siteKey || undefined,
|
||||
}}
|
||||
nonce={nonce}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user