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>
735 lines
21 KiB
HTML
735 lines
21 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;
|
|
}
|
|
a { color: inherit; text-decoration: none; }
|
|
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
|
|
|
|
.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, #a855f7 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, #22d3ee 0%, transparent 60%);
|
|
filter: blur(100px);
|
|
opacity: 0.3;
|
|
pointer-events: none;
|
|
}
|
|
.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;
|
|
}
|
|
|
|
.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; }
|
|
.n-headline .cyan { color: var(--cyan); font-variant-numeric: tabular-nums; display: inline-block; }
|
|
.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;
|
|
}
|
|
.n-sub .line { display: block; }
|
|
.n-sub .puro { color: var(--text-0); font-weight: 600; }
|
|
|
|
/* Step list */
|
|
.steps {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 14px;
|
|
border: 1px solid rgba(148, 163, 184, 0.12);
|
|
border-radius: 12px;
|
|
padding: 20px;
|
|
background: rgba(15, 23, 42, 0.5);
|
|
backdrop-filter: blur(10px);
|
|
max-width: 420px;
|
|
}
|
|
.steps-title {
|
|
font-size: 12px;
|
|
font-family: 'JetBrains Mono', monospace;
|
|
color: var(--text-3);
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.15em;
|
|
margin-bottom: 4px;
|
|
}
|
|
.step {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 12px;
|
|
font-size: 13px;
|
|
}
|
|
.step-num {
|
|
flex-shrink: 0;
|
|
width: 22px; height: 22px;
|
|
border-radius: 50%;
|
|
background: rgba(34, 211, 238, 0.1);
|
|
border: 1px solid rgba(34, 211, 238, 0.25);
|
|
color: var(--cyan);
|
|
font-family: 'JetBrains Mono', monospace;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.step-text { color: var(--text-1); line-height: 1.5; padding-top: 2px; }
|
|
.step-text b { color: var(--text-0); font-weight: 600; }
|
|
.step-text .k {
|
|
font-family: 'JetBrains Mono', monospace;
|
|
background: rgba(255,255,255,0.04);
|
|
border: 1px solid var(--border);
|
|
padding: 1px 6px;
|
|
border-radius: 4px;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.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); }
|
|
|
|
/* ------ 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(168, 85, 247, 0.05) 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: 32px;
|
|
}
|
|
|
|
.field { margin-bottom: 18px; }
|
|
.field label {
|
|
display: block;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
color: var(--text-1);
|
|
margin-bottom: 8px;
|
|
}
|
|
.input-wrap {
|
|
position: relative;
|
|
display: flex;
|
|
align-items: center;
|
|
}
|
|
.input-wrap .icon {
|
|
position: absolute;
|
|
left: 14px;
|
|
width: 16px;
|
|
height: 16px;
|
|
color: var(--text-3);
|
|
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.ok { border-color: rgba(52, 211, 153, 0.4); }
|
|
.input-wrap input.ok:focus { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12); }
|
|
.input-wrap input.error { border-color: var(--red); }
|
|
.input-wrap .eye {
|
|
position: absolute;
|
|
right: 12px;
|
|
color: var(--text-3);
|
|
padding: 4px;
|
|
border-radius: 4px;
|
|
}
|
|
.input-wrap .eye:hover { color: var(--text-1); }
|
|
.input-wrap .valid-ico {
|
|
position: absolute;
|
|
right: 14px;
|
|
color: var(--green);
|
|
display: none;
|
|
}
|
|
.input-wrap input.ok ~ .valid-ico { display: flex; }
|
|
|
|
.pw-strength {
|
|
display: flex;
|
|
gap: 4px;
|
|
margin-top: 10px;
|
|
margin-bottom: 6px;
|
|
}
|
|
.pw-strength .bar {
|
|
flex: 1;
|
|
height: 3px;
|
|
background: var(--border);
|
|
border-radius: 2px;
|
|
transition: background .2s;
|
|
}
|
|
.pw-strength[data-score="1"] .bar:nth-child(1) { background: var(--red); }
|
|
.pw-strength[data-score="2"] .bar:nth-child(-n+2) { background: var(--amber); }
|
|
.pw-strength[data-score="3"] .bar:nth-child(-n+3) { background: var(--cyan); }
|
|
.pw-strength[data-score="4"] .bar { background: var(--green); }
|
|
|
|
.pw-hint {
|
|
font-size: 11px;
|
|
color: var(--text-3);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
font-family: 'JetBrains Mono', monospace;
|
|
}
|
|
.pw-hint .label { color: var(--text-3); }
|
|
.pw-hint .val { color: var(--text-1); }
|
|
.pw-hint[data-score="1"] .val { color: var(--red); }
|
|
.pw-hint[data-score="2"] .val { color: var(--amber); }
|
|
.pw-hint[data-score="3"] .val { color: var(--cyan); }
|
|
.pw-hint[data-score="4"] .val { color: var(--green); }
|
|
|
|
.match-hint {
|
|
font-size: 11px;
|
|
font-family: 'JetBrains Mono', monospace;
|
|
margin-top: 6px;
|
|
color: var(--text-3);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
}
|
|
.match-hint.ok { color: var(--green); }
|
|
.match-hint.bad { color: var(--red); }
|
|
|
|
.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;
|
|
transition: all .15s;
|
|
cursor: pointer;
|
|
}
|
|
.btn-primary {
|
|
background: var(--cyan);
|
|
color: #042f2e;
|
|
}
|
|
.btn-primary:hover { background: #67e8f9; }
|
|
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
.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); } }
|
|
|
|
.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); }
|
|
|
|
.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: 24px;
|
|
text-align: center;
|
|
font-size: 13px;
|
|
color: var(--text-2);
|
|
}
|
|
.foot a {
|
|
color: var(--cyan);
|
|
font-weight: 500;
|
|
}
|
|
.foot a:hover { color: #67e8f9; }
|
|
.legal {
|
|
margin-top: 16px;
|
|
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); }
|
|
|
|
.check {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
font-size: 12px;
|
|
color: var(--text-2);
|
|
cursor: pointer;
|
|
user-select: none;
|
|
margin-bottom: 20px;
|
|
line-height: 1.5;
|
|
}
|
|
.check input { display: none; }
|
|
.check .box {
|
|
flex-shrink: 0;
|
|
margin-top: 1px;
|
|
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);
|
|
}
|
|
.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;
|
|
}
|
|
.check a { color: var(--text-0); text-decoration: underline; text-decoration-color: var(--border-2); }
|
|
|
|
.back-home {
|
|
position: absolute;
|
|
top: 24px;
|
|
right: 32px;
|
|
font-size: 12px;
|
|
color: var(--text-3);
|
|
z-index: 10;
|
|
}
|
|
.back-home:hover { color: var(--text-0); }
|
|
|
|
.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;
|
|
}
|
|
|
|
@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);
|
|
}
|
|
.narrative-inner { gap: 18px; display: block; }
|
|
.n-center { gap: 12px; margin: 16px 0 0; }
|
|
.n-headline { font-size: 28px; }
|
|
.n-sub { font-size: 14px; }
|
|
.n-sub .line { display: inline; }
|
|
.steps, .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>
|
|
<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">// 5 分钟开始用</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="steps">
|
|
<div class="steps-title">// 下一步</div>
|
|
<div class="step">
|
|
<div class="step-num">1</div>
|
|
<div class="step-text"><b>创建账户</b> · 邮箱 + 密码,或用 LinuxDO OAuth</div>
|
|
</div>
|
|
<div class="step">
|
|
<div class="step-num">2</div>
|
|
<div class="step-text"><b>绑定订阅</b> · OAuth 接入你现有的 Claude Pro / ChatGPT Plus</div>
|
|
</div>
|
|
<div class="step">
|
|
<div class="step-num">3</div>
|
|
<div class="step-text"><b>生成 key</b> · 拿到 <span class="k">sk-puro-…</span> 换掉 SDK 的 <span class="k">base_url</span></div>
|
|
</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>无需信用卡 · 永久免费 Hobby 套餐</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- RIGHT: FORM -->
|
|
<div class="form-side">
|
|
<a href="Landing.html" class="back-home">← 返回首页</a>
|
|
|
|
<form class="form-card" id="reg-form" autocomplete="off" novalidate>
|
|
<h1>创建账户</h1>
|
|
<p class="sub">5 分钟开始用 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>
|
|
<span class="valid-ico">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M5 12l5 5L20 7"/>
|
|
</svg>
|
|
</span>
|
|
</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="至少 8 位,含字母与数字" required>
|
|
<button type="button" class="eye" id="toggle-pw" aria-label="切换显示密码">
|
|
<svg 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>
|
|
</button>
|
|
</div>
|
|
<div class="pw-strength" id="pw-strength" data-score="0">
|
|
<span class="bar"></span><span class="bar"></span><span class="bar"></span><span class="bar"></span>
|
|
</div>
|
|
<div class="pw-hint" id="pw-hint" data-score="0">
|
|
<span class="label">// strength</span>
|
|
<span class="val">—</span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label for="password2">确认密码</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="password2" name="password2" placeholder="再输入一次" required>
|
|
<span class="valid-ico">
|
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M5 12l5 5L20 7"/>
|
|
</svg>
|
|
</span>
|
|
</div>
|
|
<div class="match-hint" id="match-hint"></div>
|
|
</div>
|
|
|
|
<label class="check">
|
|
<input type="checkbox" id="terms">
|
|
<span class="box"></span>
|
|
<span>我已阅读并同意 <a href="#">服务条款</a> 与 <a href="#">隐私政策</a></span>
|
|
</label>
|
|
|
|
<button type="submit" class="btn btn-primary" id="submit-btn" disabled>
|
|
<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="Login.html">登录</a>
|
|
</div>
|
|
|
|
<div class="legal">
|
|
注册即可获得 Hobby 套餐 · 无需信用卡
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const pw = document.getElementById('password');
|
|
const pw2 = document.getElementById('password2');
|
|
const email = document.getElementById('email');
|
|
const terms = document.getElementById('terms');
|
|
const btn = document.getElementById('submit-btn');
|
|
const strengthBars = document.getElementById('pw-strength');
|
|
const strengthHint = document.getElementById('pw-hint');
|
|
const matchHint = document.getElementById('match-hint');
|
|
const toggle = document.getElementById('toggle-pw');
|
|
|
|
toggle.addEventListener('click', () => {
|
|
pw.type = pw.type === 'password' ? 'text' : 'password';
|
|
});
|
|
|
|
const labels = ['—', '太弱', '一般', '良好', '强'];
|
|
function scorePw(v) {
|
|
let s = 0;
|
|
if (v.length >= 8) s++;
|
|
if (/[a-z]/.test(v) && /[A-Z]/.test(v)) s++;
|
|
if (/\d/.test(v)) s++;
|
|
if (/[^\w\s]/.test(v) || v.length >= 14) s++;
|
|
if (v.length === 0) s = 0;
|
|
return Math.min(s, 4);
|
|
}
|
|
|
|
function update() {
|
|
const s = scorePw(pw.value);
|
|
strengthBars.dataset.score = s;
|
|
strengthHint.dataset.score = s;
|
|
strengthHint.querySelector('.val').textContent = labels[s];
|
|
|
|
// email validity
|
|
const emailOk = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email.value);
|
|
email.classList.toggle('ok', emailOk);
|
|
|
|
// match
|
|
if (pw2.value.length === 0) {
|
|
matchHint.textContent = '';
|
|
matchHint.className = 'match-hint';
|
|
pw2.classList.remove('ok', 'error');
|
|
} else if (pw.value === pw2.value) {
|
|
matchHint.innerHTML = '<span>✓</span> 两次密码一致';
|
|
matchHint.className = 'match-hint ok';
|
|
pw2.classList.add('ok');
|
|
pw2.classList.remove('error');
|
|
} else {
|
|
matchHint.innerHTML = '<span>✗</span> 密码不一致';
|
|
matchHint.className = 'match-hint bad';
|
|
pw2.classList.add('error');
|
|
pw2.classList.remove('ok');
|
|
}
|
|
|
|
const ready = emailOk && s >= 2 && pw.value === pw2.value && pw.value.length >= 8 && terms.checked;
|
|
btn.disabled = !ready;
|
|
}
|
|
|
|
[email, pw, pw2, terms].forEach(el => el.addEventListener('input', update));
|
|
terms.addEventListener('change', update);
|
|
|
|
const form = document.getElementById('reg-form');
|
|
form.addEventListener('submit', (e) => {
|
|
e.preventDefault();
|
|
if (btn.disabled) return;
|
|
btn.classList.add('loading');
|
|
btn.disabled = true;
|
|
setTimeout(() => {
|
|
btn.classList.remove('loading');
|
|
btn.querySelector('.label').textContent = '✓ 账户已创建,跳转中…';
|
|
btn.style.background = '#34d399';
|
|
}, 1500);
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|