146 lines
8.2 KiB
HTML
146 lines
8.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
<title>可乐 - 底部弹出 忘记密码</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
*,*::before,*::after{margin:0;padding:0;box-sizing:border-box}
|
|
body{font-family:'Noto Sans SC',system-ui,sans-serif;height:100vh;overflow:hidden;background:#0a0a0f}
|
|
.hero-bg{position:absolute;inset:0;background:linear-gradient(170deg,#1a0505 0%,#2d0a0a 30%,#0a0a1a 70%,#050510 100%)}
|
|
.hero-bg::after{content:'';position:absolute;bottom:0;left:0;right:0;height:50%;background:linear-gradient(to top,rgba(0,0,0,0.95),transparent)}
|
|
.hero-content{position:absolute;top:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center;height:45vh;padding:40px 30px;z-index:1}
|
|
.hero-icon{font-size:80px;margin-bottom:20px;filter:drop-shadow(0 4px 24px rgba(239,68,68,0.4));animation:float 3s ease-in-out infinite}
|
|
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}
|
|
.hero-content h1{font-size:30px;font-weight:700;color:#fff;text-align:center;margin-bottom:8px}
|
|
.hero-content p{font-size:14px;color:rgba(255,255,255,0.4);text-align:center}
|
|
/* Bottom sheet */
|
|
.sheet{position:fixed;bottom:0;left:0;right:0;z-index:10;background:#16162a;border-radius:28px 28px 0 0;padding:12px 28px 44px;box-shadow:0 -10px 40px rgba(0,0,0,0.5);animation:slideUp .5s cubic-bezier(.22,1,.36,1) both}
|
|
@keyframes slideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
|
|
.handle{width:36px;height:4px;border-radius:2px;background:rgba(255,255,255,0.12);margin:0 auto 18px}
|
|
/* Tabs */
|
|
.tabs{display:flex;margin-bottom:20px;background:rgba(255,255,255,0.05);border-radius:12px;padding:4px}
|
|
.tab{flex:1;padding:11px 0;text-align:center;font-size:13px;font-weight:600;color:rgba(255,255,255,0.35);background:none;border:none;cursor:pointer;border-radius:9px;transition:all .25s;font-family:inherit}
|
|
.tab.active{background:rgba(255,255,255,0.08);color:#fff}
|
|
/* Forms */
|
|
.form{display:none}
|
|
.form.active{display:block;animation:fadeUp .3s ease}
|
|
@keyframes fadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
|
|
.field{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:14px;background:rgba(255,255,255,0.04);border:1.5px solid rgba(255,255,255,0.06);margin-bottom:14px;transition:all .2s}
|
|
.field:focus-within{border-color:rgba(239,68,68,0.5);background:rgba(239,68,68,0.03)}
|
|
.field .icon{font-size:18px;flex-shrink:0;opacity:0.5}
|
|
.field input{flex:1;background:none;border:none;outline:none;font-size:15px;color:#fff;font-family:inherit}
|
|
.field input::placeholder{color:rgba(255,255,255,0.2)}
|
|
.field .toggle-pwd{background:none;border:none;color:rgba(255,255,255,0.25);cursor:pointer;font-size:16px;padding:2px}
|
|
.code-row{display:flex;gap:10px;margin-bottom:14px}
|
|
.code-row .field{flex:1;margin-bottom:0}
|
|
.code-btn{padding:10px 16px;border-radius:12px;border:none;background:linear-gradient(135deg,#ef4444,#f97316);color:#fff;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap;font-family:inherit;transition:all .2s;flex-shrink:0}
|
|
.code-btn:disabled{opacity:.35;cursor:not-allowed}
|
|
.btn-primary{width:100%;padding:15px;border:none;border-radius:14px;background:linear-gradient(135deg,#ef4444 0%,#f97316 100%);color:#fff;font-size:16px;font-weight:700;cursor:pointer;font-family:inherit;box-shadow:0 6px 20px rgba(239,68,68,0.3);transition:all .25s;margin-top:4px}
|
|
.btn-primary:active{transform:scale(.98)}
|
|
.btn-primary:disabled{opacity:.45;cursor:not-allowed}
|
|
.email-badge{display:flex;align-items:center;gap:8px;padding:11px 16px;border-radius:12px;background:rgba(239,68,68,0.06);border:1px solid rgba(239,68,68,0.15);margin-bottom:16px;font-size:12px;color:rgba(255,255,255,0.6);font-weight:500}
|
|
.pwd-tips{padding:12px 14px;border-radius:10px;background:rgba(16,185,129,0.05);border:1px solid rgba(16,185,129,0.12);margin-top:12px}
|
|
.pwd-tips p{font-size:11px;color:rgba(255,255,255,0.35);line-height:2}
|
|
.pwd-tips span{color:#34d399;font-weight:600}
|
|
.form-title{font-size:18px;font-weight:700;color:#fff;margin-bottom:4px}
|
|
.form-desc{font-size:12px;color:rgba(255,255,255,0.35);margin-bottom:18px}
|
|
/* Success */
|
|
.success-panel{display:none;text-align:center;padding:24px 0}
|
|
.success-panel.active{display:block;animation:fadeUp .4s ease}
|
|
.success-panel .big{font-size:72px;margin-bottom:16px}
|
|
.success-panel h2{font-size:20px;font-weight:700;color:#fff;margin-bottom:8px}
|
|
.success-panel p{font-size:13px;color:rgba(255,255,255,0.4);margin-bottom:24px}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="hero-bg"></div>
|
|
<div class="hero-content">
|
|
<div class="hero-icon">🔑</div>
|
|
<h1>找回密码</h1>
|
|
<p>别担心,几步就能重置密码</p>
|
|
</div>
|
|
<div class="sheet">
|
|
<div class="handle"></div>
|
|
<div class="tabs">
|
|
<button class="tab active" onclick="showTab(0,this)">发送验证码</button>
|
|
<button class="tab" onclick="showTab(1,this)">重置密码</button>
|
|
</div>
|
|
|
|
<!-- Tab 1: Send code -->
|
|
<div class="form active" id="tab0">
|
|
<div class="form-title">验证邮箱</div>
|
|
<div class="form-desc">输入注册时使用的邮箱地址</div>
|
|
<div class="field">
|
|
<span class="icon">✉️</span>
|
|
<input type="email" placeholder="请输入注册邮箱" id="emailInput">
|
|
</div>
|
|
<div class="code-row">
|
|
<div class="field" style="flex:1;margin-bottom:0">
|
|
<span class="icon">🛡️</span>
|
|
<input type="text" placeholder="验证码" maxlength="8">
|
|
</div>
|
|
<button class="code-btn" id="sendCodeBtn" onclick="sendCode()">发送验证码</button>
|
|
</div>
|
|
<button class="btn-primary" onclick="showTab(1)">下一步</button>
|
|
</div>
|
|
|
|
<!-- Tab 2: Reset password -->
|
|
<div class="form" id="tab1">
|
|
<div class="form-title">设置新密码</div>
|
|
<div class="form-desc">新密码至少8位,包含字母和数字</div>
|
|
<div class="email-badge" id="emailDisplay">✉️ user@example.com</div>
|
|
<div class="field">
|
|
<span class="icon">🛡️</span>
|
|
<input type="text" placeholder="验证码" maxlength="8">
|
|
</div>
|
|
<div class="field">
|
|
<span class="icon">🔒</span>
|
|
<input type="password" placeholder="新密码">
|
|
<button class="toggle-pwd" onclick="tp(this)">👁️</button>
|
|
</div>
|
|
<div class="field">
|
|
<span class="icon">🔒</span>
|
|
<input type="password" placeholder="确认新密码">
|
|
<button class="toggle-pwd" onclick="tp(this)">👁️</button>
|
|
</div>
|
|
<div class="pwd-tips">
|
|
<p><span>•</span> 至少8个字符</p>
|
|
<p><span>•</span> 包含字母和数字</p>
|
|
</div>
|
|
<button class="btn-primary" onclick="resetPwd()">重置密码</button>
|
|
</div>
|
|
|
|
<!-- Success panel (hidden) -->
|
|
<div class="success-panel" id="successPanel">
|
|
<div class="big">🎉</div>
|
|
<h2>密码重置成功!</h2>
|
|
<p>正在跳转到登录页...</p>
|
|
<button class="btn-primary" onclick="location.reload()">返回登录</button>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function showTab(n,el){
|
|
var em=document.getElementById('emailInput').value||'user@example.com';
|
|
document.getElementById('emailDisplay').textContent='✉️ '+em;
|
|
document.querySelectorAll('.form').forEach(function(f){f.classList.remove('active')});
|
|
document.getElementById('tab'+n).classList.add('active');
|
|
document.querySelectorAll('.tab').forEach(function(t){t.classList.remove('active')});
|
|
if(el)el.classList.add('active');else document.querySelectorAll('.tab')[n].classList.add('active');
|
|
}
|
|
function sendCode(){
|
|
var btn=document.getElementById('sendCodeBtn');var s=60;btn.disabled=true;
|
|
var iv=setInterval(function(){s--;btn.textContent=s+'s';if(s<=0){clearInterval(iv);btn.disabled=false;btn.textContent='发送验证码'}},1000);
|
|
}
|
|
function tp(btn){var inp=btn.previousElementSibling;inp.type=inp.type==='password'?'text':'password'}
|
|
function resetPwd(){
|
|
document.getElementById('tab1').classList.remove('active');
|
|
document.getElementById('successPanel').classList.add('active');
|
|
document.querySelectorAll('.tab').forEach(function(t){t.classList.remove('active')});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |