Files
drawlogo/works/devdoc/login-preview.html
T
sgp 12f8b65e1c feat(works): 新增成品「开发文档中心 · 甄房」
- 回收 ZhenOS-SH/ruoyi-ui public/devdoc 静态站(16 文件 / 3.69 MB)到 works/devdoc
- 目录页 5 分类 21 条文档 + 10 个子页(业务全流程流程图 mermaid / 菜单图标选型 / 头像素材规范等)
- works.js 追加索引(文档类),works.html 版本 bump
2026-11-15 22:48:48 +08:00

427 lines
19 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>登录页动效方案预览 · 甄房</title>
<style>
:root {
--brand: #0070f2;
--brand-bright: #2f72ff;
--ink: #1f2329;
--ink-2: #5c6670;
--line: #e6e9ee;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background: #0f1620;
color: #e8eef7;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
"Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}
/* ---------- 工具栏 ---------- */
.toolbar {
position: sticky; top: 0; z-index: 99;
display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
padding: 12px 18px;
background: rgba(13, 20, 30, .92);
border-bottom: 1px solid rgba(255,255,255,.08);
backdrop-filter: blur(8px);
}
.toolbar h1 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.toolbar .sub { font-size: 12px; color: #7f8ea3; margin-right: 8px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
padding: 6px 13px; border-radius: 999px; cursor: pointer; font-size: 12.5px;
color: #aab7c7; background: rgba(255,255,255,.06); border: 1px solid transparent;
transition: .16s;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.12); }
.tab.active { color: #fff; background: var(--brand); border-color: rgba(255,255,255,.2); }
/* ---------- 舞台 ---------- */
main { padding: 18px; }
.stage {
position: relative;
height: calc(100vh - 86px);
min-height: 620px;
border-radius: 16px;
overflow: hidden;
border: 1px solid rgba(255,255,255,.09);
display: none;
isolation: isolate;
}
.stage.active { display: block; }
/* ---------- 登录卡片(所有方案共用结构) ---------- */
.login-wrap {
position: relative; z-index: 5;
height: 100%;
display: flex; align-items: center; justify-content: center;
padding: 28px;
}
.login-card {
width: min(940px, 100%);
min-height: 480px;
display: grid;
grid-template-columns: 1.05fr .95fr;
border-radius: 18px;
overflow: hidden;
background: rgba(255,255,255,.97);
box-shadow: 0 30px 80px rgba(0, 18, 42, .38);
}
.brand-side {
position: relative;
padding: 46px 42px;
color: #fff;
background: linear-gradient(150deg, #0b2b56 0%, #0f4c8f 55%, #0070f2 100%);
display: flex; flex-direction: column; justify-content: center;
overflow: hidden;
}
.brand-side::after {
content: ""; position: absolute; right: -60px; bottom: -80px;
width: 260px; height: 260px; border-radius: 50%;
background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
}
.logo-badge {
width: 46px; height: 46px; border-radius: 13px;
display: flex; align-items: center; justify-content: center;
font-size: 22px; font-weight: 700; color: #0b2b56;
background: linear-gradient(145deg, #fff, #d7e7ff);
box-shadow: 0 8px 22px rgba(0,0,0,.18);
}
.brand-side h1 { margin: 18px 0 6px; font-size: 30px; letter-spacing: 2px; }
.brand-side .slogan { margin: 0; font-size: 13.5px; color: rgba(255,255,255,.82); letter-spacing: 1px; }
.brand-points { margin: 30px 0 0; padding: 0; list-style: none; }
.brand-points li {
display: flex; align-items: center; gap: 9px;
margin: 11px 0; font-size: 13px; color: rgba(255,255,255,.9);
}
.brand-points i {
width: 17px; height: 17px; border-radius: 50%;
background: rgba(255,255,255,.18); display: inline-flex;
align-items: center; justify-content: center; font-style: normal; font-size: 10px;
}
.form-side { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.form-side h2 { margin: 0 0 6px; font-size: 22px; color: var(--ink); }
.form-side .tip { margin: 0 0 26px; font-size: 12.5px; color: #8a939e; }
.field {
height: 44px; border: 1px solid var(--line); border-radius: 9px;
display: flex; align-items: center; padding: 0 14px; margin-bottom: 14px;
color: #98a2b0; font-size: 13px; background: #fbfcfe;
}
.field.focus { border-color: #9cc2ff; background: #fff; box-shadow: 0 0 0 3px rgba(0,112,242,.08); }
.form-row { display: flex; justify-content: space-between; font-size: 12.5px; color: #7d8794; margin: 2px 0 20px; }
.form-row a { color: var(--brand); text-decoration: none; }
.login-btn {
height: 46px; border-radius: 23px; border: 0; cursor: pointer;
color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 3px;
background: linear-gradient(90deg, #0070f2, #2f72ff);
box-shadow: 0 10px 24px rgba(0,112,242,.28);
}
.login-btn:hover { filter: brightness(1.04); }
.form-foot { margin-top: 18px; text-align: center; font-size: 11.5px; color: #a3adb9; }
@media (max-width: 860px) {
.login-card { grid-template-columns: 1fr; min-height: auto; }
.brand-side { padding: 30px 26px; }
.brand-points { display: none; }
.form-side { padding: 28px 24px 34px; }
.stage { height: auto; min-height: 0; }
}
/* ================= 方案 1:星海微光 ================= */
.stage[data-theme="1"] { background: radial-gradient(120% 120% at 15% 10%, #12325c 0%, #0a1728 45%, #060d17 100%); }
.t1-grid {
position: absolute; inset: 0;
background-image: linear-gradient(rgba(120,180,255,.07) 1px, transparent 1px),
linear-gradient(90deg, rgba(120,180,255,.07) 1px, transparent 1px);
background-size: 56px 56px;
mask-image: radial-gradient(70% 70% at 30% 20%, #000 30%, transparent 100%);
}
.t1-dots { position: absolute; inset: 0; }
.t1-dots span {
position: absolute; width: 3px; height: 3px; border-radius: 50%;
background: #bcd8ff; box-shadow: 0 0 8px 2px rgba(150,200,255,.7);
animation: twinkle 4.5s ease-in-out infinite;
}
.t1-meteor {
position: absolute; top: -10%; left: 62%; width: 2px; height: 140px;
background: linear-gradient(180deg, transparent, rgba(190,220,255,.9));
transform: rotate(28deg); filter: drop-shadow(0 0 6px rgba(160,210,255,.9));
animation: meteor 9s linear infinite;
}
.t1-glow {
position: absolute; width: 520px; height: 520px; left: -140px; top: -120px;
background: radial-gradient(circle, rgba(0,112,242,.35), transparent 65%);
filter: blur(6px); animation: breathe 9s ease-in-out infinite;
}
@keyframes twinkle { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes meteor { 0% { transform: translate(0,0) rotate(28deg); opacity: 0; } 12% { opacity: 1; } 55% { opacity: 0; } 100% { transform: translate(-460px,620px) rotate(28deg); opacity: 0; } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }
/* ================= 方案 2:品牌渐变 + 城市剪影 ================= */
.stage[data-theme="2"] { background: linear-gradient(135deg, #eaf2ff 0%, #dbe8fb 48%, #cfe0f8 100%); }
.t2-sun {
position: absolute; right: 12%; top: 12%; width: 320px; height: 320px; border-radius: 50%;
background: radial-gradient(circle, rgba(0,112,242,.22), transparent 68%);
filter: blur(10px); animation: t2float 10s ease-in-out infinite;
}
.t2-skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; opacity: .9; }
.t2-skyline svg { width: 100%; height: 100%; }
.t2-cloud {
position: absolute; height: 60px; border-radius: 60px; background: rgba(255,255,255,.7);
filter: blur(2px); animation: t2drift 26s linear infinite;
}
.t2-cloud.c1 { width: 180px; top: 18%; left: -200px; }
.t2-cloud.c2 { width: 120px; top: 30%; left: -140px; animation-duration: 34s; animation-delay: -8s; }
@keyframes t2float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@keyframes t2drift { 0% { transform: translateX(0); } 100% { transform: translateX(140vw); } }
/* ================= 方案 3:极简渐变 + 光斑 ================= */
.stage[data-theme="3"] { background: linear-gradient(160deg, #f5f8ff 0%, #eaf1fb 60%, #e2ecfb 100%); }
.t3-blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.t3-blob.b1 { width: 460px; height: 460px; background: #8fb8ff; left: -120px; top: -140px; animation: t3move1 16s ease-in-out infinite; }
.t3-blob.b2 { width: 380px; height: 380px; background: #b7d2ff; right: -100px; bottom: -120px; animation: t3move2 20s ease-in-out infinite; }
.t3-blob.b3 { width: 260px; height: 260px; background: #cfe2ff; right: 28%; top: -80px; animation: t3move1 24s ease-in-out infinite reverse; }
@keyframes t3move1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(50px,36px) scale(1.12); } }
@keyframes t3move2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-46px,-30px) scale(1.08); } }
/* ================= 方案 4:粒子连线 ================= */
.stage[data-theme="4"] { background: linear-gradient(160deg, #071a30 0%, #0a2746 55%, #06131f 100%); }
.t4-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* ================= 方案 5:光束流动 ================= */
.stage[data-theme="5"] { background: #071827; overflow: hidden; }
.t5-base {
position: absolute; inset: 0;
background: radial-gradient(90% 90% at 20% 10%, rgba(0,112,242,.35), transparent 60%),
radial-gradient(80% 80% at 90% 90%, rgba(41,196,255,.18), transparent 60%);
}
.t5-beam {
position: absolute; top: -40%; width: 180px; height: 190%;
background: linear-gradient(90deg, transparent, rgba(120,200,255,.14), transparent);
transform: rotate(18deg);
animation: t5sweep 7s linear infinite;
}
.t5-beam.b1 { left: -20%; animation-delay: 0s; }
.t5-beam.b2 { left: 18%; width: 120px; animation-delay: -2.4s; opacity: .8; }
.t5-beam.b3 { left: 58%; width: 240px; animation-delay: -5s; opacity: .55; }
@keyframes t5sweep { 0% { transform: translateX(-30vw) rotate(18deg); } 100% { transform: translateX(120vw) rotate(18deg); } }
/* ================= 方案 6:天际线视差 ================= */
.stage[data-theme="6"] { background: linear-gradient(180deg, #0a1c33 0%, #123a63 48%, #1d5c93 100%); }
.t6-moon {
position: absolute; right: 16%; top: 12%; width: 96px; height: 96px; border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #fff, #cfe4ff 60%, #9fc4f0);
box-shadow: 0 0 50px 14px rgba(180,220,255,.28);
}
.t6-stars span {
position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #dceaff;
animation: twinkle 5s ease-in-out infinite;
}
.t6-layer { position: absolute; left: 0; right: 0; bottom: 0; }
.t6-layer svg { display: block; width: 100%; }
.t6-far { opacity: .5; animation: t6parallax 22s ease-in-out infinite; }
.t6-near { opacity: .95; animation: t6parallax 14s ease-in-out infinite reverse; }
@keyframes t6parallax { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-18px); } }
/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
.stage * { animation: none !important; }
}
</style>
</head>
<body>
<header class="toolbar">
<h1>登录页动效方案</h1>
<span class="sub">点击切换预览 · 6 套</span>
<div class="tabs" id="tabs"></div>
</header>
<main id="stages"></main>
<script>
const THEMES = [
{ id: 1, name: '星海微光', desc: '深色星空 + 细网格 + 少量流星,科技感但克制' },
{ id: 2, name: '品牌渐变 · 城市剪影', desc: '浅色品牌渐变 + 城市轮廓 + 漂浮云,稳重商务' },
{ id: 3, name: '极简光斑', desc: '浅色渐变 + 柔和光斑缓慢移动,最轻量' },
{ id: 4, name: '粒子连线', desc: 'Canvas 粒子 + 邻近连线,经典科技感' },
{ id: 5, name: '光束流动', desc: '深蓝底 + 斜向光束扫过,速度感强' },
{ id: 6, name: '夜幕天际线', desc: '夜空月亮 + 双层城市视差,沉浸感强' }
];
function loginCard(theme) {
return `
<div class="login-wrap">
<div class="login-card">
<div class="brand-side">
<div class="logo-badge">甄</div>
<h1>甄房</h1>
<p class="slogan">专业房产经纪服务平台</p>
<ul class="brand-points">
<li><i>✓</i> 房源 · 客源 · 交易全流程数字化</li>
<li><i>✓</i> 新房智联,渠道直连案场</li>
<li><i>✓</i> AI 赋能,开单更高效</li>
</ul>
</div>
<div class="form-side">
<h2>欢迎登录</h2>
<p class="tip">${theme.name} · ${theme.desc}</p>
<div class="field focus">请输入手机号</div>
<div class="field">请输入密码</div>
<div class="form-row"><span>记住账号</span><a>忘记密码?</a></div>
<button class="login-btn">登 录</button>
<div class="form-foot">登录即代表同意《用户协议》与《隐私政策》</div>
</div>
</div>
</div>`;
}
function bg(theme) {
const id = theme.id;
if (id === 1) {
const dots = Array.from({ length: 26 }, () => {
const left = (Math.random() * 100).toFixed(1);
const top = (Math.random() * 100).toFixed(1);
const delay = (Math.random() * 5).toFixed(1);
return `<span style="left:${left}%;top:${top}%;animation-delay:-${delay}s"></span>`;
}).join('');
return `<div class="t1-glow"></div><div class="t1-grid"></div><div class="t1-dots">${dots}</div><div class="t1-meteor"></div>`;
}
if (id === 2) {
return `
<div class="t2-sun"></div>
<div class="t2-cloud c1"></div><div class="t2-cloud c2"></div>
<div class="t2-skyline">
<svg viewBox="0 0 1440 380" preserveAspectRatio="none">
<defs><linearGradient id="g2" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#4d8fd6" stop-opacity=".55"/><stop offset="1" stop-color="#1f5fa8" stop-opacity=".75"/>
</linearGradient></defs>
<path fill="url(#g2)" d="M0 320h60V210h40v110h50V160h36v160h54V240h44v80h52V120h34v200h60V190h40v130h70V150h30v170h58V230h46v90h64V170h36v150h60V210h42v110h70V140h32v180h56V200h44v120h62V160h38v160h66V220h44v100h70V180h34v140h60V240h46v80h62V200h36v120h56V160h40v160h64V220h46v100h60V180h36v140h58V240h44v80h62V200h38v120h56V170h40v150h60V210h44v110h70V180h34v140h58V240h46v80h62V200h36v120h50v40H0z"/>
</svg>
</div>`;
}
if (id === 3) return `<div class="t3-blob b1"></div><div class="t3-blob b2"></div><div class="t3-blob b3"></div>`;
if (id === 4) return `<canvas class="t4-canvas" data-particles></canvas>`;
if (id === 5) return `<div class="t5-base"></div><div class="t5-beam b1"></div><div class="t5-beam b2"></div><div class="t5-beam b3"></div>`;
if (id === 6) {
const stars = Array.from({ length: 34 }, () => {
const left = (Math.random() * 100).toFixed(1);
const top = (Math.random() * 62).toFixed(1);
const delay = (Math.random() * 6).toFixed(1);
return `<span style="left:${left}%;top:${top}%;animation-delay:-${delay}s"></span>`;
}).join('');
return `
<div class="t6-moon"></div>
<div class="t6-stars">${stars}</div>
<div class="t6-layer t6-far">
<svg viewBox="0 0 1440 260" preserveAspectRatio="none" height="260">
<path fill="#12395c" d="M0 220h80V150h50v70h70V120h40v100h60v-80h44v80h70V100h36v120h60v-70h46v70h64V140h40v80h70v-50h44v50h60V110h38v110h66v-70h46v70h62V150h40v70h70v-40h44v40h60V120h38v100h66v-60h46v60h62V160h40v60h70v-40h44v40h60V130h38v90h70v-50h44v50z"/>
</svg>
</div>
<div class="t6-layer t6-near">
<svg viewBox="0 0 1440 200" preserveAspectRatio="none" height="200">
<path fill="#071a2c" d="M0 190h90V120h60v70h80V90h46v100h70v-60h50v60h80V110h40v80h70v-50h52v50h80V100h44v90h70v-60h50v60h80V120h42v70h70v-40h54v40h80V90h44v100h70v-50h50v50h80V110h42v80h70v-40h54v40h80V120h46v70h70v-40h50v40h70v30H0z"/>
</svg>
</div>`;
}
return '';
}
const tabs = document.getElementById('tabs');
const stages = document.getElementById('stages');
THEMES.forEach((theme, index) => {
const tab = document.createElement('div');
tab.className = 'tab' + (index === 0 ? ' active' : '');
tab.textContent = `方案 ${theme.id} · ${theme.name}`;
tab.dataset.target = `stage-${theme.id}`;
tabs.appendChild(tab);
const stage = document.createElement('section');
stage.className = 'stage' + (index === 0 ? ' active' : '');
stage.id = `stage-${theme.id}`;
stage.dataset.theme = theme.id;
stage.innerHTML = bg(theme) + loginCard(theme);
stages.appendChild(stage);
});
tabs.addEventListener('click', e => {
const tab = e.target.closest('.tab');
if (!tab) return;
Array.prototype.forEach.call(tabs.children, t => t.classList.toggle('active', t === tab));
Array.prototype.forEach.call(stages.children, s => s.classList.toggle('active', s.id === tab.dataset.target));
startCanvas();
});
/* ---------- 方案 4:粒子连线(仅在激活时运行) ---------- */
let rafId = null;
function stopCanvas() {
if (rafId) { cancelAnimationFrame(rafId); rafId = null; }
}
function startCanvas() {
stopCanvas();
const stage = document.querySelector('.stage.active');
if (!stage || stage.dataset.theme !== '4') return;
const canvas = stage.querySelector('[data-particles]');
if (!canvas) return;
const ctx = canvas.getContext('2d');
let width = 0, height = 0, particles = [];
const DPR = Math.min(window.devicePixelRatio || 1, 2);
const COUNT = 46;
function resize() {
width = canvas.clientWidth;
height = canvas.clientHeight;
canvas.width = width * DPR;
canvas.height = height * DPR;
ctx.setTransform(DPR, 0, 0, DPR, 0, 0);
}
function init() {
particles = Array.from({ length: COUNT }, () => ({
x: Math.random() * width,
y: Math.random() * height,
vx: (Math.random() - 0.5) * 0.32,
vy: (Math.random() - 0.5) * 0.32,
r: Math.random() * 1.6 + 0.8
}));
}
function draw() {
ctx.clearRect(0, 0, width, height);
particles.forEach(p => {
p.x += p.vx; p.y += p.vy;
if (p.x < 0 || p.x > width) p.vx *= -1;
if (p.y < 0 || p.y > height) p.vy *= -1;
ctx.beginPath();
ctx.arc(p.x, p.y, p.r, 0, Math.PI * 2);
ctx.fillStyle = 'rgba(160, 210, 255, .9)';
ctx.fill();
});
for (let i = 0; i < particles.length; i++) {
for (let j = i + 1; j < particles.length; j++) {
const a = particles[i], b = particles[j];
const dx = a.x - b.x, dy = a.y - b.y;
const dist = Math.sqrt(dx * dx + dy * dy);
if (dist < 128) {
ctx.beginPath();
ctx.moveTo(a.x, a.y);
ctx.lineTo(b.x, b.y);
ctx.strokeStyle = `rgba(90, 160, 240, ${(1 - dist / 128) * 0.34})`;
ctx.lineWidth = 0.7;
ctx.stroke();
}
}
}
rafId = requestAnimationFrame(draw);
}
resize(); init(); draw();
window.addEventListener('resize', () => { resize(); init(); }, { passive: true });
}
startCanvas();
</script>
</body>
</html>