diff --git a/src/app/(site)/layout.tsx b/src/app/(site)/layout.tsx index 6eee060e..4bef187a 100644 --- a/src/app/(site)/layout.tsx +++ b/src/app/(site)/layout.tsx @@ -4,24 +4,35 @@ import RadioPlayerGate from "@/components/public/radio-player-gate"; import { SiteFooter } from "@/components/site-footer"; import { SiteHeader } from "@/components/site-header"; import { TopHeader } from "@/components/top-header"; +import { auth } from "@/lib/auth"; /** * Public site chrome. Route group `(site)` keeps this off `/admin` and `/client`, * so housekeeping is never constrained by the public max-w-7xl grid. + * + * When the user is not authenticated, the header/nav chrome is hidden so that + * the login page acts as a full-screen landing page (magic-hotel style). */ -export default function SiteLayout({ children }: { children: ReactNode }) { +export default async function SiteLayout({ children }: { children: ReactNode }) { + const session = await auth(); + const authenticated = !!session?.user; + return ( <> - - - + {authenticated && ( + <> + + + + + )}
-
-
{children}
+
+
{children}
- - + {authenticated && } + {authenticated && } ); } diff --git a/src/components/auth/home-login-form.tsx b/src/components/auth/home-login-form.tsx index 6aa2c405..818e4514 100644 --- a/src/components/auth/home-login-form.tsx +++ b/src/components/auth/home-login-form.tsx @@ -1,6 +1,6 @@ "use client"; -import { LogIn, UserPlus } from "lucide-react"; +import { LogIn, UserPlus, ArrowRight, User, Lock } from "lucide-react"; import Link from "next/link"; import { signIn } from "next-auth/react"; import { type FormEvent, useState } from "react"; @@ -49,100 +49,94 @@ export function HomeLoginForm() { } return ( -
+ {error && ( -
+

{error}

)} -
+
+ +
+
+ +
+ setUsername(e.target.value)} + placeholder="Username" + className="w-full pl-10 pr-3 px-4 py-3 bg-white/5 border border-white/10 rounded-md focus:outline-none focus:border-[#5AB4C6]/50 focus:bg-[#5AB4C6]/5 text-sm text-white placeholder-gray-500 transition-all font-medium" + required + disabled={needs2fa} + /> +
+
+ +
+ +
+
+ +
+ setPassword(e.target.value)} + placeholder="Password" + className="w-full pl-10 pr-3 px-4 py-3 bg-white/5 border border-white/10 rounded-md focus:outline-none focus:border-[#5AB4C6]/50 focus:bg-[#5AB4C6]/5 text-sm text-white placeholder-gray-500 transition-all font-medium" + required + disabled={needs2fa} + /> +
+
+ + {needs2fa && (
- - - - +
setUsername(e.target.value)} - placeholder="Username" - className="w-full pl-10 pr-4 py-3 bg-white/5 border border-white/10 rounded-lg focus:outline-none focus:border-[#5AB4C6]/50 focus:bg-[#5AB4C6]/5 text-sm text-white placeholder-gray-500 transition-all font-medium" - required - disabled={needs2fa} + value={code} + onChange={(e) => setCode(e.target.value)} + placeholder="Enter your 2FA code" + inputMode="numeric" + autoFocus + className="w-full pl-10 pr-3 px-4 py-3 bg-white/5 border border-white/10 rounded-md focus:outline-none focus:border-[#5AB4C6]/50 focus:bg-[#5AB4C6]/5 text-sm text-white placeholder-gray-500 transition-all font-medium" />
-
- -
-
- - - - -
- setPassword(e.target.value)} - placeholder="Password" - className="w-full pl-10 pr-4 py-3 bg-white/5 border border-white/10 rounded-lg focus:outline-none focus:border-[#5AB4C6]/50 focus:bg-[#5AB4C6]/5 text-sm text-white placeholder-gray-500 transition-all font-medium" - required - disabled={needs2fa} - /> -
-
- {needs2fa && ( -
- -
-
- - - - -
- setCode(e.target.value)} - placeholder="Enter your 2FA code" - inputMode="numeric" - autoFocus - className="w-full pl-10 pr-4 py-3 bg-white/5 border border-white/10 rounded-lg focus:outline-none focus:border-[#5AB4C6]/50 focus:bg-[#5AB4C6]/5 text-sm text-white placeholder-gray-500 transition-all font-medium" - /> -
-
- )} -
+ )} -
+
-
+
- Create account + No account yet? Register now
diff --git a/src/components/home/guest-view.tsx b/src/components/home/guest-view.tsx index 6d281425..6930a709 100644 --- a/src/components/home/guest-view.tsx +++ b/src/components/home/guest-view.tsx @@ -1,4 +1,4 @@ -import { ArrowRight, Newspaper, Users } from "lucide-react"; +import { ArrowRight, Newspaper, Users, User } from "lucide-react"; import Image from "next/image"; import Link from "next/link"; import { getTranslations } from "next-intl/server"; @@ -10,6 +10,12 @@ import { siteSettings } from "@/lib/services/site-settings"; export default async function GuestView() { const t = await getTranslations("pages.home"); const hotelName = await siteSettings.get("hotel_name", "Atom"); + const header = await siteSettings.get("cms_header", "/assets/images/banner.png"); + const logo = await siteSettings.get("cms_logo", ""); + const bannerUrl = header && header !== "/assets/images/background.png" + ? header + : "/assets/images/banner.png"; + const imager = (await siteSettings.get( "habbo_imaging_url", @@ -39,109 +45,73 @@ export default async function GuestView() { }); } catch {} + let onlineCount = 0; + try { + onlineCount = await prisma.user.count({ where: { online: "1" } }); + } catch {} + return ( -
- {/* Hero Section */} -
-
-
-
-
- {/* Left: Welcome */} -
-
- - - - - - Online - -
+
+ {/* Logo + Online Count */} +
+ {logo ? ( + {hotelName + ) : ( +

+ {hotelName} +

+ )} +
+
+ + {onlineCount} Online + +
+
-

- Welcome to{" "} - {hotelName} -

-

- Connect with friends, explore the hotel, and create unforgettable - memories. Your adventure starts here. -

- -
- -
- Get Started -
- - -
- Latest News -
- -
- - {/* Stats */} -
-
-

- {articles.length} -

-

- Articles -

-
-
-

- {recentUsers.length}+ -

-

- Active Users -

-
-
+ {/* Main Card: 900x500 split layout */} +
+ {/* Left: Login Form */} +
+
+

+ Sign In +

+
+ +
- {/* Right: Login Form */} -
-
-
-
- - - - -
- - Sign In - + {/* Right: Hotel Image with Overlay */} +
+ {hotelName +
+
+
+
+
+
-
{/* Articles + Sidebar */} -
+
{/* Latest News */}
@@ -172,7 +142,7 @@ export default async function GuestView() {
@@ -201,9 +171,9 @@ export default async function GuestView() { -
+
{a.title} {/* Recent Users */} {recentUsers.length > 0 && ( -
+
@@ -252,7 +222,7 @@ export default async function GuestView() { href={`/u/${u.username}`} className="group relative flex items-center justify-center transition-all duration-200 hover:scale-110" > -
+
-
+
@@ -309,7 +279,7 @@ export default async function GuestView() {

Create your free account and start your adventure!

-
+
Register Now