feat: 重新设计登录页,深色科技风格

This commit is contained in:
12451 2026-07-02 17:56:18 +08:00
parent b7546ec7d8
commit d16a0fc545

View File

@ -1,6 +1,6 @@
/** /**
* H5 *
* + *
*/ */
import { useState } from 'react'; import { useState } from 'react';
import { useNavigate, useSearchParams } from 'react-router-dom'; import { useNavigate, useSearchParams } from 'react-router-dom';
@ -31,21 +31,34 @@ export default function H5Login() {
}; };
return ( return (
<div className="flex min-h-screen flex-col bg-white px-6"> <div className="flex min-h-screen flex-col bg-[#09090b] px-6">
{/* 顶部品牌区 */} {/* 背景网格 */}
<div className="mt-20 mb-12 text-center"> <div
<div className="mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-2xl bg-blue-600 text-2xl text-white font-bold"> className="fixed inset-0 opacity-[0.03]"
P style={{
backgroundImage: 'linear-gradient(rgba(34,211,238,0.5) 1px, transparent 1px), linear-gradient(90deg, rgba(34,211,238,0.5) 1px, transparent 1px)',
backgroundSize: '60px 60px'
}}
/>
{/* 内容 */}
<div className="relative z-10 flex flex-1 flex-col items-center justify-center">
{/* Logo */}
<div className="mb-8 text-center">
<div className="mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-2xl bg-[#22d3ee]">
<svg className="h-8 w-8 text-[#09090b]" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/>
</svg>
</div> </div>
<h1 className="text-xl font-bold text-gray-900"></h1> <h1 className="text-2xl font-bold text-[#fafafa]"></h1>
<p className="mt-1 text-sm text-gray-500"></p> <p className="mt-2 text-sm text-[#71717a]"></p>
</div> </div>
{/* 登录表单 */} {/* 登录表单 */}
<form onSubmit={handleSubmit} className="flex flex-col gap-4"> <form onSubmit={handleSubmit} className="w-full max-w-sm space-y-4">
<div> <div>
<input <input
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-base outline-none focus:border-blue-500" className="w-full rounded-lg border border-[#3f3f46] bg-[#18181b] px-4 py-3 text-base text-[#fafafa] outline-none transition-colors focus:border-[#22d3ee]"
type="tel" type="tel"
placeholder="手机号" placeholder="手机号"
maxLength={11} maxLength={11}
@ -56,7 +69,7 @@ export default function H5Login() {
</div> </div>
<div> <div>
<input <input
className="w-full rounded-lg border border-gray-300 px-4 py-3 text-base outline-none focus:border-blue-500" className="w-full rounded-lg border border-[#3f3f46] bg-[#18181b] px-4 py-3 text-base text-[#fafafa] outline-none transition-colors focus:border-[#22d3ee]"
type="password" type="password"
placeholder="密码" placeholder="密码"
value={password} value={password}
@ -65,16 +78,24 @@ export default function H5Login() {
/> />
</div> </div>
{error && <p className="text-center text-sm text-red-500">{error}</p>} {error && (
<p className="text-center text-sm text-red-400">{error}</p>
)}
<button <button
type="submit" type="submit"
disabled={loading} disabled={loading}
className="mt-2 w-full rounded-lg bg-blue-600 py-3 text-base font-medium text-white disabled:opacity-50" className="mt-4 w-full rounded-lg bg-[#22d3ee] py-3 text-base font-medium text-[#09090b] transition-all hover:bg-[#06b6d4] active:translate-y-[1px] disabled:opacity-50"
> >
{loading ? '登录中...' : '登录'} {loading ? '登录中...' : '登录'}
</button> </button>
</form> </form>
{/* 底部信息 */}
<div className="mt-8 text-center text-xs text-[#52525b]">
<p></p>
</div>
</div>
</div> </div>
); );
} }