feat(static): 优化社区首页美观度与高级感

- index.html: hero 新增品牌徽章、节点树装饰 SVG、下滑提示;章节增加 eyebrow 小标题
- index.css: 主按钮渐变+扫光、卡片序号水印+图标点亮、标题渐变流光、点阵底纹、
  品牌树描绘动画、关于卡装饰、胶囊快捷链接;全部基于 theme.css 变量,深浅色自适应
- index.js: 追加滚动渐显(IntersectionObserver)与特性卡片光标光斑,与登录逻辑解耦
This commit is contained in:
qing committed 2026-08-06 17:31:40 +00:00
1 parent a4611ec737
commit ea2717c400
3 files changed
+403 -85

No files matched your search

+325 -80
View File
@@ -4,6 +4,12 @@ body {
align-items: normal; align-items: normal;
} }
/* 选中文字着色,与品牌色一致 */
::selection {
background: var(--accent-glow);
color: var(--fg);
}
@media (prefers-reduced-motion: no-preference) { @media (prefers-reduced-motion: no-preference) {
html { scroll-behavior: smooth; } html { scroll-behavior: smooth; }
} }
@@ -22,14 +28,44 @@ body {
cursor: pointer; cursor: pointer;
text-decoration: none; text-decoration: none;
line-height: 1.4; line-height: 1.4;
transition: opacity 0.15s, transform 0.1s, background 0.15s, border-color 0.15s; transition: opacity 0.15s, transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.22s;
} }
.btn:active { transform: scale(0.96); } .btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(232, 133, 58, 0.28); }
.btn-primary:hover { background: var(--accent-dark); opacity: 1; box-shadow: 0 4px 14px rgba(232, 133, 58, 0.36); } /* 主按钮:品牌渐变 + hover 上浮与扫光 */
.btn-ghost { background: var(--accent-soft); color: var(--accent-dark); } .btn-primary {
.btn-ghost:hover { border-color: var(--accent); opacity: 1; } position: relative;
.btn-lg { padding: 0.7rem 1.9rem; font-size: 1rem; border-radius: var(--radius-md); } overflow: hidden;
background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
color: #fff;
box-shadow: 0 2px 10px rgba(232, 133, 58, 0.32);
}
.btn-primary::after {
content: "";
position: absolute;
top: 0;
left: -80%;
width: 50%;
height: 100%;
background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
transform: skewX(-20deg);
transition: left 0.5s ease;
pointer-events: none;
}
.btn-primary:hover {
transform: translateY(-1px);
box-shadow: 0 6px 18px rgba(232, 133, 58, 0.4);
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:active { transform: scale(0.96); }
.btn-ghost {
background: var(--accent-soft);
color: var(--accent-dark);
border-color: var(--accent-glow);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; border-radius: 999px; letter-spacing: 0.02em; }
/* ===== 头部:悬浮毛玻璃导航(镜像 minimap/userpanel 风格) ===== */ /* ===== 头部:悬浮毛玻璃导航(镜像 minimap/userpanel 风格) ===== */
.header { .header {
@@ -44,12 +80,12 @@ body {
width: 100%; width: 100%;
max-width: 960px; max-width: 960px;
margin: 0 auto; margin: 0 auto;
padding: 0.5rem 1rem; padding: 0.55rem 1.1rem;
border-radius: var(--radius-md); border-radius: var(--radius-lg);
background: rgba(253, 246, 238, 0.72); background: rgba(253, 246, 238, 0.72);
border: 1px solid var(--border-light); border: 1px solid var(--border-light);
backdrop-filter: blur(12px); backdrop-filter: blur(16px) saturate(1.4);
-webkit-backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(16px) saturate(1.4);
box-shadow: var(--shadow-md); box-shadow: var(--shadow-md);
transition: background 0.2s, border-color 0.2s; transition: background 0.2s, border-color 0.2s;
} }
@@ -95,95 +131,180 @@ body {
white-space: nowrap; white-space: nowrap;
} }
#main-page { width: 100%; }
/* ===== Hero 首屏 ===== */ /* ===== Hero 首屏 ===== */
.hero { .hero {
position: relative; position: relative;
text-align: center; text-align: center;
padding: 6rem 1rem 5rem; padding: 4.5rem 1rem 5.5rem;
overflow: hidden;
} }
/* 点阵底纹:中心清晰、四周渐隐 */
.hero::before { .hero::before {
content: ""; content: "";
position: absolute; position: absolute;
inset: 0; inset: 0;
background: radial-gradient(ellipse 60% 50% at 50% 30%, var(--accent-glow), transparent 70%); background-image: radial-gradient(var(--border) 1.2px, transparent 1.2px);
background-size: 26px 26px;
-webkit-mask-image: radial-gradient(ellipse 70% 62% at 50% 42%, #000 25%, transparent 72%);
mask-image: radial-gradient(ellipse 70% 62% at 50% 42%, #000 25%, transparent 72%);
pointer-events: none; pointer-events: none;
} }
/* 暖色环境光晕 */
.hero::after { .hero::after {
content: ""; content: "";
position: absolute; position: absolute;
left: 50%; left: 50%;
top: 52%; top: 46%;
width: 640px; width: 680px;
height: 640px; height: 680px;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
background: radial-gradient(circle, var(--accent-glow), transparent 62%); background:
opacity: 0.5; radial-gradient(circle, var(--accent-glow), transparent 60%),
radial-gradient(ellipse 55% 40% at 50% 62%, var(--accent-soft), transparent 70%);
opacity: 0.55;
pointer-events: none; pointer-events: none;
} }
.hero > * { position: relative; z-index: 1; } .hero-inner { position: relative; z-index: 1; }
.hero-title {
font-size: clamp(2rem, 6vw, 3rem); /* 品牌装饰:节点树(低透明度衬底,不干扰阅读) */
font-weight: 800; .hero-tree {
line-height: 1.28; position: absolute;
letter-spacing: 0.02em; left: 50%;
margin-bottom: 1rem; bottom: -8px;
transform: translateX(-50%);
width: min(600px, 96%);
height: auto;
color: var(--accent);
opacity: 0.16;
pointer-events: none;
} }
@media (prefers-color-scheme: dark) {
.hero-tree { opacity: 0.2; }
}
/* eyebrow 徽章:呼吸圆点 + 胶囊 */
.hero-badge {
display: inline-flex;
align-items: center;
gap: 0.45rem;
padding: 0.35rem 0.95rem;
margin-bottom: 1.4rem;
font-size: 0.8rem;
font-weight: 600;
letter-spacing: 0.06em;
color: var(--accent-dark);
background: var(--accent-soft);
border: 1px solid var(--accent-glow);
border-radius: 999px;
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
}
.badge-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent);
flex: none;
}
.hero-title {
font-size: clamp(2.1rem, 6.5vw, 3.3rem);
font-weight: 800;
line-height: 1.26;
letter-spacing: 0.04em;
text-wrap: balance;
margin-bottom: 1.1rem;
}
/* 渐变标题字:缓慢流光 */
.accent-text { .accent-text {
background: linear-gradient(120deg, var(--accent) 20%, var(--accent-dark) 80%); background: linear-gradient(120deg, var(--accent) 15%, var(--accent-dark) 45%, var(--accent) 85%);
background-size: 220% auto;
-webkit-background-clip: text; -webkit-background-clip: text;
background-clip: text; background-clip: text;
color: transparent; color: transparent;
} }
.hero-sub { .hero-sub {
font-size: 1.08rem; font-size: 1.08rem;
letter-spacing: 0.03em;
color: var(--fg-secondary); color: var(--fg-secondary);
max-width: 30rem; max-width: 32rem;
margin: 0 auto; margin: 0 auto;
line-height: 1.7; line-height: 1.75;
} }
.hero-actions { .hero-actions {
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: 0.85rem; gap: 0.85rem;
margin-top: 2.1rem; margin-top: 2.2rem;
} }
/* ===== 特性卡片 ===== */ /* 下滑提示:浮动小箭头(窄屏隐藏) */
.scroll-hint {
position: absolute;
left: 50%;
bottom: 1.3rem;
transform: translateX(-50%);
z-index: 1;
display: flex;
color: var(--muted);
transition: color 0.2s;
}
.scroll-hint:hover { color: var(--accent); }
.scroll-hint svg { width: 22px; height: 22px; }
/* ===== 章节标题:eyebrow + 标题 + 渐变短杠 ===== */
.section-eyebrow {
text-align: center;
margin-top: 4.5rem;
font-size: 0.78rem;
font-weight: 700;
letter-spacing: 0.28em;
text-indent: 0.28em; /* 视觉居中补偿字距 */
color: var(--accent);
}
.section-title { .section-title {
text-align: center; text-align: center;
margin-top: 4rem; margin-top: 0.7rem;
font-size: 1.5rem; font-size: 1.55rem;
font-weight: 700; font-weight: 700;
letter-spacing: 0.01em; letter-spacing: 0.02em;
} }
.section-title::after { .section-title::after {
content: ""; content: "";
display: block; display: block;
width: 44px; width: 46px;
height: 3px; height: 3px;
margin: 0.6rem auto 0; margin: 0.65rem auto 0;
border-radius: 2px; border-radius: 2px;
background: var(--accent); background: linear-gradient(90deg, var(--accent), var(--accent-dark));
opacity: 0.85; opacity: 0.9;
} }
/* ===== 特性卡片:序号水印 + 光标光斑 + 图标点亮 ===== */
.features { .features {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1.1rem; gap: 1.1rem;
width: 100%; width: 100%;
max-width: 960px; max-width: 960px;
margin: 1.75rem auto 0; margin: 2rem auto 0;
counter-reset: feat;
} }
.feature-card { .feature-card {
counter-increment: feat;
position: relative; position: relative;
background: var(--card); background: var(--card);
/* 光标光斑:JS 写入 --mx/--my,缺省停在顶部中央 */
background-image: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 75%);
border: 1px solid var(--border-light); border: 1px solid var(--border-light);
border-radius: var(--radius-md); border-radius: var(--radius-lg);
padding: 1.7rem 1.4rem; padding: 1.8rem 1.5rem;
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-sm);
overflow: hidden; overflow: hidden;
transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s; transition: transform 0.22s ease, box-shadow 0.25s ease, border-color 0.25s ease;
} }
.feature-card::before { .feature-card::before {
content: ""; content: "";
@@ -194,98 +315,217 @@ body {
height: 3px; height: 3px;
background: linear-gradient(90deg, var(--accent), var(--accent-dark)); background: linear-gradient(90deg, var(--accent), var(--accent-dark));
opacity: 0; opacity: 0;
transition: opacity 0.2s; transition: opacity 0.25s;
}
/* 序号水印(编辑感装饰) */
.feature-card::after {
content: "0" counter(feat);
position: absolute;
top: 1rem;
right: 1.2rem;
font-size: 1.55rem;
font-weight: 800;
line-height: 1;
letter-spacing: 0.02em;
color: var(--border);
transition: color 0.25s;
pointer-events: none;
} }
.feature-card:hover { .feature-card:hover {
transform: translateY(-4px); transform: translateY(-5px);
border-color: var(--accent); border-color: var(--accent);
box-shadow: var(--shadow-md); box-shadow: var(--shadow-md);
} }
.feature-card:hover::before { opacity: 0.9; } .feature-card:hover::before { opacity: 0.9; }
.feature-card:hover::after { color: var(--accent-glow); }
.feature-icon { .feature-icon {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 44px; width: 46px;
height: 44px; height: 46px;
margin-bottom: 0.9rem; margin-bottom: 0.95rem;
border-radius: var(--radius-sm); border-radius: 13px;
background: linear-gradient(135deg, var(--accent-soft), rgba(232, 133, 58, 0.16)); background: linear-gradient(135deg, var(--accent-soft), rgba(232, 133, 58, 0.16));
color: var(--accent-dark); color: var(--accent-dark);
transition: transform 0.25s, background 0.25s, color 0.25s, box-shadow 0.25s;
} }
.feature-icon svg { width: 22px; height: 22px; } .feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { margin-bottom: 0.4rem; font-size: 1.05rem; } .feature-card:hover .feature-icon {
background: linear-gradient(135deg, var(--accent), var(--accent-dark));
color: #fff;
transform: translateY(-2px) scale(1.06);
box-shadow: 0 6px 14px rgba(232, 133, 58, 0.35);
}
.feature-card h3 { margin-bottom: 0.4rem; font-size: 1.05rem; letter-spacing: 0.01em; }
.feature-card p { .feature-card p {
font-size: 0.88rem; font-size: 0.88rem;
line-height: 1.7; line-height: 1.75;
color: var(--fg-secondary); color: var(--fg-secondary);
} }
/* ===== 关于本站 ===== */ /* ===== 关于本站 ===== */
.about { .about {
text-align: center; text-align: center;
padding: 1rem 1rem 3rem; padding: 1rem 1rem 3.5rem;
max-width: 760px; max-width: 780px;
margin: 0 auto; margin: 0 auto;
} }
.about .section-eyebrow, .about .section-title { margin-top: 0; }
.about .site-intro { .about .site-intro {
position: relative;
background: var(--card); background: var(--card);
border: 1px solid var(--border-light); border: 1px solid var(--border-light);
border-radius: var(--radius-md); border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm); box-shadow: var(--shadow-sm);
padding: 1.75rem 1.9rem; padding: 2rem 2.2rem;
margin-top: 2rem;
overflow: hidden;
}
/* 左侧品牌渐变条 + 右上角装饰引号 */
.about .site-intro::before {
content: "";
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 4px;
background: linear-gradient(180deg, var(--accent), var(--accent-dark));
opacity: 0.85;
}
.about .site-intro::after {
content: "”";
position: absolute;
top: -0.6rem;
right: 1.1rem;
font-family: Georgia, 'Times New Roman', serif;
font-size: 5rem;
line-height: 1;
color: var(--accent-soft);
pointer-events: none;
} }
.site-intro { .site-intro {
font-size: 0.96rem; font-size: 0.96rem;
line-height: 1.95; line-height: 1.95;
color: var(--fg-secondary); color: var(--fg-secondary);
} }
/* 快捷链接:胶囊按钮 */
.quick-links { .quick-links {
display: flex; display: flex;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: wrap;
gap: 1.5rem; gap: 0.9rem;
margin-top: 1.75rem; margin-top: 1.9rem;
} }
.quick-links a { .quick-links a {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.5rem 1.15rem;
font-size: 0.86rem; font-size: 0.86rem;
color: var(--muted); font-weight: 600;
color: var(--fg-secondary);
background: var(--card);
border: 1px solid var(--border);
border-radius: 999px;
text-decoration: none; text-decoration: none;
padding-bottom: 1px; box-shadow: var(--shadow-sm);
border-bottom: 1px solid transparent; transition: color 0.18s, border-color 0.18s, transform 0.18s, box-shadow 0.2s;
transition: color 0.15s, border-color 0.15s;
} }
.quick-links a:hover { color: var(--accent); border-bottom-color: var(--accent); } .quick-links a::after {
content: "→";
font-size: 0.85em;
transition: transform 0.18s;
}
.quick-links a:hover {
color: var(--accent);
border-color: var(--accent);
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.quick-links a:hover::after { transform: translateX(3px); }
/* ===== 入场动画 ===== */ /* ===== 入场动画(首屏元素,页面加载即播) ===== */
@keyframes fade-up { @keyframes fade-up {
from { opacity: 0; transform: translateY(12px); } from { opacity: 0; transform: translateY(14px); }
to { opacity: 1; transform: none; } to { opacity: 1; transform: none; }
} }
@media (prefers-reduced-motion: no-preference) { /* 品牌树:枝干描绘 + 节点弹出 + 整体轻摆 */
.hero > *, .feature-card, .about { animation: fade-up 0.5s ease both; } @keyframes tree-draw { to { stroke-dashoffset: 0; } }
.hero-sub { animation-delay: 0.08s; } @keyframes node-in {
.hero-actions { animation-delay: 0.16s; } from { opacity: 0; transform: scale(0); }
.feature-card:nth-child(2) { animation-delay: 0.06s; } to { opacity: 1; transform: scale(1); }
.feature-card:nth-child(3) { animation-delay: 0.12s; }
.feature-card:nth-child(4) { animation-delay: 0.18s; }
} }
@keyframes tree-sway {
0%, 100% { transform: translateX(-50%) rotate(0deg); }
50% { transform: translateX(-50%) rotate(0.7deg); }
}
@keyframes text-shine { to { background-position: 220% center; } }
@keyframes badge-pulse {
0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
50% { box-shadow: 0 0 0 5px transparent; }
}
@keyframes hint-bounce {
0%, 100% { transform: translateY(0); }
50% { transform: translateY(5px); }
}
@media (prefers-reduced-motion: no-preference) {
.hero-inner > * { animation: fade-up 0.55s ease both; }
.hero-title { animation-delay: 0.06s; }
.hero-sub { animation-delay: 0.14s; }
.hero-actions { animation-delay: 0.22s; }
.accent-text { animation: text-shine 7s linear infinite; }
.badge-dot { animation: badge-pulse 2.4s ease-in-out infinite; }
.scroll-hint svg { animation: hint-bounce 2s ease-in-out infinite; }
.hero-tree { animation: tree-sway 10s ease-in-out 2.8s infinite; }
.hero-tree path {
stroke-dasharray: 100;
stroke-dashoffset: 100;
animation: tree-draw 0.9s ease-out forwards;
}
.hero-tree path:nth-of-type(1) { animation-delay: 0.15s; }
.hero-tree path:nth-of-type(2),
.hero-tree path:nth-of-type(3) { animation-delay: 0.75s; }
.hero-tree path:nth-of-type(n+4) { animation-delay: 1.35s; }
.hero-tree circle {
opacity: 0;
transform-box: fill-box;
transform-origin: center;
animation: node-in 0.45s ease-out forwards;
}
.hero-tree circle:nth-of-type(1) { animation-delay: 0.2s; }
.hero-tree circle:nth-of-type(2) { animation-delay: 0.85s; }
.hero-tree circle:nth-of-type(3),
.hero-tree circle:nth-of-type(4) { animation-delay: 1.45s; }
.hero-tree circle:nth-of-type(n+5) { animation-delay: 2s; }
}
/* ===== 滚动渐显(JS 加 .reveal 隐藏、入场加 .reveal-in;无 JS 时天然可见) ===== */
.reveal {
opacity: 0;
transform: translateY(18px);
transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.reveal-in { opacity: 1; transform: none; }
/* ===== 响应式 ===== */ /* ===== 响应式 ===== */
/* 触屏设备:加大可点目标 */ /* 触屏设备:加大可点目标 */
@media (hover: none) and (pointer: coarse) { @media (hover: none) and (pointer: coarse) {
.btn { min-height: 44px; } .btn { min-height: 44px; }
.quick-links a { padding: 0.5rem 0.25rem; } .quick-links a { padding: 0.6rem 1.1rem; }
} }
/* 平板及以下:收敛首屏光晕与留白 */ /* 平板及以下:收敛首屏光晕与留白 */
@media (max-width: 768px) { @media (max-width: 768px) {
body { padding: 1.25rem 0.75rem; } body { padding: 1.25rem 0.75rem; }
.hero { padding: 4rem 1.25rem 3.5rem; } .hero { padding: 3.5rem 1.25rem 4rem; }
.hero::after { width: 420px; height: 420px; opacity: 0.4; } .hero::after { width: 440px; height: 440px; opacity: 0.45; }
.hero-title { letter-spacing: 0.01em; } .hero-tree { width: 130%; opacity: 0.12; }
.hero-title { letter-spacing: 0.02em; }
.features { gap: 0.9rem; } .features { gap: 0.9rem; }
.feature-card { padding: 1.4rem 1.2rem; } .feature-card { padding: 1.5rem 1.25rem; }
} }
/* 手机:全宽布局、紧凑排版 */ /* 手机:全宽布局、紧凑排版 */
@@ -302,9 +542,11 @@ body {
.right-group .btn { padding: 0.5rem 0.95rem; font-size: 0.82rem; } .right-group .btn { padding: 0.5rem 0.95rem; font-size: 0.82rem; }
#name { max-width: 72px; } #name { max-width: 72px; }
.hero { padding: 3rem 0.75rem 2.5rem; } .hero { padding: 2.75rem 0.75rem 2.5rem; }
.hero::after { width: 300px; height: 300px; opacity: 0.32; } .hero::after { width: 310px; height: 310px; opacity: 0.35; }
.hero-title { margin-bottom: 0.75rem; } .hero-tree { width: 160%; opacity: 0.1; }
.hero-badge { font-size: 0.74rem; padding: 0.3rem 0.8rem; margin-bottom: 1.1rem; }
.hero-title { margin-bottom: 0.8rem; }
.hero-sub { font-size: 0.95rem; } .hero-sub { font-size: 0.95rem; }
.hero-actions { .hero-actions {
flex-direction: column; flex-direction: column;
@@ -312,19 +554,22 @@ body {
gap: 0.65rem; gap: 0.65rem;
} }
.hero-actions .btn-lg { width: 100%; padding: 0.85rem 1.5rem; } .hero-actions .btn-lg { width: 100%; padding: 0.85rem 1.5rem; }
.scroll-hint { display: none; }
.section-title { margin-top: 2.5rem; font-size: 1.3rem; } .section-eyebrow { margin-top: 2.75rem; }
.section-title { font-size: 1.3rem; }
.features { margin-top: 1.25rem; grid-template-columns: 1fr; } .features { margin-top: 1.25rem; grid-template-columns: 1fr; }
.feature-card:hover { transform: none; } /* 触屏取消悬浮位移 */ .feature-card:hover { transform: none; } /* 触屏取消悬浮位移 */
.about { padding: 0.5rem 0.5rem 2.5rem; } .about { padding: 0.5rem 0.5rem 2.5rem; }
.about .site-intro { padding: 1.4rem 1.3rem; text-align: left; } .about .site-intro { padding: 1.5rem 1.4rem; text-align: left; }
.quick-links { gap: 1rem 1.5rem; margin-top: 1.5rem; } .about .site-intro::after { font-size: 3.5rem; right: 0.8rem; }
.quick-links { gap: 0.6rem 0.8rem; margin-top: 1.5rem; }
} }
/* 超小屏 */ /* 超小屏 */
@media (max-width: 360px) { @media (max-width: 360px) {
.hero { padding: 2.5rem 0.5rem 2rem; } .hero { padding: 2.25rem 0.5rem 2rem; }
.header h1 { font-size: 0.95rem; } .header h1 { font-size: 0.95rem; }
.right-group .btn { padding: 0.45rem 0.8rem; font-size: 0.8rem; } .right-group .btn { padding: 0.45rem 0.8rem; font-size: 0.8rem; }
} }
+37 -5
View File
@@ -29,15 +29,46 @@
<main id="main-page"> <main id="main-page">
<section class="hero"> <section class="hero">
<h2 class="hero-title">让知识像树一样<br><span class="accent-text">自然生长</span></h2> <!-- 品牌装饰:节点树(生长动画见 index.css,纯装饰不影响交互) -->
<p class="hero-sub">每个节点都可以生长出子节点,像树枝一样层层延展</p> <svg class="hero-tree" viewBox="0 0 640 360" fill="none" aria-hidden="true">
<div class="hero-actions"> <g stroke="currentColor" stroke-width="2" stroke-linecap="round">
<button id="ctaBtn" class="btn btn-primary btn-lg">开始记录</button> <path pathLength="100" d="M320 344 L320 262"/>
<a class="btn btn-ghost btn-lg" href="#features">了解更多</a> <path pathLength="100" d="M320 262 C 282 236, 238 214, 202 184"/>
<path pathLength="100" d="M320 262 C 358 236, 402 214, 438 184"/>
<path pathLength="100" d="M202 184 C 178 156, 156 134, 142 104"/>
<path pathLength="100" d="M202 184 C 222 156, 244 134, 258 104"/>
<path pathLength="100" d="M438 184 C 414 156, 396 134, 382 104"/>
<path pathLength="100" d="M438 184 C 462 156, 484 134, 498 104"/>
</g>
<g fill="currentColor">
<circle cx="320" cy="344" r="6"/>
<circle cx="320" cy="262" r="4.5"/>
<circle cx="202" cy="184" r="4.5"/>
<circle cx="438" cy="184" r="4.5"/>
<circle cx="142" cy="104" r="4"/>
<circle cx="258" cy="104" r="4"/>
<circle cx="382" cy="104" r="4"/>
<circle cx="498" cy="104" r="4"/>
</g>
</svg>
<div class="hero-inner">
<div class="hero-badge"><span class="badge-dot"></span>树状结构 · Markdown · 多媒体分享</div>
<h2 class="hero-title">让知识像树一样<br><span class="accent-text">自然生长</span></h2>
<p class="hero-sub">每个节点都可以生长出子节点,像树枝一样层层延展</p>
<div class="hero-actions">
<button id="ctaBtn" class="btn btn-primary btn-lg">开始记录</button>
<a class="btn btn-ghost btn-lg" href="#features">了解更多</a>
</div>
</div> </div>
<a class="scroll-hint" href="#features" aria-label="下滑了解特性">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>
</a>
</section> </section>
<section id="features"> <section id="features">
<p class="section-eyebrow">核心特性</p>
<h2 class="section-title">为什么选择树状笔记</h2> <h2 class="section-title">为什么选择树状笔记</h2>
<div class="features"> <div class="features">
<div class="feature-card"> <div class="feature-card">
@@ -72,6 +103,7 @@
</section> </section>
<section class="about"> <section class="about">
<p class="section-eyebrow">我们的理念</p>
<h2 class="section-title">关于本站</h2> <h2 class="section-title">关于本站</h2>
<p class="site-intro"> <p class="site-intro">
DNFS 树状笔记是一个以树状结构组织内容的笔记社区:每个节点都可以生长出子节点, DNFS 树状笔记是一个以树状结构组织内容的笔记社区:每个节点都可以生长出子节点,
+41
View File
@@ -58,3 +58,44 @@
checkLogin(); checkLogin();
})(); })();
/* ===== 视觉增强:滚动渐显 + 卡片光标光斑(装饰性,与登录逻辑解耦) ===== */
(function () {
'use strict';
const reduceMotion = !window.matchMedia('(prefers-reduced-motion: no-preference)').matches;
/* 滚动进入视口渐显:由 JS 添加 .reveal 隐藏初始态,无 JS / 减弱动效时内容天然可见 */
if (!reduceMotion && 'IntersectionObserver' in window) {
const targets = document.querySelectorAll('.section-eyebrow, .section-title, .feature-card, .about .site-intro, .quick-links');
targets.forEach(function (el, i) {
el.classList.add('reveal');
el.style.transitionDelay = (i % 4) * 70 + 'ms';
});
const io = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
const el = entry.target;
el.classList.add('reveal-in');
io.unobserve(el);
/* 动画结束后移除类与延迟,把 transition 控制权交还 hover 等交互样式 */
setTimeout(function () {
el.classList.remove('reveal', 'reveal-in');
el.style.transitionDelay = '';
}, 900);
});
}, { threshold: 0.15, rootMargin: '0px 0px -8% 0px' });
targets.forEach(function (el) { io.observe(el); });
}
/* 特性卡片光标光斑:鼠标位置写入 CSS 变量,由 index.css 径向渐变消费(仅精确指针设备) */
if (window.matchMedia('(hover: hover) and (pointer: fine)').matches) {
document.querySelectorAll('.feature-card').forEach(function (card) {
card.addEventListener('mousemove', function (e) {
const rect = card.getBoundingClientRect();
card.style.setProperty('--mx', (e.clientX - rect.left) + 'px');
card.style.setProperty('--my', (e.clientY - rect.top) + 'px');
});
});
}
})();