auto-save 2026-05-15 19:41 (~3)

This commit is contained in:
2026-05-15 19:41:26 +08:00
parent 5a375611a5
commit 1d0f9240cf
3 changed files with 28 additions and 20 deletions

View File

@@ -101,15 +101,14 @@ export default function LoginPage() {
<div className="space-y-3">
<label className="block">
<span className="sr-only">访</span>
<span className="flex h-11 items-center gap-3 rounded-[8px] border border-white/10 bg-black/25 px-3 text-white transition focus-within:border-[#d6b36a] focus-within:bg-black/35 focus-within:ring-2 focus-within:ring-[#d6b36a]/25">
<UserRound className="h-4 w-4 text-white/45" />
<input
className="h-full min-w-0 flex-1 bg-transparent text-base text-white outline-none placeholder:text-white/30"
value={username}
disabled={disabled}
aria-label="account"
autoComplete="username"
placeholder="账号"
onFocus={() => setActiveField("username")}
onBlur={() => setActiveField(null)}
onChange={(event) => {
@@ -121,16 +120,15 @@ export default function LoginPage() {
</label>
<label className="block">
<span className="sr-only">访</span>
<span className="flex h-11 items-center gap-3 rounded-[8px] border border-white/10 bg-black/25 px-3 text-white transition focus-within:border-[#d6b36a] focus-within:bg-black/35 focus-within:ring-2 focus-within:ring-[#d6b36a]/25">
<LockKeyhole className="h-4 w-4 text-white/45" />
<input
className="h-full min-w-0 flex-1 bg-transparent text-base text-white outline-none placeholder:text-white/30"
value={password}
disabled={disabled}
aria-label="secret"
type={showPassword ? "text" : "password"}
autoComplete="current-password"
placeholder="密钥"
onFocus={() => setActiveField("password")}
onBlur={() => setActiveField(null)}
onChange={(event) => {
@@ -158,21 +156,19 @@ export default function LoginPage() {
type="checkbox"
checked={remember}
disabled={disabled}
aria-label="remember"
onChange={(event) => setRemember(event.target.checked)}
/>
<span></span>
</label>
<div className="mt-4 min-h-9" aria-live="polite">
{error ? (
<div className="flex items-start gap-2 rounded-[8px] border border-red-400/30 bg-red-500/10 px-3 py-2 text-sm text-red-100">
<AlertCircle className="mt-0.5 h-4 w-4 shrink-0" />
<span>{error}</span>
<div className="inline-flex h-9 w-9 items-center justify-center rounded-[8px] border border-red-400/30 bg-red-500/10 text-red-100">
<AlertCircle className="h-4 w-4" />
</div>
) : status === "success" ? (
<div className="flex items-start gap-2 rounded-[8px] border border-emerald-300/30 bg-emerald-400/10 px-3 py-2 text-sm text-emerald-100">
<CheckCircle2 className="mt-0.5 h-4 w-4 shrink-0" />
<span></span>
<div className="inline-flex h-9 w-9 items-center justify-center rounded-[8px] border border-emerald-300/30 bg-emerald-400/10 text-emerald-100">
<CheckCircle2 className="h-4 w-4" />
</div>
) : null}
</div>
@@ -181,8 +177,8 @@ export default function LoginPage() {
className="mt-1 flex h-11 w-full items-center justify-center gap-2 rounded-[8px] bg-white px-4 text-base font-semibold text-black shadow-xl shadow-black/25 transition hover:bg-[#f5efe3] focus:outline-none focus:ring-2 focus:ring-[#d6b36a]/60 disabled:cursor-wait disabled:opacity-70"
type="submit"
disabled={disabled}
aria-label="submit"
>
<span>{status === "loading" ? "验证中" : status === "success" ? "进入中" : "登录"}</span>
<ArrowRight className="h-4 w-4" />
</button>
</form>