frontend: redesign homepage with magic dock and login dialog

- Replace top login/register buttons with magic dock navigation
- Add dock items: home, downloads, blog, and conditional login/logout
- Show dashboard icon in dock when authenticated
- Extract HomePageClient for client-side dialog state
This commit is contained in:
2026-04-16 16:55:20 +00:00
parent baf2b26de0
commit 9f9f57b379
4 changed files with 202 additions and 42 deletions

View File

@@ -1,8 +1,14 @@
import { BlurFade } from "@/components/magicui/blur-fade";
import { Suspense } from "react";
import { auth } from "@/auth";
import { HomePageClient } from "./home-page-client";
const SERVER_API_URL = process.env.SERVER_API_URL || "http://backend:8080";
const hasKeycloak = !!process.env.AUTH_KEYCLOAK_ISSUER;
export default async function HomePage() {
const session = await auth();
const isAuthenticated = !!session?.user;
let healthText = "无法连接到后端服务";
try {
@@ -19,46 +25,12 @@ export default async function HomePage() {
}
return (
<div className="flex min-h-screen flex-col items-center justify-center bg-gradient-to-br from-slate-50 to-slate-100 p-4">
<BlurFade inView delay={0.1}>
<h1 className="mb-4 text-center text-4xl font-extrabold tracking-tight text-slate-900">
EvanPage
</h1>
</BlurFade>
<BlurFade inView delay={0.2}>
<p className="mb-8 max-w-md text-center text-lg text-slate-600">
</p>
</BlurFade>
<BlurFade inView delay={0.3}>
<div className="rounded-2xl border bg-white/80 px-8 py-6 shadow-lg backdrop-blur">
<p className="text-center text-sm font-medium text-slate-500">
</p>
<p className="mt-2 text-center text-xl font-semibold text-slate-800">
{healthText}
</p>
</div>
</BlurFade>
<BlurFade inView delay={0.4}>
<div className="mt-8 flex gap-4">
<a
href="/login"
className="rounded-lg bg-slate-900 px-5 py-2.5 text-sm font-medium text-white hover:bg-slate-800"
>
</a>
<a
href="/register"
className="rounded-lg border border-slate-300 bg-white px-5 py-2.5 text-sm font-medium text-slate-700 hover:bg-slate-50"
>
</a>
</div>
</BlurFade>
</div>
<Suspense>
<HomePageClient
isAuthenticated={isAuthenticated}
healthText={healthText}
hasKeycloak={hasKeycloak}
/>
</Suspense>
);
}