beautify /me page with decorative cards, hover effects, and consistent styling
This commit is contained in:
1 parent
0cbd4ca858
commit
54c155bcef
1 file changed
+177
-400
+177
-400
@@ -226,7 +226,6 @@ export default async function MePage({
|
|||||||
|
|
||||||
content = (
|
content = (
|
||||||
<div className="flex flex-col gap-8 pb-8">
|
<div className="flex flex-col gap-8 pb-8">
|
||||||
{/* Feedback banners */}
|
|
||||||
{claimed ? (
|
{claimed ? (
|
||||||
<div role="status" style={feedbackStyle("success")}>
|
<div role="status" style={feedbackStyle("success")}>
|
||||||
Woah! You have successfully claimed your reward — keep up the good work!
|
Woah! You have successfully claimed your reward — keep up the good work!
|
||||||
@@ -238,353 +237,199 @@ export default async function MePage({
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{/* ── Profile header ── */}
|
|
||||||
<Reveal>
|
<Reveal>
|
||||||
<div
|
<div
|
||||||
className="rounded-2xl border p-6 flex items-start gap-6"
|
className="relative overflow-hidden rounded-2xl border p-6 flex items-start gap-6"
|
||||||
style={{
|
style={{
|
||||||
background: `linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 10%, var(--color-surface)), var(--color-surface))`,
|
background: `linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 12%, var(--color-surface)), var(--color-surface))`,
|
||||||
borderColor: "color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
borderColor: "color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className="relative shrink-0 flex flex-col items-center gap-3">
|
<div className="absolute -top-10 -right-10 w-40 h-40 rounded-full opacity-10" style={{ background: "var(--color-primary)" }} />
|
||||||
<div
|
<div className="relative shrink-0 flex flex-col items-center gap-3">
|
||||||
className="absolute -inset-3 rounded-full opacity-[0.15] blur-[40px]"
|
<div className="absolute -inset-3 rounded-full opacity-[0.15] blur-[40px]" style={{ background: "var(--color-primary)" }} />
|
||||||
style={{ background: "var(--color-primary)" }}
|
<Image src={avatarFull} alt="" width={120} height={160} className="object-contain drop-shadow-xl relative" unoptimized priority />
|
||||||
/>
|
<Link
|
||||||
<Image
|
href="/client"
|
||||||
src={avatarFull}
|
className="btn-shine flex items-center justify-center gap-1.5 rounded-xl border py-2 px-4 font-extrabold text-xs transition-all duration-200 hover:scale-[1.02] active:scale-95 shadow-lg"
|
||||||
alt={`${user.username} avatar`}
|
style={{
|
||||||
width={120}
|
background: "var(--color-primary)",
|
||||||
height={160}
|
color: "var(--color-primary-foreground)",
|
||||||
className="object-contain drop-shadow-xl relative"
|
borderColor: "color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
||||||
unoptimized
|
boxShadow: "0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
||||||
priority
|
}}
|
||||||
/>
|
>
|
||||||
<Link
|
<Image src="/assets/images/EnterHubbly.png" alt="" width={16} height={16} unoptimized />
|
||||||
href="/client"
|
Enter {hotelName}
|
||||||
className="btn-shine flex items-center justify-center gap-1.5 rounded-xl border py-2 px-4 font-extrabold text-xs transition-all duration-200 hover:scale-[1.02] active:scale-95 shadow-lg"
|
</Link>
|
||||||
style={{
|
</div>
|
||||||
background: "var(--color-primary)",
|
<div className="flex-1 min-w-0 pt-1">
|
||||||
color: "var(--color-primary-foreground)",
|
<div
|
||||||
borderColor: "color-mix(in srgb, var(--color-primary) 20%, transparent)",
|
className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-[11px] font-bold uppercase tracking-wider mb-3 border"
|
||||||
boxShadow: "0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
style={{
|
||||||
}}
|
borderColor: "color-mix(in srgb, var(--color-primary) 18%, transparent)",
|
||||||
>
|
background: "color-mix(in srgb, var(--color-primary) 10%, transparent)",
|
||||||
<Image
|
color: "var(--color-primary-readable, var(--color-primary))",
|
||||||
src="/assets/images/EnterHubbly.png"
|
}}
|
||||||
alt=""
|
>
|
||||||
width={16}
|
Rank {user.rank}
|
||||||
height={16}
|
</div>
|
||||||
unoptimized
|
<h1 className="text-2xl md:text-3xl font-black tracking-tight" style={{ color: "var(--color-text-readable)" }}>
|
||||||
/>
|
{user.username}
|
||||||
Enter {hotelName}
|
</h1>
|
||||||
</Link>
|
<p className="text-sm mt-1" style={{ color: "var(--color-text-muted)" }}>
|
||||||
</div>
|
{user.motto || "No motto"}
|
||||||
<div className="flex-1 text-left">
|
</p>
|
||||||
<div
|
<div className="flex flex-wrap gap-x-6 gap-y-1 mt-4 text-xs">
|
||||||
className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-bold uppercase tracking-wider mb-3 border"
|
<span style={{ color: "var(--color-text-muted)" }}>
|
||||||
style={{
|
Registered: <strong style={{ color: "var(--color-text-readable)" }}>{registered}</strong>
|
||||||
borderColor: "color-mix(in srgb, var(--color-primary) 18%, transparent)",
|
</span>
|
||||||
background: "color-mix(in srgb, var(--color-primary) 10%, transparent)",
|
<span style={{ color: "var(--color-text-muted)" }}>
|
||||||
color: "var(--color-primary-readable, var(--color-primary))",
|
Last online: <strong style={{ color: "var(--color-text-readable)" }}>{lastOnlineDate}</strong>
|
||||||
}}
|
</span>
|
||||||
>
|
</div>
|
||||||
Rank {user.rank}
|
|
||||||
</div>
|
</div>
|
||||||
<h1
|
|
||||||
className="text-2xl md:text-3xl font-black tracking-tight"
|
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
>
|
|
||||||
{user.username}
|
|
||||||
</h1>
|
|
||||||
<p className="text-sm mt-1" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
{user.motto || "No motto"}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Reveal>
|
</Reveal>
|
||||||
|
|
||||||
{/* ── Hotel alert banner ── */}
|
|
||||||
{alertRaw ? (
|
{alertRaw ? (
|
||||||
<Reveal delay={0.05}>
|
<Reveal delay={0.05}>
|
||||||
<div
|
<div className="rounded-2xl border px-6 py-4 text-center" style={{ background: "color-mix(in srgb, var(--color-accent) 12%, transparent)", borderColor: "color-mix(in srgb, var(--color-accent) 25%, transparent)" }}>
|
||||||
className="rounded-2xl border px-6 py-4 text-center"
|
<p className="text-sm font-bold" style={{ color: "var(--color-accent)" }}>{alertRaw}</p>
|
||||||
style={{
|
|
||||||
background: "color-mix(in srgb, var(--color-accent) 12%, transparent)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-accent) 25%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<p className="text-sm font-bold" style={{ color: "var(--color-accent)" }}>
|
|
||||||
{alertRaw}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{/* ── Stat tiles ── */}
|
|
||||||
<Reveal delay={0.1}>
|
<Reveal delay={0.1}>
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-3 gap-4 stagger-children">
|
<div className="grid grid-cols-2 sm:grid-cols-3 gap-4">
|
||||||
{[
|
{[
|
||||||
{ value: user.credits.toLocaleString(), label: "Credits" },
|
{ value: user.credits.toLocaleString(), label: "Credits" },
|
||||||
{ value: `Rank ${user.rank}`, label: "Hotel rank" },
|
{ value: `Rank ${user.rank}`, label: "Hotel rank" },
|
||||||
{ value: (userSettings?.achievementScore ?? 0).toLocaleString(), label: "Achievement score" },
|
{ value: (userSettings?.achievementScore ?? 0).toLocaleString(), label: "Achievement score" },
|
||||||
{ value: (userSettings?.respectsReceived ?? 0).toLocaleString(), label: "Respects received" },
|
{ value: (userSettings?.respectsReceived ?? 0).toLocaleString(), label: "Respects" },
|
||||||
{ value: friendCount.toLocaleString(), label: "Friends" },
|
{ value: friendCount.toLocaleString(), label: "Friends" },
|
||||||
{ value: lastLoginDate, label: "Last login" },
|
{ value: lastLoginDate, label: "Last login" },
|
||||||
].map((s) => (
|
].map((s) => (
|
||||||
<div
|
|
||||||
key={s.label}
|
|
||||||
className="rounded-2xl border p-5 text-center transition-all duration-200 hover:-translate-y-0.5"
|
|
||||||
style={{
|
|
||||||
background: "var(--color-surface)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
className="text-xl md:text-2xl font-black tracking-tight mb-0.5"
|
key={s.label}
|
||||||
style={{ color: "var(--color-primary)" }}
|
className="relative rounded-2xl border p-5 text-center transition-all duration-200 hover:-translate-y-0.5 hover:shadow-lg"
|
||||||
|
style={{
|
||||||
|
background: "var(--color-surface)",
|
||||||
|
borderColor: "color-mix(in srgb, var(--color-primary) 12%, transparent)",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{s.value}
|
<div className="text-xl md:text-2xl font-black tracking-tight mb-0.5" style={{ color: "var(--color-primary)" }}>
|
||||||
|
{s.value}
|
||||||
|
</div>
|
||||||
|
<div className="text-[11px] font-bold uppercase tracking-widest" style={{ color: "var(--color-text-muted)" }}>
|
||||||
|
{s.label}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
))}
|
||||||
className="text-xs font-bold uppercase tracking-widest"
|
</div>
|
||||||
style={{ color: "var(--color-text-muted)" }}
|
|
||||||
>
|
|
||||||
{s.label}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</Reveal>
|
</Reveal>
|
||||||
|
|
||||||
{/* ── Online friends ── */}
|
|
||||||
<Reveal delay={0.15}>
|
<Reveal delay={0.15}>
|
||||||
<div
|
<div className="rounded-2xl border p-5" style={{ background: "var(--color-surface)", borderColor: "color-mix(in srgb, var(--color-primary) 12%, transparent)" }}>
|
||||||
className="rounded-2xl border p-5"
|
<div className="flex items-center justify-between mb-4">
|
||||||
style={{
|
<div>
|
||||||
background: "var(--color-surface)",
|
<h2 className="text-lg font-black tracking-tight" style={{ color: "var(--color-text-readable)" }}>Online friends</h2>
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
||||||
}}
|
{onlineFriends.length === 0 ? "None of your friends are online right now" : `${onlineFriends.length} of your ${friends.length} friends online`}
|
||||||
>
|
</p>
|
||||||
<div className="flex items-center justify-between mb-4">
|
</div>
|
||||||
<div>
|
<Link href="/friends" className="text-xs font-bold hover:underline shrink-0" style={{ color: "var(--color-primary)" }}>View all</Link>
|
||||||
<h2
|
|
||||||
className="text-lg font-black tracking-tight"
|
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
>
|
|
||||||
Online friends
|
|
||||||
</h2>
|
|
||||||
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
{onlineFriends.length === 0
|
|
||||||
? "None of your friends are online right now"
|
|
||||||
: `${onlineFriends.length} of your ${friends.length} friends online`}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<Link
|
{onlineFriends.length === 0 ? (
|
||||||
href="/friends"
|
<div className="text-center py-6">
|
||||||
className="text-xs font-bold hover:underline shrink-0"
|
<p className="text-sm" style={{ color: "var(--color-text-muted)" }}>No friends online right now. Check back later!</p>
|
||||||
style={{ color: "var(--color-primary)" }}
|
</div>
|
||||||
>
|
) : (
|
||||||
View all
|
<div className="grid grid-cols-2 sm:grid-cols-3 gap-3">
|
||||||
</Link>
|
{onlineFriends.map((friend) => (
|
||||||
</div>
|
|
||||||
{onlineFriends.length === 0 ? (
|
|
||||||
<div className="text-center py-6">
|
|
||||||
<p className="text-sm" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
No friends online right now. Check back later!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-3 gap-3">
|
|
||||||
{onlineFriends.map((friend) => {
|
|
||||||
const avatar = avatarImageUrl(imager, friend.look, {
|
|
||||||
size: "s",
|
|
||||||
headOnly: true,
|
|
||||||
});
|
|
||||||
return (
|
|
||||||
<Link
|
<Link
|
||||||
key={friend.id}
|
key={friend.id}
|
||||||
href={`/u/${friend.username}`}
|
href={`/u/${friend.username}`}
|
||||||
className="flex items-center gap-3 p-3 rounded-xl transition-all duration-200 hover:-translate-y-0.5"
|
className="flex items-center gap-3 p-3 rounded-xl transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md"
|
||||||
style={{
|
style={{ background: "color-mix(in srgb, var(--color-primary) 4%, transparent)", textDecoration: "none" }}
|
||||||
background: "color-mix(in srgb, var(--color-primary) 4%, transparent)",
|
|
||||||
textDecoration: "none",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Image
|
<Image src={avatarImageUrl(imager, friend.look, { size: "s", headOnly: true })} alt="" width={40} height={50} className="rounded-lg shrink-0" unoptimized />
|
||||||
src={avatar}
|
|
||||||
alt={`${friend.username} avatar`}
|
|
||||||
width={40}
|
|
||||||
height={50}
|
|
||||||
className="rounded-lg shrink-0"
|
|
||||||
unoptimized
|
|
||||||
/>
|
|
||||||
<div className="min-w-0">
|
<div className="min-w-0">
|
||||||
<p
|
<p className="text-sm font-extrabold truncate" style={{ color: "var(--color-text-readable)" }}>{friend.username}</p>
|
||||||
className="text-sm font-extrabold truncate"
|
<p className="text-[10px] font-semibold truncate mt-0.5" style={{ color: "var(--color-text-muted)" }}>{friend.motto || "No motto"}</p>
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
<span className="inline-flex items-center gap-1 text-[10px] font-bold mt-1" style={{ color: "var(--color-success)" }}>
|
||||||
>
|
<span className="w-1.5 h-1.5 rounded-full" style={{ background: "var(--color-success)" }} /> Online
|
||||||
{friend.username}
|
|
||||||
</p>
|
|
||||||
<p
|
|
||||||
className="text-[10px] font-semibold truncate mt-0.5"
|
|
||||||
style={{ color: "var(--color-text-muted)" }}
|
|
||||||
>
|
|
||||||
{friend.motto || "No motto"}
|
|
||||||
</p>
|
|
||||||
<span
|
|
||||||
className="inline-flex items-center gap-1 text-[10px] font-bold mt-1"
|
|
||||||
style={{ color: "var(--color-success)" }}
|
|
||||||
>
|
|
||||||
<span className="w-1.5 h-1.5 rounded-full" style={{ background: "var(--color-success)" }} />
|
|
||||||
Online
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
);
|
))}
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</Reveal>
|
|
||||||
|
|
||||||
{/* ── Referral card ── */}
|
|
||||||
<Reveal delay={0.2}>
|
|
||||||
<div
|
|
||||||
className="rounded-2xl border p-5"
|
|
||||||
style={{
|
|
||||||
background: "var(--color-surface)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="mb-4">
|
|
||||||
<h2
|
|
||||||
className="text-lg font-black tracking-tight"
|
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
>
|
|
||||||
Refer a friend ({referralTotal}/{needed})
|
|
||||||
</h2>
|
|
||||||
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
Refer new users and earn in-game rewards
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col gap-4">
|
|
||||||
<p className="text-sm" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
{rewardAmount > 0
|
|
||||||
? `For every ${needed} users who register through your referral link you can claim a reward of ${rewardAmount.toLocaleString()} ${rewardCurrency}!`
|
|
||||||
: `Invite ${needed} users through your referral link to claim a reward!`}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div role="note" style={feedbackStyle("warning")}>
|
|
||||||
⚠️ Boosting referrals by making your own accounts will lead to removal of all progress, currency, inventory and a potential ban.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label
|
|
||||||
htmlFor="referral-link"
|
|
||||||
className="text-xs font-bold mb-1.5 block"
|
|
||||||
style={{ color: "var(--color-text-muted)" }}
|
|
||||||
>
|
|
||||||
Your referral link
|
|
||||||
</label>
|
|
||||||
<div className="flex gap-2 flex-wrap">
|
|
||||||
<input
|
|
||||||
id="referral-link"
|
|
||||||
type="text"
|
|
||||||
readOnly
|
|
||||||
defaultValue={referralLink}
|
|
||||||
className="input-glow flex-1 min-w-0 rounded-xl border-2 px-4 py-2.5 text-sm font-medium"
|
|
||||||
style={{
|
|
||||||
backgroundColor: "var(--color-background)",
|
|
||||||
color: "var(--color-text-readable, var(--color-text))",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 25%, transparent)",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<CopyReferralButton value={referralLink} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{canClaim ? (
|
|
||||||
<form action={claimReferral}>
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
className="btn-shine w-full rounded-xl font-extrabold text-sm py-3.5 transition-all duration-200 hover:scale-[1.02] active:scale-95 shadow-lg"
|
|
||||||
style={{
|
|
||||||
background: "var(--color-primary)",
|
|
||||||
color: "var(--color-primary-foreground)",
|
|
||||||
boxShadow: "0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Claim your referral reward!
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
) : (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
disabled
|
|
||||||
className="w-full rounded-xl font-extrabold text-sm py-3.5 opacity-60 cursor-not-allowed"
|
|
||||||
style={{
|
|
||||||
background: "color-mix(in srgb, var(--color-text-muted) 15%, transparent)",
|
|
||||||
color: "var(--color-text-muted)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{`Refer ${remaining} more ${remaining === 1 ? "user" : "users"} to unlock your reward`}
|
|
||||||
</button>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</Reveal>
|
</Reveal>
|
||||||
{/* ── Recent rooms ── */}
|
|
||||||
|
<Reveal delay={0.2}>
|
||||||
|
<div className="rounded-2xl border p-5" style={{ background: "var(--color-surface)", borderColor: "color-mix(in srgb, var(--color-primary) 12%, transparent)" }}>
|
||||||
|
<div className="mb-4">
|
||||||
|
<h2 className="text-lg font-black tracking-tight" style={{ color: "var(--color-text-readable)" }}>Refer a friend ({referralTotal}/{needed})</h2>
|
||||||
|
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>Refer new users and earn in-game rewards</p>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-col gap-4">
|
||||||
|
<p className="text-sm" style={{ color: "var(--color-text-muted)" }}>
|
||||||
|
{rewardAmount > 0
|
||||||
|
? `For every ${needed} users who register through your referral link you can claim a reward of ${rewardAmount.toLocaleString()} ${rewardCurrency}!`
|
||||||
|
: `Invite ${needed} users through your referral link to claim a reward!`}
|
||||||
|
</p>
|
||||||
|
<div role="note" style={feedbackStyle("warning")}>
|
||||||
|
Boosting referrals by making your own accounts will lead to removal of all progress, currency, inventory and a potential ban.
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label htmlFor="referral-link" className="text-xs font-bold mb-1.5 block" style={{ color: "var(--color-text-muted)" }}>Your referral link</label>
|
||||||
|
<div className="flex gap-2 flex-wrap">
|
||||||
|
<input id="referral-link" type="text" readOnly defaultValue={referralLink}
|
||||||
|
className="input-glow flex-1 min-w-0 rounded-xl border-2 px-4 py-2.5 text-sm font-medium"
|
||||||
|
style={{ backgroundColor: "var(--color-background)", color: "var(--color-text-readable, var(--color-text))", borderColor: "color-mix(in srgb, var(--color-text-muted) 25%, transparent)" }}
|
||||||
|
/>
|
||||||
|
<CopyReferralButton value={referralLink} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{canClaim ? (
|
||||||
|
<form action={claimReferral}>
|
||||||
|
<button type="submit" className="btn-shine w-full rounded-xl font-extrabold text-sm py-3.5 transition-all duration-200 hover:scale-[1.02] active:scale-95 shadow-lg"
|
||||||
|
style={{ background: "var(--color-primary)", color: "var(--color-primary-foreground)", boxShadow: "0 4px 24px color-mix(in srgb, var(--color-primary) 35%, transparent)" }}
|
||||||
|
>
|
||||||
|
Claim your referral reward!
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
) : (
|
||||||
|
<button type="button" disabled className="w-full rounded-xl font-extrabold text-sm py-3.5 opacity-60 cursor-not-allowed"
|
||||||
|
style={{ background: "color-mix(in srgb, var(--color-text-muted) 15%, transparent)", color: "var(--color-text-muted)" }}
|
||||||
|
>
|
||||||
|
{`Refer ${remaining} more ${remaining === 1 ? "user" : "users"} to unlock your reward`}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Reveal>
|
||||||
|
|
||||||
{recentRooms.length > 0 && (
|
{recentRooms.length > 0 && (
|
||||||
<Reveal delay={0.25}>
|
<Reveal delay={0.25}>
|
||||||
<div
|
<div className="rounded-2xl border p-5" style={{ background: "var(--color-surface)", borderColor: "color-mix(in srgb, var(--color-primary) 12%, transparent)" }}>
|
||||||
className="rounded-2xl border p-5"
|
|
||||||
style={{
|
|
||||||
background: "var(--color-surface)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="flex items-center justify-between mb-4">
|
<div className="flex items-center justify-between mb-4">
|
||||||
<div>
|
<div>
|
||||||
<h2
|
<h2 className="text-lg font-black tracking-tight" style={{ color: "var(--color-text-readable)" }}>Recent rooms</h2>
|
||||||
className="text-lg font-black tracking-tight"
|
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>Newest rooms in the hotel</p>
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
>
|
|
||||||
Recent rooms
|
|
||||||
</h2>
|
|
||||||
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
Newest rooms in the hotel
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<Link
|
<Link href="/community" className="text-xs font-bold hover:underline shrink-0" style={{ color: "var(--color-primary)" }}>View all</Link>
|
||||||
href="/community"
|
|
||||||
className="text-xs font-bold hover:underline shrink-0"
|
|
||||||
style={{ color: "var(--color-primary)" }}
|
|
||||||
>
|
|
||||||
View all
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-3 gap-3">
|
<div className="grid grid-cols-2 sm:grid-cols-3 gap-3">
|
||||||
{recentRooms.map((room) => (
|
{recentRooms.map((room) => (
|
||||||
<Link
|
<Link key={room.id} href={`/room/${room.id}`}
|
||||||
key={room.id}
|
className="block rounded-xl border p-3 transition-all duration-200 hover:-translate-y-0.5 hover:shadow-md"
|
||||||
href={`/room/${room.id}`}
|
style={{ background: "color-mix(in srgb, var(--color-primary) 4%, transparent)", borderColor: "color-mix(in srgb, var(--color-primary) 10%, transparent)" }}
|
||||||
className="block rounded-xl border p-3 transition-all duration-200 hover:-translate-y-0.5"
|
|
||||||
style={{
|
|
||||||
background: "color-mix(in srgb, var(--color-primary) 4%, transparent)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<p
|
<p className="text-sm font-extrabold truncate" style={{ color: "var(--color-text-readable)" }}>{room.name}</p>
|
||||||
className="text-sm font-extrabold truncate"
|
<p className="text-[10px] font-semibold mt-0.5" style={{ color: "var(--color-text-muted)" }}>{room.ownerName} · {room.users}/{room.usersMax}</p>
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
>
|
|
||||||
{room.name}
|
|
||||||
</p>
|
|
||||||
<p className="text-[10px] font-semibold mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
{room.ownerName} · {room.users}/{room.usersMax}
|
|
||||||
</p>
|
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
@@ -594,35 +439,14 @@ export default async function MePage({
|
|||||||
|
|
||||||
{badges.length > 0 && (
|
{badges.length > 0 && (
|
||||||
<Reveal delay={0.3}>
|
<Reveal delay={0.3}>
|
||||||
<div
|
<div className="rounded-2xl border p-5" style={{ background: "var(--color-surface)", borderColor: "color-mix(in srgb, var(--color-primary) 12%, transparent)" }}>
|
||||||
className="rounded-2xl border p-5"
|
|
||||||
style={{
|
|
||||||
background: "var(--color-surface)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<h2
|
<h2 className="text-lg font-black tracking-tight" style={{ color: "var(--color-text-readable)" }}>Badges</h2>
|
||||||
className="text-lg font-black tracking-tight"
|
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>{badges.length} badge{badges.length !== 1 ? "s" : ""} equipped</p>
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
>
|
|
||||||
Badges
|
|
||||||
</h2>
|
|
||||||
<p className="text-xs mt-0.5" style={{ color: "var(--color-text-muted)" }}>
|
|
||||||
{badges.length} badge{badges.length !== 1 ? "s" : ""} equipped
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap gap-2">
|
||||||
{badges.map((badge) => (
|
{badges.map((badge) => (
|
||||||
<Image
|
<Image key={badge.badgeCode} src={`${BADGE_IMG_BASE}/${badge.badgeCode}.gif`} alt={badge.badgeCode} width={40} height={40} className="rounded-md transition-transform hover:scale-110" unoptimized />
|
||||||
key={badge.badgeCode}
|
|
||||||
src={`${BADGE_IMG_BASE}/${badge.badgeCode}.gif`}
|
|
||||||
alt={badge.badgeCode}
|
|
||||||
width={40}
|
|
||||||
height={40}
|
|
||||||
className="rounded-md"
|
|
||||||
unoptimized
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -630,74 +454,27 @@ export default async function MePage({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Reveal delay={0.35}>
|
<Reveal delay={0.35}>
|
||||||
<div
|
<div className="rounded-2xl border p-5" style={{ background: "var(--color-surface)", borderColor: "color-mix(in srgb, var(--color-primary) 12%, transparent)" }}>
|
||||||
className="rounded-2xl border p-5"
|
<h2 className="text-lg font-black tracking-tight mb-4" style={{ color: "var(--color-text-readable)" }}>Quick links</h2>
|
||||||
style={{
|
|
||||||
background: "var(--color-surface)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-text-muted) 10%, transparent)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div className="mb-4">
|
|
||||||
<h2
|
|
||||||
className="text-lg font-black tracking-tight"
|
|
||||||
style={{ color: "var(--color-text-readable)" }}
|
|
||||||
>
|
|
||||||
Quick links
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
<div className="grid grid-cols-2 sm:grid-cols-4 gap-3">
|
||||||
<Link
|
{[
|
||||||
href="/messages"
|
{ href: "/messages", label: "Messages", badge: unreadCount },
|
||||||
className="relative flex items-center justify-center gap-2 rounded-xl border p-3 text-sm font-bold transition-all hover:-translate-y-0.5"
|
{ href: `/u/${user.username}`, label: "My profile", badge: 0 },
|
||||||
style={{
|
{ href: "/settings", label: "Settings", badge: 0 },
|
||||||
background: "color-mix(in srgb, var(--color-primary) 6%, transparent)",
|
{ href: "/shop", label: "Shop", badge: 0 },
|
||||||
borderColor: "color-mix(in srgb, var(--color-primary) 18%, transparent)",
|
].map((link) => (
|
||||||
color: "var(--color-text-readable)",
|
<Link key={link.href} href={link.href}
|
||||||
}}
|
className="relative flex items-center justify-center rounded-xl border p-3 text-sm font-bold transition-all hover:-translate-y-0.5 hover:shadow-md"
|
||||||
>
|
style={{ background: "color-mix(in srgb, var(--color-primary) 6%, transparent)", borderColor: "color-mix(in srgb, var(--color-primary) 18%, transparent)", color: "var(--color-text-readable)" }}
|
||||||
Messages
|
>
|
||||||
{unreadCount > 0 && (
|
{link.label}
|
||||||
<span
|
{link.badge > 0 && (
|
||||||
className="absolute -top-1.5 -right-1.5 flex min-w-[18px] h-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold leading-none"
|
<span className="absolute -top-1.5 -right-1.5 flex min-w-[18px] h-[18px] items-center justify-center rounded-full px-1 text-[10px] font-bold leading-none" style={{ background: "var(--color-danger)", color: "white" }}>
|
||||||
style={{ background: "var(--color-danger)", color: "white" }}
|
{link.badge > 99 ? "99+" : link.badge}
|
||||||
>
|
</span>
|
||||||
{unreadCount > 99 ? "99+" : unreadCount}
|
)}
|
||||||
</span>
|
</Link>
|
||||||
)}
|
))}
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
href={`/u/${user.username}`}
|
|
||||||
className="flex items-center justify-center gap-2 rounded-xl border p-3 text-sm font-bold transition-all hover:-translate-y-0.5"
|
|
||||||
style={{
|
|
||||||
background: "color-mix(in srgb, var(--color-primary) 6%, transparent)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-primary) 18%, transparent)",
|
|
||||||
color: "var(--color-text-readable)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
My profile
|
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
href="/settings"
|
|
||||||
className="flex items-center justify-center gap-2 rounded-xl border p-3 text-sm font-bold transition-all hover:-translate-y-0.5"
|
|
||||||
style={{
|
|
||||||
background: "color-mix(in srgb, var(--color-primary) 6%, transparent)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-primary) 18%, transparent)",
|
|
||||||
color: "var(--color-text-readable)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Settings
|
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
href="/shop"
|
|
||||||
className="flex items-center justify-center gap-2 rounded-xl border p-3 text-sm font-bold transition-all hover:-translate-y-0.5"
|
|
||||||
style={{
|
|
||||||
background: "color-mix(in srgb, var(--color-primary) 6%, transparent)",
|
|
||||||
borderColor: "color-mix(in srgb, var(--color-primary) 18%, transparent)",
|
|
||||||
color: "var(--color-text-readable)",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Shop
|
|
||||||
</Link>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Reveal>
|
</Reveal>
|
||||||
|
|||||||
Reference in new issue
Block a user