import { motion, useReducedMotion } from "motion/react"; import { ConfigProvider, Tabs } from "antd"; import { ArrowLeft, Play } from "lucide-react"; import { useEffect, useRef, useState } from "react"; import { Link, Outlet, useLocation, useNavigate } from "react-router"; import { BrandLogo } from "@/components/brand/brand-logo"; import { SiteComplianceFooter } from "@/components/layout/site-compliance-footer"; import { aceternityMotion } from "@/lib/aceternity-motion"; import { getAntThemeConfig } from "@/lib/app-theme"; import { brandStudioLabel, useAppearanceStore } from "@/stores/use-appearance-store"; const AUTH_TABS = [ { key: "login", label: "登录" }, { key: "register", label: "注册" }, ]; const authCopy = { login: { eyebrow: "WELCOME BACK", title: "进入创作现场", description: "继续编辑你的画布、素材与生成任务。", }, register: { eyebrow: "CREATE ACCOUNT", title: "建立你的创作空间", description: "一个账号管理画布、素材、技能和模型偏好。", }, recovery: { eyebrow: "ACCOUNT RECOVERY", title: "重新设置密码", description: "验证账号邮箱后,设置一个新的登录密码。", }, } as const; export function LinuxDOIcon() { return ( ); } export function AuthScene() { const appearance = useAppearanceStore((state) => state.appearance); const location = useLocation(); const navigate = useNavigate(); const reducedMotion = useReducedMotion(); const videoRef = useRef(null); const [manualVideoActive, setManualVideoActive] = useState(false); const [videoPlaying, setVideoPlaying] = useState(false); const [failedPosterURL, setFailedPosterURL] = useState(""); const recovery = location.pathname === "/forgot-password"; const activeTab = location.pathname === "/register" ? "register" : "login"; const copy = recovery ? authCopy.recovery : activeTab === "register" ? authCopy.register : authCopy.login; const automaticVideoActive = appearance.authVideoAutoplay && !reducedMotion; const videoActive = Boolean(appearance.authVideoUrl && (automaticVideoActive || manualVideoActive)); useEffect(() => { setManualVideoActive(false); setVideoPlaying(false); }, [appearance.authVideoUrl, appearance.authVideoAutoplay]); const playVideo = () => { setManualVideoActive(true); requestAnimationFrame(() => { void videoRef.current?.play().catch(() => setVideoPlaying(false)); }); }; return ( {videoActive && appearance.authVideoUrl ? setVideoPlaying(true)} onPause={() => setVideoPlaying(false)} /> : appearance.authVideoPosterUrl && failedPosterURL !== appearance.authVideoPosterUrl ? setFailedPosterURL(appearance.authVideoPosterUrl)} /> : null} } /> {appearance.brandName} {videoPlaying ? "创作正在发生" : "播放品牌影片"} {brandStudioLabel(appearance)} {appearance.authHeroTitle} {appearance.authHeroDescription ? {appearance.authHeroDescription} : null} 返回首页 {copy.eyebrow} {copy.title} {copy.description} {!recovery ? ( navigate({ pathname: key === "register" ? "/register" : "/login", search: location.search })} /> ) : null} ); }
{brandStudioLabel(appearance)}
{appearance.authHeroDescription}
{copy.eyebrow}
{copy.description}