根据您提供的 HTML 设计,完全重写了 Dashboard 组件:
新功能:
- ✅ "你好, 留子" 个性化问候
- ✅ "Don't waste, just taste." 副标题
- ✅ 分类统计卡片(乳制品、生鲜、储藏室)
- ✅ 即将过期物品列表
- ✅ "查看全部过期物品" 按钮
- ✅ Material Design 风格
设计特点:
- 使用 Material Icons
- 圆角卡片设计
- 清晰的层次结构
- 响应式布局
更新底部导航栏以使用 Material Icons:
图标映射:
grid_view- 首页inventory_2- 库存add- 添加(浮动按钮)restaurant_menu- 食谱settings- 设置
样式:
- 悬浮添加按钮
- 活动状态高亮(emerald-500)
- 平滑过渡动画
添加了 Google Fonts 和 Material Icons:
index.html:
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Poppins:wght@400;500;600&display=swap" rel="stylesheet" />
<!-- Material Icons -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined" rel="stylesheet" />index.css:
body {
font-family: 'Poppins', 'Noto Sans SC', sans-serif;
}
.material-icons-outlined {
font-family: 'Material Icons Outlined';
font-size: 28px;
/* ... 其他样式 */
}- 使用 Lucide React 图标
- 简单的卡片布局
- 英文为主的界面
- ✅ Material Icons(Google 风格)
- ✅ 精美的分类统计卡片
- ✅ 中文优先界面
- ✅ "你好, 留子" 个性化问候
- ✅ 即将过期物品突出显示
- Primary: Emerald 500 (#10B981)
- Background: Gray 50 (浅色) / Gray 900 (深色)
- Surface: White (浅色) / Gray 800 (深色)
- Warning: Red 500 (#EF4444)
- 主字体: Poppins (英文), Noto Sans SC (中文)
- 图标: Material Icons Outlined
- 卡片:
rounded-lg(8px) - 按钮:
rounded-full(完全圆形)
✅ src/components/Dashboard.jsx - 完全重写
✅ src/components/Layout.jsx - 更新为 Material Icons
✅ index.html - 添加字体和图标链接
✅ src/index.css - 添加字体样式和 Material Icons 样式
- ✅ 构建成功
- ✅ 开发服务器运行正常
- ⏳ Material Icons 渲染(需要刷新浏览器)
- 刷新浏览器查看新设计
- 测试所有导航功能
- 验证 Material Icons 是否正确显示
- 如需调整,可以继续优化
更新时间: 2025-12-02
设计风格: Material Design
状态: ✅ 完成