Files
nj/docs/opendesign/screens/monthly.html
iven b320641d9c
Some checks failed
Main Merge / backend (push) Has been cancelled
Main Merge / frontend (push) Has been cancelled
fix(app): 全链路验证修复 — 编译错误/CORS/迁移/启动脚本
前端修复:
- calendar_page: 移除不存在的 JournalEntry.content getter
- responsive_scaffold: 移除不存在的 notchThickness 参数
- splash_page: SingleTickerProvider → TickerProvider (多 AnimationController)
- profile_page: UserRoleType.name → .code (修复运行时崩溃)
- 导入缺失的 user.dart

后端修复:
- class_service: generate_class_code 取 UUID 后6位(随机部分)避免碰撞
- diary_role_seed: 移除不存在的 id 列,使用复合主键 ON CONFLICT

基础设施:
- config/default.toml: CORS 改为通配符(开发模式)
- scripts/dev.sh: 统一启动脚本(自动清理端口)
- docs/opendesign/: Open Design 设计规格 HTML 原型稿

验证结果: flutter analyze 0 error, cargo test 77/77 通过, 17个页面全部渲染正常
2026-06-02 01:03:58 +08:00

307 lines
13 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=390, height=844, initial-scale=1, viewport-fit=cover">
<title>暖记 — 月度概览</title>
<link href="https://fonts.googleapis.com/css2?family=Caveat:wght@400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<style>
body {
width: 390px; height: 844px;
overflow: hidden; background: var(--bg);
position: relative;
}
/* Global focus styles */
button:focus-visible, a:focus-visible, [role="tab"]:focus-visible {
box-shadow: 0 0 0 3px var(--focus-ring);
outline: none;
}
.content-area {
position: absolute; top: 0; left: 0; right: 0;
bottom: calc(var(--tab-height) + var(--safe-bottom));
overflow-y: auto; padding: 0 var(--space-5);
padding-top: calc(var(--safe-top) + var(--space-2));
scrollbar-width: none;
}
.content-area::-webkit-scrollbar { display: none; }
.month-header {
display: flex; align-items: center; justify-content: space-between;
margin-bottom: var(--space-5);
}
.month-title {
font-family: var(--font-display);
font-size: var(--text-2xl); font-weight: 700;
}
.month-nav { display: flex; gap: var(--space-2); }
.month-nav button {
min-width: 44px; min-height: 44px; border-radius: 50%;
border: 1.5px solid var(--border); background: var(--surface);
display: flex; align-items: center; justify-content: center;
cursor: pointer; color: var(--fg); transition: all var(--motion-fast);
}
.month-nav button:hover { border-color: var(--accent); color: var(--accent); }
.month-nav button svg { width: 18px; height: 18px; }
/* Monthly calendar grid - color coded */
.month-grid {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-4); margin-bottom: var(--space-5);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
}
.weekday-row {
display: grid; grid-template-columns: repeat(7, 1fr);
text-align: center; margin-bottom: var(--space-2);
}
.weekday-row span { font-size: 11px; color: var(--meta); font-weight: 500; }
.m-grid {
display: grid; grid-template-columns: repeat(7, 1fr);
gap: 3px;
}
.m-cell {
aspect-ratio: 1; border-radius: 6px;
display: flex; flex-direction: column;
align-items: center; justify-content: center;
font-size: 12px; color: var(--fg);
position: relative; cursor: pointer;
transition: all var(--motion-fast);
min-height: 44px;
}
.m-cell:hover { transform: scale(1.1); }
.m-cell.empty { cursor: default; }
.m-cell.empty:hover { transform: none; }
.m-cell .mood-e { font-size: 10px; margin-top: 1px; }
.m-cell.has-entry { background: rgba(255,255,255,0.5); }
.m-cell.mood-happy { background: var(--secondary-soft); }
.m-cell.mood-love { background: var(--rose-soft); }
.m-cell.mood-calm { background: var(--tertiary-soft); }
.m-cell.mood-sad { background: #D4DDE8; }
.m-cell.mood-tired { background: #E8E4E0; }
.m-cell.today {
outline: 2px solid var(--accent);
outline-offset: -2px;
font-weight: 700;
}
/* Month summary */
.month-summary {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-5); margin-bottom: var(--space-5);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
}
.month-summary h3 {
font-family: var(--font-display); font-size: var(--text-lg);
font-weight: 700; margin-bottom: var(--space-4);
}
.summary-grid {
display: grid; grid-template-columns: 1fr 1fr;
gap: var(--space-3);
}
.s-card {
padding: var(--space-4); border-radius: var(--radius-sm);
text-align: center;
}
.s-card .s-icon { font-size: 24px; margin-bottom: var(--space-2); }
.s-card .s-val {
font-family: var(--font-display);
font-size: var(--text-xl); font-weight: 700;
}
.s-card .s-label {
font-size: var(--text-xs); color: var(--muted); margin-top: 2px;
}
/* Highlight entries */
.highlights {
margin-bottom: var(--space-5);
}
.highlights h3 {
font-family: var(--font-display); font-size: var(--text-lg);
font-weight: 700; margin-bottom: var(--space-4);
}
.highlight-card {
background: var(--surface); border-radius: var(--radius-md);
padding: var(--space-4); margin-bottom: var(--space-3);
box-shadow: var(--elev-soft); border: 1px solid var(--border-soft);
display: flex; gap: var(--space-3); align-items: center;
cursor: pointer; transition: transform var(--motion-fast);
min-height: 44px;
}
.highlight-card:hover { transform: translateY(-1px); }
.hl-emoji {
width: 48px; height: 48px; border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 24px; flex-shrink: 0;
}
.hl-info { flex: 1; }
.hl-info .hl-date { font-size: var(--text-xs); color: var(--muted); }
.hl-info .hl-title {
font-family: var(--font-display); font-size: var(--text-base);
font-weight: 600; margin-top: 2px;
}
.hl-badge {
padding: 4px 10px; border-radius: var(--radius-pill);
font-size: 11px; font-weight: 600;
}
</style>
</head>
<body>
<div class="content-area">
<div class="month-header anim-fade">
<div class="month-title">2026年5月</div>
<div class="month-nav">
<button aria-label="上个月"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M11 14l-5-5 5-5"/></svg></button>
<button aria-label="下个月"><svg viewBox="0 0 18 18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M7 4l5 5-5 5"/></svg></button>
</div>
</div>
<!-- Month grid - using standardized 5 moods -->
<div class="month-grid anim-fade" style="animation-delay: 0.1s">
<div class="weekday-row" aria-hidden="true">
<span></span><span></span><span></span><span></span><span></span><span></span><span></span>
</div>
<div class="m-grid">
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell empty"></div>
<div class="m-cell mood-happy">1<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">2<span class="mood-e">😊</span></div>
<div class="m-cell mood-calm">3<span class="mood-e">😐</span></div>
<div class="m-cell mood-sad">4<span class="mood-e">😢</span></div>
<div class="m-cell mood-happy">5<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">6<span class="mood-e">😊</span></div>
<div class="m-cell mood-tired">7<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">8<span class="mood-e">😊</span></div>
<div class="m-cell mood-love">9<span class="mood-e">😡</span></div>
<div class="m-cell mood-calm">10<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">11<span class="mood-e">😊</span></div>
<div class="m-cell mood-tired">12<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">13<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">14<span class="mood-e">😊</span></div>
<div class="m-cell mood-calm">15<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">16<span class="mood-e">😊</span></div>
<div class="m-cell mood-sad">17<span class="mood-e">😢</span></div>
<div class="m-cell mood-calm">18<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">19<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">20<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">21<span class="mood-e">😊</span></div>
<div class="m-cell mood-tired">22<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">23<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">24<span class="mood-e">😊</span></div>
<div class="m-cell mood-calm">25<span class="mood-e">😐</span></div>
<div class="m-cell mood-calm">26<span class="mood-e">😐</span></div>
<div class="m-cell mood-happy">27<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">28<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">29<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy">30<span class="mood-e">😊</span></div>
<div class="m-cell mood-happy today">31<span class="mood-e">😊</span></div>
</div>
</div>
<!-- Summary -->
<div class="month-summary anim-fade" style="animation-delay: 0.15s">
<h3>本月总结</h3>
<div class="summary-grid">
<div class="s-card" style="background: var(--tertiary-soft)">
<div class="s-icon">📝</div>
<div class="s-val" style="color:#B8860B">28</div>
<div class="s-label">日记篇数</div>
</div>
<div class="s-card" style="background: var(--secondary-soft)">
<div class="s-icon">🔥</div>
<div class="s-val" style="color:#2D7D46">12</div>
<div class="s-label">最长连续</div>
</div>
<div class="s-card" style="background: var(--rose-soft)">
<div class="s-icon">😊</div>
<div class="s-val" style="color:#9B4D4D">72%</div>
<div class="s-label">好心情占比</div>
</div>
<div class="s-card" style="background: #D4DDE8">
<div class="s-icon">📸</div>
<div class="s-val" style="color:#4A6B8A">18</div>
<div class="s-label">照片数量</div>
</div>
</div>
</div>
<!-- Highlights -->
<div class="highlights anim-fade" style="animation-delay: 0.2s">
<h3>本月精选</h3>
<div class="highlight-card">
<div class="hl-emoji" style="background:var(--rose-soft)">😊</div>
<div class="hl-info">
<div class="hl-date">5月14日</div>
<div class="hl-title">和朋友聚餐的欢乐时光</div>
</div>
<div class="hl-badge" style="background:var(--rose-soft);color:#9B4D4D">最佳心情</div>
</div>
<div class="highlight-card">
<div class="hl-emoji" style="background:var(--tertiary-soft)"></div>
<div class="hl-info">
<div class="hl-date">5月21日</div>
<div class="hl-title">完成了第一个小目标</div>
</div>
<div class="hl-badge" style="background:var(--tertiary-soft);color:#B8860B">里程碑</div>
</div>
<div class="highlight-card">
<div class="hl-emoji" style="background:var(--secondary-soft)">📚</div>
<div class="hl-info">
<div class="hl-date">5月28日</div>
<div class="hl-title">期末考试结束</div>
</div>
<div class="hl-badge" style="background:var(--secondary-soft);color:#2D7D46">最详尽记录</div>
</div>
</div>
<div style="height: var(--space-8)"></div>
</div>
<!-- Tab bar -->
<nav class="tab-bar" role="tablist">
<button class="tab-item" role="tab" aria-label="首页" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>
<span>首页</span>
</button>
<button class="tab-item active" role="tab" aria-label="日历" aria-selected="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg>
<span>日历</span>
</button>
<button class="tab-item" role="tab" aria-label="写日记" aria-selected="false" style="position:relative">
<div style="width:44px;height:44px;border-radius:50%;background:var(--accent);display:flex;align-items:center;justify-content:center;margin-top:-16px;box-shadow:0 4px 12px var(--shadow-accent)">
<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-on)" stroke-width="2.5" stroke-linecap="round" style="width:22px;height:22px" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>
</div>
<span style="margin-top:2px">写日记</span>
</button>
<button class="tab-item" role="tab" aria-label="发现" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
<span>发现</span>
</button>
<button class="tab-item" role="tab" aria-label="我的" aria-selected="false">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
<span>我的</span>
</button>
</nav>
<div class="dynamic-island" aria-hidden="true"></div>
<div class="home-indicator" style="position:absolute;bottom:8px;left:50%;transform:translateX(-50%);z-index:101" aria-hidden="true"></div>
<script src="../js/theme-switcher.js"></script>
</body>
</html>