Improvements: remove dead config, fix ESM, add URL validation, unify types, add missing logging
- Remove .prettierrc (dead config, Biome replaces Prettier) - Rename lighthouserc.json to lighthouserc.cjs with module.exports for ESM compat - Add logger.warn to empty catch blocks in auth, register, site-settings, prisma-cache, redis, security, rate-limit - Unify ActionResult type: action-helper.ts uses 'ok' consistent with safe-action-shared.ts - Add noUnusedLocals + noUnusedParameters to tsconfig + fix 25 pre-existing unused vars - Replace barrel export src/types/index.ts with direct @/types/common imports - Make trustHost conditional (development only) in auth.ts - Add pre-flight URL validation to update-Nitrov3.sh to catch image.library.url misconfigurations - Improve NITRO_IMAGE_LIBRARY_URL content validation in pre-flight & post-compute checks
This commit is contained in:
1 parent
b922f6d49f
commit
17847545dd
292 files changed
+69195
-67915
No files matched your search
+405
-127
@@ -1,24 +1,24 @@
|
||||
import { headers } from "next/headers";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { redirect } from "next/navigation";
|
||||
import { headers } from "next/headers";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
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 { LanguageSwitcher } from "@/components/language-switcher";
|
||||
import { Reveal } from "@/components/motion-reveal";
|
||||
import { ThemeSwitcher } from "@/components/theme-switcher";
|
||||
import { TypewriterText } from "@/components/typewriter-text";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { cached } from "@/lib/cache";
|
||||
import { avatarImageUrl } from "@/lib/format";
|
||||
import { formatDate } from "@/lib/format-date";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { resolveHotelName } from "@/lib/hotel-name";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { captchaConfig } from "@/lib/services/captcha";
|
||||
import { auth } from "@/lib/auth";
|
||||
import { ThemeSwitcher } from "@/components/theme-switcher";
|
||||
import { LanguageSwitcher } from "@/components/language-switcher";
|
||||
import { HomeLoginForm } from "@/components/auth/home-login-form";
|
||||
import { Reveal } from "@/components/motion-reveal";
|
||||
import { Clock } from "@/components/clock";
|
||||
import { TypewriterText } from "@/components/typewriter-text";
|
||||
import { AnimatedCounter } from "@/components/animated-counter";
|
||||
import { AmbientOrbs } from "@/components/ambient-orbs";
|
||||
import { siteSettings } from "@/lib/services/site-settings";
|
||||
|
||||
export const revalidate = 120;
|
||||
|
||||
@@ -33,38 +33,54 @@ async function getHotelData() {
|
||||
]);
|
||||
const imager = imagerRaw ?? "https://www.habbo.com/habbo-imaging/avatarimage";
|
||||
|
||||
const [online, users, rooms, articles, recentUsers, recentPhotos, latestUsers] =
|
||||
await Promise.all([
|
||||
cached("online_count", 10_000, () =>
|
||||
prisma.user.count({ where: { online: "1" } }),
|
||||
).catch(() => 0),
|
||||
cached("total_users", 30_000, () => prisma.user.count()).catch(() => 0),
|
||||
cached("total_rooms", 30_000, () => prisma.rooms.count()).catch(() => 0),
|
||||
prisma.websiteArticles
|
||||
.findMany({ orderBy: { createdAt: "desc" }, take: 5 })
|
||||
.catch(() => []),
|
||||
prisma.user
|
||||
.findMany({
|
||||
where: { online: "1" },
|
||||
select: { username: true, look: true },
|
||||
take: 30,
|
||||
})
|
||||
.catch(() => []),
|
||||
prisma.cameraWeb
|
||||
.findMany({ orderBy: { timestamp: "desc" }, take: 4 })
|
||||
.catch(() => []),
|
||||
prisma.user
|
||||
.findMany({
|
||||
orderBy: { accountCreated: "desc" },
|
||||
select: { username: true, look: true },
|
||||
take: 8,
|
||||
})
|
||||
.catch(() => []),
|
||||
]);
|
||||
const [
|
||||
online,
|
||||
users,
|
||||
rooms,
|
||||
articles,
|
||||
recentUsers,
|
||||
recentPhotos,
|
||||
latestUsers,
|
||||
] = await Promise.all([
|
||||
cached("online_count", 10_000, () =>
|
||||
prisma.user.count({ where: { online: "1" } }),
|
||||
).catch(() => 0),
|
||||
cached("total_users", 30_000, () => prisma.user.count()).catch(() => 0),
|
||||
cached("total_rooms", 30_000, () => prisma.rooms.count()).catch(() => 0),
|
||||
prisma.websiteArticles
|
||||
.findMany({ orderBy: { createdAt: "desc" }, take: 5 })
|
||||
.catch(() => []),
|
||||
prisma.user
|
||||
.findMany({
|
||||
where: { online: "1" },
|
||||
select: { username: true, look: true },
|
||||
take: 30,
|
||||
})
|
||||
.catch(() => []),
|
||||
prisma.cameraWeb
|
||||
.findMany({ orderBy: { timestamp: "desc" }, take: 4 })
|
||||
.catch(() => []),
|
||||
prisma.user
|
||||
.findMany({
|
||||
orderBy: { accountCreated: "desc" },
|
||||
select: { username: true, look: true },
|
||||
take: 8,
|
||||
})
|
||||
.catch(() => []),
|
||||
]);
|
||||
|
||||
const discordUrl = await siteSettings.get("radio_social_discord", "");
|
||||
|
||||
return { hotelName, imager, online, users, rooms, articles, recentUsers, recentPhotos, latestUsers, discordUrl, logo };
|
||||
return {
|
||||
hotelName,
|
||||
imager,
|
||||
online,
|
||||
users,
|
||||
rooms,
|
||||
articles,
|
||||
recentUsers,
|
||||
recentPhotos,
|
||||
latestUsers,
|
||||
logo,
|
||||
};
|
||||
}
|
||||
|
||||
export default async function Home() {
|
||||
@@ -73,40 +89,88 @@ export default async function Home() {
|
||||
|
||||
const tp = await getTranslations("pages.home");
|
||||
const th = await getTranslations("header");
|
||||
const { hotelName, imager, online, users, rooms, articles, recentUsers, recentPhotos, latestUsers, discordUrl, logo } = await getHotelData();
|
||||
const {
|
||||
hotelName,
|
||||
imager,
|
||||
online,
|
||||
users,
|
||||
rooms,
|
||||
articles,
|
||||
recentUsers,
|
||||
recentPhotos,
|
||||
latestUsers,
|
||||
logo,
|
||||
} = await getHotelData();
|
||||
|
||||
const captcha = await captchaConfig();
|
||||
const nonce = (await headers()).get("x-nonce") ?? undefined;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-10 pb-14">
|
||||
|
||||
{/* ── Top Bar ── */}
|
||||
<Reveal>
|
||||
<div className="relative flex items-center justify-between rounded-xl border px-5 py-3" style={{
|
||||
background: "color-mix(in srgb, var(--color-surface) 60%, transparent)",
|
||||
backdropFilter: "blur(14px)",
|
||||
WebkitBackdropFilter: "blur(14px)",
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||
}}>
|
||||
<div
|
||||
className="relative flex items-center justify-between rounded-xl border px-5 py-3"
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-surface) 60%, transparent)",
|
||||
backdropFilter: "blur(14px)",
|
||||
WebkitBackdropFilter: "blur(14px)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
{logo ? (
|
||||
<Image src={logo} alt={hotelName} width={100} height={28} className="shrink-0 object-contain" unoptimized style={{ maxHeight: 28, width: "auto", height: "auto" }} />
|
||||
<Image
|
||||
src={logo}
|
||||
alt={hotelName}
|
||||
width={100}
|
||||
height={28}
|
||||
className="shrink-0 object-contain"
|
||||
unoptimized
|
||||
style={{ maxHeight: 28, width: "auto", height: "auto" }}
|
||||
/>
|
||||
) : (
|
||||
<Image src="/assets/images/icons/lighthouse.png" alt={hotelName} width={28} height={28} className="shrink-0" unoptimized />
|
||||
<Image
|
||||
src="/assets/images/icons/lighthouse.png"
|
||||
alt={hotelName}
|
||||
width={28}
|
||||
height={28}
|
||||
className="shrink-0"
|
||||
unoptimized
|
||||
/>
|
||||
)}
|
||||
<span className="text-sm font-extrabold uppercase tracking-wide" style={{ color: "var(--color-text-readable)" }}>
|
||||
<span
|
||||
className="text-sm font-extrabold uppercase tracking-wide"
|
||||
style={{ color: "var(--color-text-readable)" }}
|
||||
>
|
||||
{hotelName}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-1.5 rounded-lg px-2 py-1" style={{
|
||||
background: "color-mix(in srgb, var(--color-text-muted) 4%, transparent)",
|
||||
}}>
|
||||
|
||||
<div
|
||||
className="flex items-center gap-1.5 rounded-lg px-2 py-1"
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-text-muted) 4%, transparent)",
|
||||
}}
|
||||
>
|
||||
<LanguageSwitcher />
|
||||
<div className="w-px h-5" style={{ background: "color-mix(in srgb, var(--color-text-muted) 12%, transparent)" }} />
|
||||
<div
|
||||
className="w-px h-5"
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
/>
|
||||
<Clock />
|
||||
<div className="w-px h-5" style={{ background: "color-mix(in srgb, var(--color-text-muted) 12%, transparent)" }} />
|
||||
<div
|
||||
className="w-px h-5"
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
/>
|
||||
<ThemeSwitcher />
|
||||
</div>
|
||||
</div>
|
||||
@@ -119,23 +183,30 @@ export default async function Home() {
|
||||
style={{
|
||||
background: `url(/assets/images/next_header.jpg) center/cover no-repeat`,
|
||||
backgroundPosition: "center 20%",
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
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%)",
|
||||
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%)",
|
||||
}}
|
||||
/>
|
||||
<AmbientOrbs />
|
||||
<div className="relative flex flex-col md:flex-row items-center gap-8 px-6 py-10 md:px-10 md:py-14" style={{ zIndex: 2 }}>
|
||||
<div
|
||||
className="relative flex flex-col md:flex-row items-center gap-8 px-6 py-10 md:px-10 md:py-14"
|
||||
style={{ zIndex: 2 }}
|
||||
>
|
||||
<div className="flex-1 text-center md:text-left">
|
||||
<div
|
||||
className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full text-xs font-bold uppercase tracking-widest mb-5 border backdrop-blur-sm"
|
||||
style={{
|
||||
background: "color-mix(in srgb, var(--color-primary) 12%, transparent)",
|
||||
borderColor: "color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-primary) 12%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
||||
color: "var(--color-primary-readable, var(--color-primary))",
|
||||
}}
|
||||
>
|
||||
@@ -147,7 +218,10 @@ export default async function Home() {
|
||||
</div>
|
||||
<h1
|
||||
className="text-4xl md:text-5xl lg:text-6xl font-black leading-[1.05] tracking-tight mb-3"
|
||||
style={{ color: "var(--color-text-readable)", fontFamily: "var(--font-nunito)" }}
|
||||
style={{
|
||||
color: "var(--color-text-readable)",
|
||||
fontFamily: "var(--font-nunito)",
|
||||
}}
|
||||
>
|
||||
<TypewriterText text={tp("welcome", { hotelName })} />
|
||||
</h1>
|
||||
@@ -164,19 +238,28 @@ export default async function Home() {
|
||||
style={{
|
||||
background: "var(--color-primary)",
|
||||
color: "var(--color-primary-foreground)",
|
||||
boxShadow: "0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
||||
boxShadow:
|
||||
"0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image src="/assets/images/EnterHubbly.png" alt="" width={20} height={20} unoptimized />
|
||||
<Image
|
||||
src="/assets/images/EnterHubbly.png"
|
||||
alt=""
|
||||
width={20}
|
||||
height={20}
|
||||
unoptimized
|
||||
/>
|
||||
{tp("register")}
|
||||
</Link>
|
||||
<Link
|
||||
href="/login"
|
||||
className="inline-flex items-center gap-2 font-bold text-sm px-7 py-3.5 rounded-xl border-2 transition-all duration-200 hover:scale-[1.03] active:scale-95 backdrop-blur-sm"
|
||||
style={{
|
||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 20%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 20%, transparent)",
|
||||
color: "var(--color-text-readable)",
|
||||
background: "color-mix(in srgb, var(--color-surface) 50%, transparent)",
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-surface) 50%, transparent)",
|
||||
}}
|
||||
>
|
||||
{th("login")}
|
||||
@@ -206,18 +289,32 @@ export default async function Home() {
|
||||
<Reveal>
|
||||
<div className="grid grid-cols-3 gap-4 stagger-children">
|
||||
{[
|
||||
{ value: online, label: tp("statsOnline"), icon: "/assets/images/icons/online-friends.png" },
|
||||
{ value: users, label: tp("statsCitizens"), icon: "/assets/images/icons/friends.png" },
|
||||
{ value: rooms, label: tp("statsRooms"), icon: "/assets/images/icons/catalog.png" },
|
||||
{
|
||||
value: online,
|
||||
label: tp("statsOnline"),
|
||||
icon: "/assets/images/icons/online-friends.png",
|
||||
},
|
||||
{
|
||||
value: users,
|
||||
label: tp("statsCitizens"),
|
||||
icon: "/assets/images/icons/friends.png",
|
||||
},
|
||||
{
|
||||
value: rooms,
|
||||
label: tp("statsRooms"),
|
||||
icon: "/assets/images/icons/catalog.png",
|
||||
},
|
||||
].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"
|
||||
style={{
|
||||
background: "color-mix(in srgb, var(--color-surface) 70%, transparent)",
|
||||
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)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 8%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
@@ -227,14 +324,29 @@ 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"
|
||||
style={{ background: "color-mix(in srgb, var(--color-primary) 14%, transparent)" }}
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-primary) 14%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image src={s.icon} alt="" width={24} height={24} unoptimized />
|
||||
<Image
|
||||
src={s.icon}
|
||||
alt=""
|
||||
width={24}
|
||||
height={24}
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<div className="text-3xl md:text-4xl font-black tracking-tight mb-0.5" style={{ color: "var(--color-primary)" }}>
|
||||
<div
|
||||
className="text-3xl md:text-4xl font-black tracking-tight mb-0.5"
|
||||
style={{ color: "var(--color-primary)" }}
|
||||
>
|
||||
<AnimatedCounter value={s.value} />
|
||||
</div>
|
||||
<div className="text-xs font-bold uppercase tracking-widest" style={{ color: "var(--color-text-muted)" }}>
|
||||
<div
|
||||
className="text-xs font-bold uppercase tracking-widest"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{s.label}
|
||||
</div>
|
||||
</div>
|
||||
@@ -245,59 +357,122 @@ export default async function Home() {
|
||||
|
||||
{/* ── Login + News ── */}
|
||||
<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)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
>
|
||||
<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%)",
|
||||
background:
|
||||
"linear-gradient(140deg, #1a3a5c 0%, #1e4a6e 20%, #2a5a80 40%, #3a6a90 60%, #4a7aa0 75%, #3a6a90 90%, #2a5a80 100%)",
|
||||
}}
|
||||
>
|
||||
<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)" }}>
|
||||
<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
|
||||
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>
|
||||
|
||||
<Link href="/register" className="relative block group">
|
||||
<div className="overflow-hidden rounded-xl border transition-all duration-200 group-hover:shadow-lg" style={{ borderColor: "color-mix(in srgb, var(--color-text-muted) 12%, transparent)" }}>
|
||||
<Image src="/assets/images/EnterHubbly.png" alt="Register" width={300} height={100} className="block w-full" unoptimized />
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border transition-all duration-200 group-hover:shadow-lg"
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
src="/assets/images/EnterHubbly.png"
|
||||
alt="Register"
|
||||
width={300}
|
||||
height={100}
|
||||
className="block w-full"
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<span className="pointer-events-none absolute inset-0 flex items-center text-2xl md:text-3xl font-extrabold text-white" style={{ marginLeft: "18px", fontFamily: "var(--font-nunito)", textShadow: "0 2px 8px rgba(0,0,0,0.6)" }}>
|
||||
<span
|
||||
className="pointer-events-none absolute inset-0 flex items-center text-2xl md:text-3xl font-extrabold text-white"
|
||||
style={{
|
||||
marginLeft: "18px",
|
||||
fontFamily: "var(--font-nunito)",
|
||||
textShadow: "0 2px 8px rgba(0,0,0,0.6)",
|
||||
}}
|
||||
>
|
||||
{tp("register")}
|
||||
</span>
|
||||
</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)" }}>
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border"
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
backgroundColor: "var(--color-surface)",
|
||||
}}
|
||||
>
|
||||
<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%)",
|
||||
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)" }}>
|
||||
<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">
|
||||
{latestUsers.map((u) => (
|
||||
<div key={u.username} className="flex flex-col items-center gap-1">
|
||||
<div
|
||||
key={u.username}
|
||||
className="flex flex-col items-center gap-1"
|
||||
>
|
||||
<div className="relative overflow-visible">
|
||||
<Image
|
||||
src={avatarImageUrl(imager, u.look, { headOnly: true, direction: 3 })}
|
||||
src={avatarImageUrl(imager, u.look, {
|
||||
headOnly: true,
|
||||
direction: 3,
|
||||
})}
|
||||
alt={u.username}
|
||||
width={64}
|
||||
height={78}
|
||||
@@ -305,7 +480,10 @@ export default async function Home() {
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<span className="text-[11px] font-bold truncate max-w-[64px] text-center leading-tight" style={{ color: "var(--color-text-readable)" }}>
|
||||
<span
|
||||
className="text-[11px] font-bold truncate max-w-[64px] text-center leading-tight"
|
||||
style={{ color: "var(--color-text-readable)" }}
|
||||
>
|
||||
{u.username}
|
||||
</span>
|
||||
</div>
|
||||
@@ -317,20 +495,40 @@ export default async function Home() {
|
||||
|
||||
{/* 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)" }}>
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border"
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
backgroundColor: "var(--color-surface)",
|
||||
}}
|
||||
>
|
||||
<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%)",
|
||||
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)" }}>
|
||||
<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">
|
||||
<Link
|
||||
href="/news"
|
||||
className="text-xs font-bold text-white/80 hover:text-white hover:underline"
|
||||
>
|
||||
{tp("allNews")}
|
||||
</Link>
|
||||
</div>
|
||||
@@ -345,7 +543,8 @@ export default async function Home() {
|
||||
style={{
|
||||
height: "200px",
|
||||
backgroundColor: "var(--color-background)",
|
||||
border: "1px solid color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
||||
border:
|
||||
"1px solid color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
||||
}}
|
||||
>
|
||||
<div className="relative h-full w-full overflow-hidden rounded-lg">
|
||||
@@ -356,22 +555,26 @@ export default async function Home() {
|
||||
className="rounded-lg object-cover transition-all duration-300 group-hover:scale-105"
|
||||
unoptimized
|
||||
/>
|
||||
<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 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%)",
|
||||
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)" }}>
|
||||
<p
|
||||
className="text-[11px] font-semibold mt-0.5 opacity-80"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{formatDate(a.createdAt, "date", "")}
|
||||
</p>
|
||||
</div>
|
||||
@@ -380,7 +583,10 @@ export default async function Home() {
|
||||
))}
|
||||
</div>
|
||||
) : (
|
||||
<p className="py-8 text-center text-sm" style={{ color: "var(--color-text-muted)" }}>
|
||||
<p
|
||||
className="py-8 text-center text-sm"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{tp("noArticles")}
|
||||
</p>
|
||||
)}
|
||||
@@ -392,20 +598,40 @@ export default async function Home() {
|
||||
{/* ── 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)" }}>
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border"
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
backgroundColor: "var(--color-surface)",
|
||||
}}
|
||||
>
|
||||
<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%)",
|
||||
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)" }}>
|
||||
<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)" }}
|
||||
>
|
||||
{tp("recentUsers")}
|
||||
</h3>
|
||||
</div>
|
||||
<Link href="/community" className="text-xs font-bold text-white/80 hover:text-white hover:underline">
|
||||
<Link
|
||||
href="/community"
|
||||
className="text-xs font-bold text-white/80 hover:text-white hover:underline"
|
||||
>
|
||||
{tp("allUsers")}
|
||||
</Link>
|
||||
</div>
|
||||
@@ -415,17 +641,27 @@ export default async function Home() {
|
||||
<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)" }}
|
||||
style={{
|
||||
background:
|
||||
"color-mix(in srgb, var(--color-primary) 5%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
src={avatarImageUrl(imager, u.look, { headOnly: true, direction: 2, size: "s" })}
|
||||
src={avatarImageUrl(imager, u.look, {
|
||||
headOnly: true,
|
||||
direction: 2,
|
||||
size: "s",
|
||||
})}
|
||||
alt={u.username}
|
||||
width={30}
|
||||
height={36}
|
||||
className="rounded-md"
|
||||
unoptimized
|
||||
/>
|
||||
<span className="text-[9px] font-bold truncate max-w-[50px] text-center leading-tight" style={{ color: "var(--color-text-readable)" }}>
|
||||
<span
|
||||
className="text-[9px] font-bold truncate max-w-[50px] text-center leading-tight"
|
||||
style={{ color: "var(--color-text-readable)" }}
|
||||
>
|
||||
{u.username}
|
||||
</span>
|
||||
</div>
|
||||
@@ -442,13 +678,23 @@ export default async function Home() {
|
||||
className="relative overflow-hidden rounded-xl border text-center px-6 py-10"
|
||||
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: "color-mix(in srgb, var(--color-primary) 15%, transparent)",
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-primary) 15%, transparent)",
|
||||
}}
|
||||
>
|
||||
<h2 className="text-2xl md:text-3xl font-black tracking-tight mb-2" style={{ color: "var(--color-text-readable)", fontFamily: "var(--font-nunito)" }}>
|
||||
<h2
|
||||
className="text-2xl md:text-3xl font-black tracking-tight mb-2"
|
||||
style={{
|
||||
color: "var(--color-text-readable)",
|
||||
fontFamily: "var(--font-nunito)",
|
||||
}}
|
||||
>
|
||||
{tp("joinNow", { hotelName })}
|
||||
</h2>
|
||||
<p className="text-sm mb-6 max-w-sm mx-auto" style={{ color: "var(--color-text-muted)" }}>
|
||||
<p
|
||||
className="text-sm mb-6 max-w-sm mx-auto"
|
||||
style={{ color: "var(--color-text-muted)" }}
|
||||
>
|
||||
{tp("welcomeBody")}
|
||||
</p>
|
||||
<Link
|
||||
@@ -457,10 +703,17 @@ export default async function Home() {
|
||||
style={{
|
||||
background: "var(--color-primary)",
|
||||
color: "var(--color-primary-foreground)",
|
||||
boxShadow: "0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
||||
boxShadow:
|
||||
"0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
||||
}}
|
||||
>
|
||||
<Image src="/assets/images/EnterHubbly.png" alt="" width={20} height={20} unoptimized />
|
||||
<Image
|
||||
src="/assets/images/EnterHubbly.png"
|
||||
alt=""
|
||||
width={20}
|
||||
height={20}
|
||||
unoptimized
|
||||
/>
|
||||
{tp("register")}
|
||||
</Link>
|
||||
</div>
|
||||
@@ -469,22 +722,47 @@ 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)" }}>
|
||||
<div
|
||||
className="overflow-hidden rounded-xl border"
|
||||
style={{
|
||||
borderColor:
|
||||
"color-mix(in srgb, var(--color-text-muted) 12%, transparent)",
|
||||
backgroundColor: "var(--color-surface)",
|
||||
}}
|
||||
>
|
||||
<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%)",
|
||||
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)" }}>
|
||||
<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>
|
||||
<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)" }}>
|
||||
<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=""
|
||||
|
||||
Reference in new issue
Block a user