10 HTML pages + puro.css + HANDOFF.md + 2 images (~810KB total). Reference artifacts for Stage 3 Vue 3 translation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
690 lines
19 KiB
HTML
690 lines
19 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>登录 — PURO AI</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
<style>
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
:root {
|
|
--bg-0: #0a0e1a;
|
|
--bg-1: #0f172a;
|
|
--border: #1e293b;
|
|
--border-2: #334155;
|
|
--text-0: #f8fafc;
|
|
--text-1: #cbd5e1;
|
|
--text-2: #94a3b8;
|
|
--text-3: #64748b;
|
|
--cyan: #22d3ee;
|
|
--purple: #a855f7;
|
|
--amber: #fbbf24;
|
|
--red: #f87171;
|
|
--green: #34d399;
|
|
}
|
|
html, body {
|
|
background: var(--bg-0);
|
|
color: var(--text-0);
|
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
-webkit-font-smoothing: antialiased;
|
|
min-height: 100vh;
|
|
}
|
|
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
|
|
a { color: inherit; text-decoration: none; }
|
|
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
|
|
|
|
/* ------ SPLIT LAYOUT ------ */
|
|
.split {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* ------ LEFT (NARRATIVE) ------ */
|
|
.narrative {
|
|
position: relative;
|
|
overflow: hidden;
|
|
padding: 48px 56px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
background: linear-gradient(135deg, #0a0e1a 0%, #1e1b4b 100%);
|
|
border-right: 1px solid var(--border);
|
|
}
|
|
.narrative::before {
|
|
content: "";
|
|
position: absolute;
|
|
top: -200px; left: -200px;
|
|
width: 700px; height: 700px;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle, #22d3ee 0%, transparent 60%);
|
|
filter: blur(100px);
|
|
opacity: 0.3;
|
|
pointer-events: none;
|
|
}
|
|
.narrative::after {
|
|
content: "";
|
|
position: absolute;
|
|
bottom: -250px; right: -150px;
|
|
width: 700px; height: 700px;
|
|
border-radius: 50%;
|
|
background: radial-gradient(circle, #a855f7 0%, transparent 60%);
|
|
filter: blur(100px);
|
|
opacity: 0.3;
|
|
pointer-events: none;
|
|
}
|
|
/* grid pattern */
|
|
.narrative-grid {
|
|
position: absolute;
|
|
inset: 0;
|
|
background-image:
|
|
linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
|
|
linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
|
|
background-size: 48px 48px;
|
|
mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.narrative-inner {
|
|
position: relative;
|
|
z-index: 2;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
flex: 1;
|
|
min-height: 0;
|
|
}
|
|
|
|
.n-top { padding-top: 4px; }
|
|
.brand {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
font-weight: 700;
|
|
font-size: 15px;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
.hex {
|
|
width: 22px; height: 22px;
|
|
color: var(--cyan);
|
|
}
|
|
|
|
.n-center {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 28px;
|
|
margin: auto 0;
|
|
max-width: 520px;
|
|
}
|
|
.n-kicker {
|
|
font-family: 'JetBrains Mono', monospace;
|
|
font-size: 11px;
|
|
color: var(--cyan);
|
|
letter-spacing: 0.2em;
|
|
text-transform: uppercase;
|
|
}
|
|
.n-headline {
|
|
font-size: clamp(36px, 4.2vw, 52px);
|
|
font-weight: 800;
|
|
line-height: 1.1;
|
|
letter-spacing: -0.03em;
|
|
}
|
|
.n-headline .amber {
|
|
color: var(--amber);
|
|
font-variant-numeric: tabular-nums;
|
|
display: inline-block;
|
|
position: relative;
|
|
}
|
|
.n-headline .cyan {
|
|
color: var(--cyan);
|
|
font-variant-numeric: tabular-nums;
|
|
display: inline-block;
|
|
position: relative;
|
|
}
|
|
.n-headline .arrow {
|
|
display: inline-block;
|
|
margin: 0 14px;
|
|
color: var(--text-2);
|
|
font-weight: 400;
|
|
}
|
|
.n-sub {
|
|
font-size: 17px;
|
|
color: var(--text-1);
|
|
line-height: 1.7;
|
|
font-weight: 400;
|
|
}
|
|
.n-sub .line { display: block; }
|
|
.n-sub .puro {
|
|
color: var(--text-0);
|
|
font-weight: 600;
|
|
}
|
|
.n-sub .mono-accent {
|
|
font-family: 'JetBrains Mono', monospace;
|
|
color: var(--text-2);
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* Visual demo block — a mock "route" diagram */
|
|
.route-demo {
|
|
border: 1px solid rgba(148, 163, 184, 0.12);
|
|
border-radius: 12px;
|
|
padding: 18px 20px;
|
|
background: rgba(15, 23, 42, 0.5);
|
|
backdrop-filter: blur(10px);
|
|
max-width: 420px;
|
|
font-family: 'JetBrains Mono', monospace;
|
|
font-size: 12px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
.route-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
color: var(--text-2);
|
|
}
|
|
.route-row .head {
|
|
width: 84px;
|
|
color: var(--text-3);
|
|
}
|
|
.route-row .val {
|
|
color: var(--text-0);
|
|
}
|
|
.route-row.status .val { color: var(--cyan); display: inline-flex; align-items: center; gap: 6px; }
|
|
.route-row.status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
|
|
.route-row .chip {
|
|
padding: 2px 8px;
|
|
background: rgba(34, 211, 238, 0.08);
|
|
border: 1px solid rgba(34, 211, 238, 0.2);
|
|
border-radius: 4px;
|
|
color: var(--cyan);
|
|
font-size: 11px;
|
|
}
|
|
.route-row .chip.a { background: rgba(168, 85, 247, 0.08); border-color: rgba(168, 85, 247, 0.2); color: var(--purple); }
|
|
|
|
.n-bottom {
|
|
position: relative;
|
|
z-index: 2;
|
|
font-family: 'JetBrains Mono', monospace;
|
|
font-size: 12px;
|
|
color: var(--text-3);
|
|
display: flex;
|
|
gap: 18px;
|
|
padding-top: 24px;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
}
|
|
.n-bottom .sep { color: var(--border-2); }
|
|
.n-bottom .live {
|
|
display: inline-flex; align-items: center; gap: 6px;
|
|
color: var(--text-2);
|
|
}
|
|
.n-bottom .live .dot {
|
|
width: 6px; height: 6px; border-radius: 50%; background: var(--green);
|
|
animation: pulse 2s infinite;
|
|
}
|
|
@keyframes pulse {
|
|
0%, 100% { opacity: 1; }
|
|
50% { opacity: 0.4; }
|
|
}
|
|
|
|
/* ------ RIGHT (FORM) ------ */
|
|
.form-side {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 48px;
|
|
background: var(--bg-0);
|
|
position: relative;
|
|
}
|
|
.form-side::before {
|
|
content: "";
|
|
position: absolute;
|
|
top: 40%; left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
width: 500px; height: 500px;
|
|
background: radial-gradient(circle, rgba(34, 211, 238, 0.06) 0%, transparent 60%);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.form-card {
|
|
width: 100%;
|
|
max-width: 400px;
|
|
position: relative;
|
|
z-index: 2;
|
|
}
|
|
.form-card h1 {
|
|
font-size: 28px;
|
|
font-weight: 700;
|
|
letter-spacing: -0.02em;
|
|
margin-bottom: 8px;
|
|
}
|
|
.form-card .sub {
|
|
color: var(--text-2);
|
|
font-size: 14px;
|
|
margin-bottom: 36px;
|
|
}
|
|
|
|
.field {
|
|
margin-bottom: 18px;
|
|
}
|
|
.field label {
|
|
display: block;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
color: var(--text-1);
|
|
margin-bottom: 8px;
|
|
letter-spacing: 0.02em;
|
|
}
|
|
.input-wrap {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.input-wrap .icon {
|
|
position: absolute;
|
|
left: 14px;
|
|
width: 16px;
|
|
height: 16px;
|
|
color: var(--text-3);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
pointer-events: none;
|
|
}
|
|
.input-wrap input {
|
|
width: 100%;
|
|
padding: 12px 14px 12px 42px;
|
|
background: var(--bg-1);
|
|
border: 1px solid var(--border-2);
|
|
border-radius: 8px;
|
|
color: var(--text-0);
|
|
font-size: 14px;
|
|
font-family: inherit;
|
|
outline: none;
|
|
transition: all .15s;
|
|
}
|
|
.input-wrap input::placeholder { color: var(--text-3); }
|
|
.input-wrap input:hover { border-color: #475569; }
|
|
.input-wrap input:focus {
|
|
border-color: var(--cyan);
|
|
box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
|
|
background: rgba(15, 23, 42, 0.9);
|
|
}
|
|
.input-wrap input.error {
|
|
border-color: var(--red);
|
|
box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
|
|
}
|
|
.input-wrap .eye {
|
|
position: absolute;
|
|
right: 12px;
|
|
color: var(--text-3);
|
|
padding: 4px;
|
|
border-radius: 4px;
|
|
transition: color .15s;
|
|
}
|
|
.input-wrap .eye:hover { color: var(--text-1); }
|
|
|
|
.field-meta {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
font-size: 12px;
|
|
margin-top: 6px;
|
|
}
|
|
.field-meta .forgot {
|
|
color: var(--text-2);
|
|
transition: color .15s;
|
|
margin-left: auto;
|
|
}
|
|
.field-meta .forgot:hover { color: var(--cyan); }
|
|
.field-error {
|
|
color: var(--red);
|
|
font-size: 12px;
|
|
margin-top: 6px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
.field-hint {
|
|
color: var(--text-3);
|
|
font-size: 12px;
|
|
margin-top: 6px;
|
|
}
|
|
|
|
.pw-strength {
|
|
display: flex;
|
|
gap: 4px;
|
|
margin-top: 10px;
|
|
}
|
|
.pw-strength .bar {
|
|
flex: 1;
|
|
height: 3px;
|
|
background: var(--border);
|
|
border-radius: 2px;
|
|
transition: background .2s;
|
|
}
|
|
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
width: 100%;
|
|
padding: 13px 20px;
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
border-radius: 8px;
|
|
font-family: inherit;
|
|
transition: all .15s;
|
|
cursor: pointer;
|
|
}
|
|
.btn-primary {
|
|
background: var(--cyan);
|
|
color: #042f2e;
|
|
}
|
|
.btn-primary:hover { background: #67e8f9; }
|
|
.btn-primary:active { transform: translateY(1px); }
|
|
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
.btn-ghost {
|
|
background: transparent;
|
|
border: 1px solid var(--border-2);
|
|
color: var(--text-1);
|
|
font-weight: 500;
|
|
}
|
|
.btn-ghost:hover { border-color: #475569; color: var(--text-0); background: rgba(255,255,255,0.02); }
|
|
|
|
.btn-primary .spinner {
|
|
width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.2);
|
|
border-top-color: #042f2e;
|
|
border-radius: 50%;
|
|
animation: spin .7s linear infinite;
|
|
display: none;
|
|
}
|
|
.btn-primary.loading .spinner { display: inline-block; }
|
|
.btn-primary.loading .label { opacity: 0.5; }
|
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
|
|
.divider {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 14px;
|
|
margin: 24px 0;
|
|
color: var(--text-3);
|
|
font-size: 11px;
|
|
font-family: 'JetBrains Mono', monospace;
|
|
letter-spacing: 0.15em;
|
|
}
|
|
.divider::before, .divider::after {
|
|
content: "";
|
|
flex: 1;
|
|
height: 1px;
|
|
background: var(--border);
|
|
}
|
|
|
|
.foot {
|
|
margin-top: 28px;
|
|
text-align: center;
|
|
font-size: 13px;
|
|
color: var(--text-2);
|
|
}
|
|
.foot a {
|
|
color: var(--cyan);
|
|
font-weight: 500;
|
|
transition: color .15s;
|
|
}
|
|
.foot a:hover { color: #67e8f9; }
|
|
|
|
.legal {
|
|
margin-top: 18px;
|
|
text-align: center;
|
|
font-size: 11px;
|
|
color: var(--text-3);
|
|
line-height: 1.6;
|
|
}
|
|
.legal a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-2); }
|
|
.legal a:hover { color: var(--text-0); }
|
|
|
|
/* checkbox */
|
|
.check {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-size: 12px;
|
|
color: var(--text-2);
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
.check input { display: none; }
|
|
.check .box {
|
|
width: 14px; height: 14px;
|
|
border: 1px solid var(--border-2);
|
|
border-radius: 4px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: var(--bg-1);
|
|
transition: all .15s;
|
|
}
|
|
.check input:checked + .box {
|
|
background: var(--cyan);
|
|
border-color: var(--cyan);
|
|
}
|
|
.check input:checked + .box::after {
|
|
content: "✓";
|
|
color: #042f2e;
|
|
font-size: 10px;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.back-home {
|
|
position: absolute;
|
|
top: 24px;
|
|
right: 32px;
|
|
font-size: 12px;
|
|
color: var(--text-3);
|
|
transition: color .15s;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
z-index: 10;
|
|
}
|
|
.back-home:hover { color: var(--text-0); }
|
|
|
|
/* LinuxDo logo */
|
|
.linuxdo-ico {
|
|
width: 16px; height: 16px;
|
|
border-radius: 3px;
|
|
background: linear-gradient(135deg, #f0a030, #f05050);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 10px;
|
|
font-weight: 800;
|
|
color: white;
|
|
}
|
|
|
|
/* Mobile */
|
|
@media (max-width: 900px) {
|
|
.split { grid-template-columns: 1fr; min-height: auto; }
|
|
.narrative {
|
|
padding: 24px 24px 32px;
|
|
border-right: none;
|
|
border-bottom: 1px solid var(--border);
|
|
min-height: auto;
|
|
}
|
|
.narrative-inner { gap: 18px; display: block; }
|
|
.n-top { margin-bottom: 16px; }
|
|
.n-center { gap: 12px; margin: 0; }
|
|
.n-headline { font-size: 28px; }
|
|
.n-sub { font-size: 14px; }
|
|
.n-sub .line { display: inline; }
|
|
.route-demo, .n-bottom { display: none; }
|
|
.form-side { padding: 32px 24px; }
|
|
.back-home { top: 18px; right: 18px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="split">
|
|
<!-- LEFT: NARRATIVE -->
|
|
<div class="narrative">
|
|
<div class="narrative-grid"></div>
|
|
<div class="narrative-inner">
|
|
<div class="n-top">
|
|
<a href="Landing.html" class="brand">
|
|
<svg class="hex" viewBox="0 0 24 24" fill="none">
|
|
<path d="M12 2L21 7V17L12 22L3 17V7L12 2Z" stroke="currentColor" stroke-width="1.8" fill="rgba(34, 211, 238, 0.08)"/>
|
|
<path d="M12 7L17 9.5V14.5L12 17L7 14.5V9.5L12 7Z" fill="currentColor"/>
|
|
</svg>
|
|
PURO AI
|
|
</a>
|
|
</div>
|
|
|
|
<div class="n-center">
|
|
<div class="n-kicker">// 你的订阅,已经付过钱了</div>
|
|
<h1 class="n-headline">
|
|
<span class="amber">N</span> 个订阅
|
|
<span class="arrow">→</span>
|
|
<span class="cyan">1</span> 个 key
|
|
</h1>
|
|
<div class="n-sub">
|
|
<span class="line">省去切换账号的繁琐,</span>
|
|
<span class="line">省去为多个高昂订阅重复买单。</span>
|
|
<span class="line"><span class="puro">PURO</span>(纯粹)—— 让 AI 调用回归本质。</span>
|
|
</div>
|
|
|
|
<div class="route-demo">
|
|
<div class="route-row"><span class="head">POST</span> <span class="val">/v1/chat/completions</span></div>
|
|
<div class="route-row"><span class="head">model</span> <span class="chip">claude-sonnet-4-5</span></div>
|
|
<div class="route-row"><span class="head">route →</span> <span class="chip a">claude-pool-03</span></div>
|
|
<div class="route-row status"><span class="head">status</span> <span class="val"><span class="dot"></span>200 · 213ms · 42 tok</span></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="n-bottom">
|
|
<span>Claude</span><span class="sep">·</span>
|
|
<span>ChatGPT</span><span class="sep">·</span>
|
|
<span>Codex</span><span class="sep">·</span>
|
|
<span>Gemini</span>
|
|
<span class="sep" style="margin: 0 4px;">|</span>
|
|
<span class="live"><span class="dot"></span>ai.puro.im · operational</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- RIGHT: FORM -->
|
|
<div class="form-side">
|
|
<a href="Landing.html" class="back-home">← 返回首页</a>
|
|
|
|
<form class="form-card" id="login-form" autocomplete="off" novalidate>
|
|
<h1>登录</h1>
|
|
<p class="sub">用你的 PURO AI 账户继续</p>
|
|
|
|
<div class="field">
|
|
<label for="email">邮箱</label>
|
|
<div class="input-wrap">
|
|
<span class="icon">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="3" y="5" width="18" height="14" rx="2"/>
|
|
<path d="M3 7l9 6 9-6"/>
|
|
</svg>
|
|
</span>
|
|
<input type="email" id="email" name="email" placeholder="you@puro.im" required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label for="password">密码</label>
|
|
<div class="input-wrap">
|
|
<span class="icon">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="4" y="11" width="16" height="10" rx="2"/>
|
|
<path d="M8 11V7a4 4 0 0 1 8 0v4"/>
|
|
</svg>
|
|
</span>
|
|
<input type="password" id="password" name="password" placeholder="••••••••" required>
|
|
<button type="button" class="eye" id="toggle-pw" aria-label="切换显示密码">
|
|
<svg id="eye-open" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/>
|
|
<circle cx="12" cy="12" r="3"/>
|
|
</svg>
|
|
<svg id="eye-closed" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" style="display:none;">
|
|
<path d="M9.88 9.88A3 3 0 0 0 14.12 14.12M10.73 5.08A10.94 10.94 0 0 1 12 5c6.5 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68M6.61 6.61A13.53 13.53 0 0 0 2 12s3.5 7 10 7a9.77 9.77 0 0 0 5.39-1.61M2 2l20 20"/>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<div class="field-meta">
|
|
<label class="check">
|
|
<input type="checkbox" checked>
|
|
<span class="box"></span>
|
|
记住我
|
|
</label>
|
|
<a href="#" class="forgot">忘记密码?</a>
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary" id="submit-btn">
|
|
<span class="spinner"></span>
|
|
<span class="label">登录 →</span>
|
|
</button>
|
|
|
|
<div class="divider">OR</div>
|
|
|
|
<button type="button" class="btn btn-ghost">
|
|
<span class="linuxdo-ico">L</span>
|
|
使用 LinuxDO 登录
|
|
</button>
|
|
|
|
<div class="foot">
|
|
没有账户?<a href="Register.html">注册</a>
|
|
</div>
|
|
|
|
<div class="legal">
|
|
登录即表示你同意 <a href="#">服务条款</a> 与 <a href="#">隐私政策</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
// eye toggle
|
|
const pw = document.getElementById('password');
|
|
const toggle = document.getElementById('toggle-pw');
|
|
const eyeOpen = document.getElementById('eye-open');
|
|
const eyeClosed = document.getElementById('eye-closed');
|
|
toggle.addEventListener('click', () => {
|
|
const show = pw.type === 'password';
|
|
pw.type = show ? 'text' : 'password';
|
|
eyeOpen.style.display = show ? 'none' : 'block';
|
|
eyeClosed.style.display = show ? 'block' : 'none';
|
|
});
|
|
|
|
// submit (mocked)
|
|
const form = document.getElementById('login-form');
|
|
const btn = document.getElementById('submit-btn');
|
|
form.addEventListener('submit', (e) => {
|
|
e.preventDefault();
|
|
if (!form.email.value || !form.password.value) return;
|
|
btn.classList.add('loading');
|
|
btn.disabled = true;
|
|
setTimeout(() => {
|
|
btn.classList.remove('loading');
|
|
btn.disabled = false;
|
|
btn.querySelector('.label').textContent = '✓ 登录成功';
|
|
btn.style.background = '#34d399';
|
|
setTimeout(() => {
|
|
btn.querySelector('.label').textContent = '登录 →';
|
|
btn.style.background = '';
|
|
}, 1500);
|
|
}, 1200);
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|