mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-05-21 15:10:52 +00:00
refactor: simplify home page
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
max-width: 640px;
|
||||
width: 100%;
|
||||
padding: 0 24px;
|
||||
animation: homeFadeIn 0.5s ease-out;
|
||||
}
|
||||
|
||||
.home-title {
|
||||
@@ -20,81 +19,17 @@
|
||||
font-weight: 700;
|
||||
margin: 0 0 12px;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -1.5px;
|
||||
}
|
||||
|
||||
.home-subtitle {
|
||||
font-size: 16px;
|
||||
color: var(--text-secondary);
|
||||
margin: 0 0 48px;
|
||||
margin: 0;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.home-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.home-feature-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
padding: 16px 18px;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 12px;
|
||||
background: var(--card-bg);
|
||||
cursor: pointer;
|
||||
text-align: left;
|
||||
transition: background 0.15s ease, border-color 0.15s ease;
|
||||
color: var(--text-secondary);
|
||||
|
||||
&:hover {
|
||||
background: var(--bg-hover);
|
||||
border-color: var(--text-tertiary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
svg {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.home-feature-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.home-feature-label {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.home-feature-desc {
|
||||
font-size: 12px;
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
@keyframes homeFadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(12px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
.home-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.home-title {
|
||||
font-size: 36px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,11 @@
|
||||
import { MessageSquare, BarChart3, Download, Aperture, Footprints, FolderClosed } from 'lucide-react'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import './HomePage.scss'
|
||||
|
||||
function HomePage() {
|
||||
const navigate = useNavigate()
|
||||
|
||||
const features = [
|
||||
{ icon: MessageSquare, label: '聊天', desc: '浏览聊天记录', path: '/chat' },
|
||||
{ icon: Aperture, label: '朋友圈', desc: '查看朋友圈动态', path: '/sns' },
|
||||
{ icon: BarChart3, label: '聊天分析', desc: '分析聊天统计数据', path: '/analytics' },
|
||||
{ icon: FolderClosed, label: '资源浏览', desc: '管理媒体文件', path: '/resources' },
|
||||
{ icon: Footprints, label: '我的足迹', desc: '回顾你的轨迹', path: '/footprint' },
|
||||
{ icon: Download, label: '导出', desc: '导出聊天记录', path: '/export' },
|
||||
]
|
||||
|
||||
return (
|
||||
<div className="home-page">
|
||||
<div className="home-content">
|
||||
<h1 className="home-title">WeFlow</h1>
|
||||
<p className="home-subtitle">每一条消息的背后,都藏着一段温暖的时光</p>
|
||||
|
||||
<div className="home-grid">
|
||||
{features.map((f) => (
|
||||
<button
|
||||
key={f.path}
|
||||
className="home-feature-card"
|
||||
onClick={() => navigate(f.path)}
|
||||
type="button"
|
||||
>
|
||||
<f.icon size={20} />
|
||||
<div className="home-feature-text">
|
||||
<span className="home-feature-label">{f.label}</span>
|
||||
<span className="home-feature-desc">{f.desc}</span>
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user