Files
nj/docs/opendesign/screens/desktop/login.html
iven b320641d9c
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled
fix(app): 全链路验证修复 — 编译错误/CORS/迁移/启动脚本
前端修复:
- calendar_page: 移除不存在的 JournalEntry.content getter
- responsive_scaffold: 移除不存在的 notchThickness 参数
- splash_page: SingleTickerProvider → TickerProvider (多 AnimationController)
- profile_page: UserRoleType.name → .code (修复运行时崩溃)
- 导入缺失的 user.dart

后端修复:
- class_service: generate_class_code 取 UUID 后6位(随机部分)避免碰撞
- diary_role_seed: 移除不存在的 id 列,使用复合主键 ON CONFLICT

基础设施:
- config/default.toml: CORS 改为通配符(开发模式)
- scripts/dev.sh: 统一启动脚本(自动清理端口)
- docs/opendesign/: Open Design 设计规格 HTML 原型稿

验证结果: flutter analyze 0 error, cargo test 77/77 通过, 17个页面全部渲染正常
2026-06-02 01:03:58 +08:00

726 lines
23 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端登录/注册</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
display: flex;
}
/* Focus styles */
button:focus-visible, a:focus-visible, input:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
/* Split layout: 60% brand | 40% form */
.brand-side {
width: 60%;
height: 900px;
background: linear-gradient(160deg, var(--tertiary-soft) 0%, var(--rose-soft) 100%);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
}
.form-side {
width: 40%;
height: 900px;
background: var(--surface);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
/* macOS status bar */
.statusbar {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 32px;
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-6);
font-size: 13px;
color: var(--muted);
font-weight: 500;
z-index: 60;
}
.statusbar .traffic-lights {
display: flex;
gap: 8px;
}
.statusbar .dot {
width: 12px;
height: 12px;
border-radius: 50%;
}
/* Brand side content */
.brand-content {
display: flex;
flex-direction: column;
align-items: center;
z-index: 5;
}
/* CSS-drawn notebook logo */
.logo-wrap {
width: 100px;
height: 100px;
position: relative;
margin-bottom: var(--space-6);
}
.logo-notebook {
width: 76px;
height: 86px;
border: 3px solid var(--accent);
border-radius: 8px 12px 12px 8px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background: rgba(224, 122, 95, 0.06);
}
.logo-spine {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 3px;
height: 86px;
background: var(--accent);
border-radius: 2px;
}
.logo-heart {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -45%);
width: 22px;
height: 22px;
}
.logo-heart::before {
content: '';
position: absolute;
left: 50%;
top: 50%;
width: 22px;
height: 22px;
background: var(--accent);
clip-path: path('M11 19C11 19 2 13 2 8C2 4.5 4.5 2 7.5 2C9.3 2 10.7 2.8 11 3.8C11.3 2.8 12.7 2 14.5 2C17.5 2 20 4.5 20 8C20 13 11 19 11 19Z');
transform: translate(-50%, -50%);
}
.brand-title {
font-family: var(--font-display);
font-size: var(--text-4xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-2);
}
.brand-tagline {
font-family: var(--font-handwritten);
font-size: var(--text-xl);
color: var(--accent);
font-weight: 500;
}
/* Feature cards */
.feature-cards {
display: flex;
gap: var(--space-5);
margin-top: var(--space-12);
z-index: 5;
}
.feature-card {
width: 180px;
padding: var(--space-5);
background: rgba(255, 255, 255, 0.6);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
border-radius: var(--radius-md);
border: 1px solid rgba(255, 255, 255, 0.5);
text-align: center;
transition: transform var(--motion-fast) var(--ease-bounce);
}
.feature-card:hover {
transform: translateY(-4px);
}
.feature-icon {
font-size: 32px;
margin-bottom: var(--space-3);
}
.feature-title {
font-family: var(--font-display);
font-size: var(--text-base);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-1);
}
.feature-desc {
font-size: var(--text-xs);
color: var(--muted);
line-height: 1.4;
}
/* Floating decorations on brand side */
.deco {
position: absolute;
pointer-events: none;
opacity: 0.15;
}
.deco-circle1 {
width: 200px; height: 200px; border-radius: 50%;
background: var(--accent);
top: -60px; left: -40px;
opacity: 0.08;
}
.deco-circle2 {
width: 120px; height: 120px; border-radius: 50%;
background: var(--secondary);
bottom: 80px; right: 40px;
opacity: 0.1;
}
.deco-circle3 {
width: 60px; height: 60px; border-radius: 50%;
background: var(--tertiary);
top: 140px; right: 120px;
opacity: 0.12;
}
.deco-dot1 {
width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
top: 200px; left: 80px; opacity: 0.2;
}
.deco-dot2 {
width: 8px; height: 8px; border-radius: 50%; background: var(--secondary);
bottom: 200px; left: 160px; opacity: 0.2;
}
.deco-wave1 {
top: 100px; right: 80px;
}
.deco-wave1 svg { width: 40px; height: 16px; }
.deco-wave2 {
bottom: 160px; left: 120px;
}
.deco-wave2 svg { width: 30px; height: 12px; }
/* Form side content */
.form-content {
width: 360px;
display: flex;
flex-direction: column;
padding-top: 32px;
}
.form-title {
font-family: var(--font-display);
font-size: var(--text-2xl);
font-weight: 700;
color: var(--fg);
margin-bottom: var(--space-8);
}
/* Input group */
.input-group {
position: relative;
margin-bottom: var(--space-4);
}
.input-group .input-icon {
position: absolute;
left: 16px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
color: var(--muted);
pointer-events: none;
display: flex;
align-items: center;
justify-content: center;
}
.input-group input {
width: 100%;
height: 50px;
padding: 0 16px 0 46px;
border: 1.5px solid var(--border);
border-radius: var(--radius-pill);
font-family: var(--font-body);
font-size: var(--text-base);
color: var(--fg);
background: var(--surface);
transition: border-color var(--motion-fast) var(--ease-standard);
}
.input-group input::placeholder {
color: var(--meta);
}
.input-group input:focus {
outline: none;
border-color: var(--accent);
box-shadow: 0 0 0 3px var(--shadow-input-focus);
}
/* Verification code */
.input-group.has-action input {
padding-right: 120px;
}
.input-group .input-action {
position: absolute;
right: 6px;
top: 50%;
transform: translateY(-50%);
padding: 8px 14px;
background: none;
border: none;
font-family: var(--font-body);
font-size: var(--text-sm);
font-weight: 600;
color: var(--accent);
cursor: pointer;
min-height: 38px;
border-radius: var(--radius-pill);
transition: background var(--motion-fast);
}
.input-group .input-action:hover {
background: var(--surface-warm);
}
/* Password toggle */
.input-group.has-toggle input {
padding-right: 50px;
}
.input-group .toggle-password {
position: absolute;
right: 14px;
top: 50%;
transform: translateY(-50%);
width: 24px;
height: 24px;
background: none;
border: none;
color: var(--muted);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
min-height: 36px;
min-width: 36px;
border-radius: 50%;
}
.input-group .toggle-password:hover { color: var(--fg); }
.input-group .toggle-password svg { width: 20px; height: 20px; }
/* Agreement */
.agreement {
display: flex;
align-items: flex-start;
gap: var(--space-2);
margin-bottom: var(--space-4);
font-size: var(--text-sm);
color: var(--muted);
line-height: 1.4;
}
.agreement input[type="checkbox"] {
width: 18px; height: 18px;
accent-color: var(--accent);
margin-top: 2px;
flex-shrink: 0;
cursor: pointer;
}
.agreement a {
color: var(--accent);
text-decoration: none;
font-weight: 500;
}
.agreement a:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
border-radius: 2px;
}
/* Submit button */
.btn-login {
width: 100%;
min-height: 50px;
border: none;
border-radius: var(--radius-pill);
background: var(--accent);
color: var(--bg);
font-family: var(--font-display);
font-size: 18px;
font-weight: 700;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
margin-bottom: var(--space-5);
}
.btn-login:hover {
background: var(--accent-hover);
transform: translateY(-1px);
box-shadow: 0 4px 16px var(--shadow-accent-hover);
}
.btn-login:active {
background: var(--accent-active);
transform: scale(0.98);
}
/* Divider */
.divider {
display: flex;
align-items: center;
gap: var(--space-4);
margin-bottom: var(--space-5);
color: var(--meta);
font-size: var(--text-sm);
}
.divider::before,
.divider::after {
content: '';
flex: 1;
height: 1px;
background: var(--border);
}
/* Social buttons */
.social-row {
display: flex;
justify-content: center;
gap: var(--space-5);
margin-bottom: var(--space-6);
}
.social-btn {
width: 56px;
height: 56px;
border-radius: 50%;
border: 1.5px solid var(--border);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--motion-fast) var(--ease-standard);
background: var(--surface);
}
.social-btn:hover {
transform: translateY(-2px);
box-shadow: var(--elev-soft);
}
.social-btn:active { transform: scale(0.95); }
.social-btn svg { width: 28px; height: 28px; }
.social-btn.wechat { background: #07C160; border-color: #07C160; }
.social-btn.wechat:hover { background: #06AD56; border-color: #06AD56; }
.social-btn.apple { background: #1D1D1F; border-color: #1D1D1F; }
.social-btn.apple:hover { background: #333; border-color: #333; }
.social-btn.google { background: var(--surface); }
/* Bottom link */
.bottom-link {
text-align: center;
font-size: var(--text-sm);
color: var(--muted);
}
.bottom-link a {
color: var(--accent);
text-decoration: none;
font-weight: 600;
cursor: pointer;
background: none;
border: none;
font-size: inherit;
font-family: inherit;
}
.bottom-link a:hover { text-decoration: underline; }
/* State toggling */
.register-fields { display: none; }
.is-register .register-fields { display: block; }
.is-register .login-only { display: none; }
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
/* Animations */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(12px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(-8px); }
}
.anim-fade { animation: fadeIn 0.5s var(--ease-standard) both; }
.anim-float { animation: float 6s ease-in-out infinite; }
</style>
</head>
<body>
<!-- Left: Brand side (60%) -->
<div class="brand-side">
<!-- Decorative elements -->
<div class="deco deco-circle1 anim-float" aria-hidden="true" style="animation-delay: 0s"></div>
<div class="deco deco-circle2 anim-float" aria-hidden="true" style="animation-delay: 2s"></div>
<div class="deco deco-circle3 anim-float" aria-hidden="true" style="animation-delay: 1s"></div>
<div class="deco deco-dot1" aria-hidden="true"></div>
<div class="deco deco-dot2" aria-hidden="true"></div>
<div class="deco deco-wave1" aria-hidden="true">
<svg viewBox="0 0 40 16" fill="none" stroke="var(--accent)" stroke-width="2" stroke-linecap="round">
<path d="M2 10 Q10 2, 20 10 Q30 18, 38 10"/>
</svg>
</div>
<div class="deco deco-wave2" aria-hidden="true">
<svg viewBox="0 0 30 12" fill="none" stroke="var(--secondary)" stroke-width="2" stroke-linecap="round">
<path d="M2 8 Q8 2, 15 8 Q22 14, 28 8"/>
</svg>
</div>
<!-- Brand content -->
<div class="brand-content">
<div class="logo-wrap anim-fade" aria-hidden="true">
<div class="logo-notebook"></div>
<div class="logo-spine"></div>
<div class="logo-heart"></div>
</div>
<div class="brand-title anim-fade" style="animation-delay:0.1s">暖记</div>
<div class="brand-tagline anim-fade" style="animation-delay:0.15s">用温暖记录每一天</div>
<!-- Feature cards -->
<div class="feature-cards anim-fade" style="animation-delay:0.25s">
<div class="feature-card">
<div class="feature-icon" aria-hidden="true">📝</div>
<div class="feature-title">记录每一天</div>
<div class="feature-desc">用文字、贴纸和照片记录生活中的温暖瞬间</div>
</div>
<div class="feature-card">
<div class="feature-icon" aria-hidden="true">🎨</div>
<div class="feature-title">用贴纸装饰</div>
<div class="feature-desc">丰富的手绘贴纸让你的日记更加生动有趣</div>
</div>
<div class="feature-card">
<div class="feature-icon" aria-hidden="true">💭</div>
<div class="feature-title">追踪你的心情</div>
<div class="feature-desc">记录并可视化心情变化,更好地了解自己</div>
</div>
</div>
</div>
</div>
<!-- Right: Form side (40%) -->
<div class="form-side">
<!-- macOS status bar -->
<div class="statusbar" aria-hidden="true">
<div class="traffic-lights">
<div class="dot" style="background:#FF5F57"></div>
<div class="dot" style="background:#FEBC2E"></div>
<div class="dot" style="background:#28C840"></div>
</div>
<span>暖记 Warm Notes</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<div class="form-content" id="formArea">
<h1 class="form-title anim-fade" style="animation-delay:0.2s" id="formTitle">欢迎回来</h1>
<form id="loginForm" autocomplete="on" novalidate>
<!-- Register: nickname -->
<div class="register-fields anim-fade">
<div class="input-group">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<circle cx="10" cy="7" r="4"/><path d="M3 18c0-3.3 3.1-6 7-6s7 2.7 7 6"/>
</svg>
</span>
<input type="text" id="nickname" name="nickname" placeholder="请输入昵称" autocomplete="nickname" aria-label="昵称">
</div>
</div>
<!-- Phone -->
<div class="input-group anim-fade" style="animation-delay:0.25s">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="5" y="2" width="10" height="16" rx="2"/><line x1="8" y1="15" x2="12" y2="15"/>
</svg>
</span>
<input type="tel" id="phone" name="phone" placeholder="请输入手机号" autocomplete="tel" pattern="[0-9]*" aria-label="手机号">
</div>
<!-- Register: password -->
<div class="register-fields anim-fade">
<div class="input-group has-toggle">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="3" y="9" width="14" height="9" rx="2"/><path d="M6 9V6a4 4 0 018 0v3"/>
</svg>
</span>
<input type="password" id="regPassword" name="password" placeholder="请输入密码" autocomplete="new-password" aria-label="密码">
<button type="button" class="toggle-password" aria-label="显示密码" onclick="togglePwd('regPassword', this)">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>
</svg>
</button>
</div>
</div>
<!-- Verification code -->
<div class="input-group has-action anim-fade" style="animation-delay:0.3s">
<span class="input-icon" aria-hidden="true">
<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
<rect x="2" y="4" width="16" height="12" rx="2"/><path d="M6 8v4M10 7v6M14 8v4"/>
</svg>
</span>
<input type="tel" id="code" name="code" placeholder="请输入验证码" autocomplete="one-time-code" pattern="[0-9]*" aria-label="验证码">
<button type="button" class="input-action" aria-label="获取验证码" id="getCodeBtn" onclick="sendCode()">获取验证码</button>
</div>
<!-- Register: agreement -->
<div class="register-fields anim-fade">
<label class="agreement">
<input type="checkbox" id="agreement" aria-label="同意用户协议">
<span>我已阅读并同意<a href="#" onclick="return false">《用户协议》</a><a href="#" onclick="return false">《隐私政策》</a></span>
</label>
</div>
<!-- Submit -->
<button type="submit" class="btn-login anim-fade" style="animation-delay:0.35s" id="submitBtn" aria-label="登录">登录</button>
</form>
<!-- Divider -->
<div class="divider anim-fade" style="animation-delay:0.4s">其他登录方式</div>
<!-- Social buttons -->
<div class="social-row anim-fade" style="animation-delay:0.45s">
<button type="button" class="social-btn wechat" aria-label="微信登录">
<svg viewBox="0 0 28 28" fill="none">
<path d="M19.1 12.5c-.2-3.3-3.2-5.9-6.8-5.9-3.8 0-6.9 2.8-6.9 6.3 0 1.8.9 3.4 2.3 4.5l-.6 1.8 2.1-1.1c.7.2 1.5.3 2.3.3h.4c-.1-.4-.2-.8-.2-1.2.1-2.6 2.7-4.7 5.9-4.7h.2c.1-.1.2-.1.3 0z" fill="#FFF"/>
<path d="M11.6 11.5c-.5 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.5 1-1 1zM14.8 10.5c-.5 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.5-1-1-1z" fill="#07C160"/>
<path d="M25.5 16.8c0-2.9-2.9-5.3-6.3-5.3s-6.3 2.4-6.3 5.3 2.9 5.3 6.3 5.3c.7 0 1.4-.1 2-.3l1.7.9-.5-1.5c1.3-1 2.1-2.5 2.1-4.1 0 .1 0-.1 0-.3zm-8.6-1c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8zm4.6 0c-.4 0-.8-.3-.8-.8s.3-.8.8-.8.8.3.8.8-.4.8-.8.8z" fill="#FFF"/>
</svg>
</button>
<button type="button" class="social-btn apple" aria-label="Apple登录">
<svg viewBox="0 0 28 28" fill="#FFF">
<path d="M20.2 14.3c0-2 1.2-3.1 1.3-3.2-0.7-1-1.8-1.6-3-1.6-1.3 0-2 .8-2.7.8-.7 0-1.4-.8-2.5-.8-1.7 0-3.5 1.4-3.5 4.1 0 1.6.6 3.3 1.4 4.5.7 1 1.4 1.8 2.3 1.8.9 0 1.3-.7 2.5-.7 1.2 0 1.5.7 2.5.7.9 0 1.6-.8 2.2-1.7.4-.6.7-1.2.9-1.9-2-.8-2.4-3.8-.4-5zm-1.8-3.3c.5-.6.9-1.4.8-2.2-.8 0-1.8.5-2.3 1.2-.5.6-.9 1.4-.8 2.2.8 0 1.7-.5 2.3-1.2z"/>
</svg>
</button>
<button type="button" class="social-btn google" aria-label="Google登录">
<svg viewBox="0 0 28 28">
<path d="M14 11.5v5.2h7.3c-.3 1.7-1.3 3.1-2.7 4.1l4.4 3.4c2.6-2.4 4-5.9 4-10.1 0-1-.1-1.9-.3-2.8H14z" fill="#4285F4"/>
<path d="M6.3 16.4c-.4-1-.6-2.2-.6-3.4s.2-2.3.6-3.4L1.9 6.2C.7 8.5 0 11.2 0 14s.7 5.5 1.9 7.8l4.4-3.4z" fill="#FBBC05"/>
<path d="M14 28c3.7 0 6.8-1.2 9.1-3.3l-4.4-3.4c-1.2.8-2.8 1.3-4.7 1.3-3.6 0-6.7-2.4-7.8-5.7l-4.4 3.4C4.2 24.7 8.7 28 14 28z" fill="#34A853"/>
<path d="M14 5.6c2 0 3.9.7 5.3 2l4-4C20.8 1.2 17.7 0 14 0 8.7 0 4.2 3.3 2.1 8.1l4.4 3.4c1.1-3.3 4.2-5.9 7.5-5.9z" fill="#EA4335"/>
</svg>
</button>
</div>
<!-- Bottom link -->
<div class="bottom-link anim-fade" style="animation-delay:0.5s">
<span class="login-only">还没有账号?</span>
<a href="#" id="toggleLink" role="button" aria-label="切换到注册">立即注册</a>
</div>
</div>
</div>
<script>
(function() {
var isRegister = false;
var formArea = document.getElementById('formArea');
var formTitle = document.getElementById('formTitle');
var submitBtn = document.getElementById('submitBtn');
var toggleLink = document.getElementById('toggleLink');
var phoneInput = document.getElementById('phone');
phoneInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
var codeInput = document.getElementById('code');
codeInput.addEventListener('input', function() {
this.value = this.value.replace(/[^0-9]/g, '');
});
toggleLink.addEventListener('click', function(e) {
e.preventDefault();
isRegister = !isRegister;
if (isRegister) {
formArea.classList.add('is-register');
formTitle.textContent = '创建账号';
submitBtn.textContent = '注册';
submitBtn.setAttribute('aria-label', '注册');
toggleLink.textContent = '立即登录';
toggleLink.setAttribute('aria-label', '切换到登录');
toggleLink.previousElementSibling.textContent = '已有账号?';
} else {
formArea.classList.remove('is-register');
formTitle.textContent = '欢迎回来';
submitBtn.textContent = '登录';
submitBtn.setAttribute('aria-label', '登录');
toggleLink.textContent = '立即注册';
toggleLink.setAttribute('aria-label', '切换到注册');
toggleLink.previousElementSibling.textContent = '还没有账号?';
}
});
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
});
})();
function togglePwd(inputId, btn) {
var input = document.getElementById(inputId);
if (input.type === 'password') {
input.type = 'text';
btn.setAttribute('aria-label', '隐藏密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>';
} else {
input.type = 'password';
btn.setAttribute('aria-label', '显示密码');
btn.innerHTML = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>';
}
}
function sendCode() {
var btn = document.getElementById('getCodeBtn');
var seconds = 60;
btn.disabled = true;
btn.style.opacity = '0.6';
btn.textContent = seconds + 's';
var timer = setInterval(function() {
seconds--;
if (seconds <= 0) {
clearInterval(timer);
btn.disabled = false;
btn.style.opacity = '1';
btn.textContent = '获取验证码';
} else {
btn.textContent = seconds + 's';
}
}, 1000);
}
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>