import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { motion, AnimatePresence } from 'motion/react'; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/src/components/ui/card'; import { Button } from '@/src/components/ui/button'; import { Input } from '@/src/components/ui/input'; import { LogIn, User, Lock, UserPlus, Mail, ArrowLeft } from 'lucide-react'; import { cn } from '@/src/lib/utils'; export default function Login() { const navigate = useNavigate(); const [isLogin, setIsLogin] = useState(true); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(''); // Simulate auth setTimeout(() => { setLoading(false); if (isLogin) { navigate('/overview'); } else { setIsLogin(true); // Switch back to login after "registering" } }, 1000); }; return (
{/* Background Glow */}
{/* Left Side: Brand Info (Only visible in Login mode) */} {isLogin && (
Access Portal

YOYUZH.XYZ

个人网站
统一入口

欢迎来到 YOYUZH 的个人门户。在这里,你可以集中管理个人网盘文件、查询教务成绩课表,以及体验轻量级小游戏。

)}
{/* Form Container */} {isLogin ? ( 登录 请输入您的账号和密码以继续
{error && (
{error}
)}
) : (
注册账号
创建一个新账号以开启您的门户体验
)}
); }