前端修复: - 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个页面全部渲染正常
486 lines
18 KiB
HTML
486 lines
18 KiB
HTML
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=1024, height=768, initial-scale=1">
|
|
<title>暖记 — 平板端日历</title>
|
|
<link rel="stylesheet" href="../css/tokens.css">
|
|
<link rel="stylesheet" href="../css/components.css">
|
|
<link rel="stylesheet" href="shared.css">
|
|
<style>
|
|
body {
|
|
width: 1024px;
|
|
height: 768px;
|
|
overflow: hidden;
|
|
background: var(--bg);
|
|
font-family: var(--font-body);
|
|
}
|
|
|
|
.calendar-layout {
|
|
display: flex;
|
|
height: 768px;
|
|
}
|
|
|
|
.sidebar { position: relative; flex-shrink: 0; }
|
|
|
|
.calendar-main {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
overflow: hidden;
|
|
}
|
|
|
|
/* Top bar */
|
|
.cal-topbar {
|
|
height: 56px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 var(--space-6);
|
|
background: var(--surface);
|
|
border-bottom: 1px solid var(--border-soft);
|
|
flex-shrink: 0;
|
|
}
|
|
.cal-topbar-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-4);
|
|
}
|
|
.cal-topbar-title {
|
|
font-family: var(--font-display);
|
|
font-size: var(--text-xl);
|
|
font-weight: 700;
|
|
color: var(--fg);
|
|
}
|
|
.cal-nav {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
}
|
|
.cal-nav button {
|
|
width: 34px;
|
|
height: 34px;
|
|
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);
|
|
}
|
|
.cal-nav button:hover { border-color: var(--accent); color: var(--accent); }
|
|
.cal-nav button svg { width: 16px; height: 16px; }
|
|
|
|
.view-toggle {
|
|
display: flex;
|
|
background: var(--surface-warm);
|
|
border-radius: var(--radius-pill);
|
|
padding: 3px;
|
|
border: 1px solid var(--border-soft);
|
|
}
|
|
.view-toggle button {
|
|
padding: 7px 18px;
|
|
border: none;
|
|
border-radius: var(--radius-pill);
|
|
background: transparent;
|
|
font-size: var(--text-sm);
|
|
font-weight: 500;
|
|
color: var(--muted);
|
|
cursor: pointer;
|
|
transition: all var(--motion-fast);
|
|
}
|
|
.view-toggle button.active {
|
|
background: var(--accent);
|
|
color: var(--accent-on);
|
|
box-shadow: var(--elev-soft);
|
|
}
|
|
|
|
/* Two-column: calendar left + timeline right */
|
|
.cal-body {
|
|
flex: 1;
|
|
display: flex;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.cal-left {
|
|
flex: 1;
|
|
padding: var(--space-6);
|
|
overflow-y: auto;
|
|
scrollbar-width: thin;
|
|
scrollbar-color: var(--border) transparent;
|
|
}
|
|
.cal-left::-webkit-scrollbar { width: 4px; }
|
|
.cal-left::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
|
|
|
|
.cal-right {
|
|
width: 340px;
|
|
background: var(--surface);
|
|
border-left: 1px solid var(--border-soft);
|
|
padding: var(--space-6);
|
|
overflow-y: auto;
|
|
scrollbar-width: thin;
|
|
flex-shrink: 0;
|
|
}
|
|
.cal-right::-webkit-scrollbar { width: 4px; }
|
|
.cal-right::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
|
|
|
|
/* Mood summary card */
|
|
.mood-summary {
|
|
background: var(--bg);
|
|
border-radius: var(--radius-md);
|
|
padding: var(--space-5);
|
|
margin-bottom: var(--space-5);
|
|
border: 1px solid var(--border-soft);
|
|
}
|
|
.mood-summary h4 {
|
|
font-family: var(--font-display);
|
|
font-size: var(--text-base);
|
|
font-weight: 600;
|
|
margin-bottom: var(--space-4);
|
|
}
|
|
.mood-bar-chart {
|
|
display: flex;
|
|
align-items: flex-end;
|
|
gap: var(--space-4);
|
|
height: 80px;
|
|
margin-bottom: var(--space-3);
|
|
}
|
|
.mood-bar {
|
|
flex: 1;
|
|
border-radius: 6px 6px 0 0;
|
|
display: flex;
|
|
align-items: flex-end;
|
|
justify-content: center;
|
|
padding-bottom: 4px;
|
|
font-size: 16px;
|
|
}
|
|
.mood-labels {
|
|
display: flex;
|
|
gap: var(--space-3);
|
|
}
|
|
.mood-labels span {
|
|
flex: 1;
|
|
text-align: center;
|
|
font-size: 11px;
|
|
color: var(--muted);
|
|
}
|
|
|
|
/* Calendar grid */
|
|
.weekday-row {
|
|
display: grid;
|
|
grid-template-columns: repeat(7, 1fr);
|
|
text-align: center;
|
|
margin-bottom: var(--space-2);
|
|
}
|
|
.weekday-row span {
|
|
font-size: var(--text-xs);
|
|
color: var(--meta);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.calendar-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(7, 1fr);
|
|
gap: 4px;
|
|
}
|
|
.cal-day {
|
|
aspect-ratio: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: var(--radius-sm);
|
|
cursor: pointer;
|
|
position: relative;
|
|
transition: all var(--motion-fast);
|
|
background: transparent;
|
|
border: none;
|
|
font-size: var(--text-sm);
|
|
color: var(--fg);
|
|
gap: 2px;
|
|
}
|
|
.cal-day:hover { background: var(--surface-warm); }
|
|
.cal-day.empty { cursor: default; }
|
|
.cal-day.empty:hover { background: transparent; }
|
|
.cal-day.today {
|
|
background: var(--accent);
|
|
color: var(--accent-on);
|
|
font-weight: 700;
|
|
}
|
|
.cal-day.selected {
|
|
background: var(--surface-warm);
|
|
border: 2px solid var(--accent);
|
|
}
|
|
.cal-day.today.selected { background: var(--accent); border: 2px solid var(--accent); }
|
|
.mood-dot {
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 50%;
|
|
position: absolute;
|
|
bottom: 4px;
|
|
}
|
|
.mood-dot.happy { background: var(--secondary); }
|
|
.mood-dot.love { background: var(--accent); }
|
|
.mood-dot.calm { background: var(--tertiary); }
|
|
.mood-dot.sad { background: #5B7DB1; }
|
|
.mood-dot.tired { background: #8B7E74; }
|
|
.entry-indicator {
|
|
position: absolute;
|
|
top: 3px;
|
|
right: 5px;
|
|
width: 5px;
|
|
height: 5px;
|
|
border-radius: 50%;
|
|
background: var(--accent);
|
|
}
|
|
.cal-day.today .entry-indicator { background: var(--accent-on); }
|
|
|
|
/* Timeline on right panel */
|
|
.timeline-title {
|
|
font-family: var(--font-display);
|
|
font-size: var(--text-lg);
|
|
font-weight: 700;
|
|
color: var(--fg);
|
|
margin-bottom: var(--space-2);
|
|
}
|
|
.timeline-date {
|
|
font-size: var(--text-sm);
|
|
color: var(--muted);
|
|
margin-bottom: var(--space-5);
|
|
}
|
|
|
|
.timeline-item {
|
|
display: flex;
|
|
gap: var(--space-3);
|
|
margin-bottom: var(--space-4);
|
|
position: relative;
|
|
}
|
|
.timeline-line {
|
|
width: 2px;
|
|
background: var(--border);
|
|
position: absolute;
|
|
left: 17px;
|
|
top: 38px;
|
|
bottom: -12px;
|
|
}
|
|
.timeline-item:last-child .timeline-line { display: none; }
|
|
|
|
.timeline-dot {
|
|
width: 36px;
|
|
height: 36px;
|
|
border-radius: 50%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 16px;
|
|
background: var(--bg);
|
|
border: 2px solid var(--border-soft);
|
|
position: relative;
|
|
z-index: 1;
|
|
}
|
|
|
|
.timeline-content {
|
|
flex: 1;
|
|
background: var(--bg);
|
|
border-radius: var(--radius-md);
|
|
padding: var(--space-4);
|
|
border: 1px solid var(--border-soft);
|
|
cursor: pointer;
|
|
transition: transform var(--motion-fast);
|
|
}
|
|
.timeline-content:hover { transform: translateY(-1px); }
|
|
|
|
.tl-time {
|
|
font-size: var(--text-xs);
|
|
color: var(--muted);
|
|
margin-bottom: 4px;
|
|
}
|
|
.tl-title {
|
|
font-family: var(--font-display);
|
|
font-size: var(--text-base);
|
|
font-weight: 600;
|
|
color: var(--fg);
|
|
margin-bottom: 4px;
|
|
}
|
|
.tl-excerpt {
|
|
font-size: var(--text-sm);
|
|
color: var(--muted);
|
|
line-height: 1.5;
|
|
display: -webkit-box;
|
|
-webkit-line-clamp: 2;
|
|
-webkit-box-orient: vertical;
|
|
overflow: hidden;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="calendar-layout">
|
|
<!-- Sidebar -->
|
|
<nav class="sidebar" role="navigation" aria-label="主导航">
|
|
<div class="sidebar-brand">
|
|
<div class="sidebar-logo">📖</div>
|
|
<div>
|
|
<div class="sidebar-brand-text">暖记</div>
|
|
<div class="sidebar-brand-sub">Warm Notes</div>
|
|
</div>
|
|
</div>
|
|
<div class="sidebar-nav">
|
|
<button class="sidebar-nav-item" role="button" aria-label="首页">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><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>
|
|
首页
|
|
</button>
|
|
<button class="sidebar-nav-item active" role="button" aria-label="日历">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><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>
|
|
日历
|
|
</button>
|
|
<button class="sidebar-nav-item" role="button" aria-label="心情追踪">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
|
|
心情追踪
|
|
</button>
|
|
<button class="sidebar-nav-item" role="button" aria-label="贴纸库">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="9" cy="10" r="1.5" fill="currentColor"/><circle cx="15" cy="10" r="1.5" fill="currentColor"/><path d="M9 15c.8.8 2.2 1.2 3 1.2s2.2-.4 3-1.2"/></svg>
|
|
贴纸库
|
|
</button>
|
|
<button class="sidebar-nav-item" role="button" aria-label="模板">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>
|
|
模板
|
|
</button>
|
|
</div>
|
|
<button class="sidebar-write-btn" aria-label="写日记">
|
|
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>
|
|
写日记
|
|
</button>
|
|
<div class="sidebar-footer">
|
|
<div class="sidebar-avatar">🐱</div>
|
|
<div>
|
|
<div class="sidebar-user-name">小暖</div>
|
|
<div class="sidebar-user-streak">连续记录 12 天</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
<main class="calendar-main" role="main">
|
|
<!-- Top bar -->
|
|
<div class="cal-topbar">
|
|
<div class="cal-topbar-left">
|
|
<div class="cal-topbar-title">日历</div>
|
|
<div class="cal-nav">
|
|
<button aria-label="上一月"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M10 14l-5-5 5-5"/></svg></button>
|
|
<button aria-label="下一月"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M6 2l5 5-5 5"/></svg></button>
|
|
</div>
|
|
<span style="font-size:var(--text-base);color:var(--fg-2);font-weight:500">2026年5月</span>
|
|
</div>
|
|
<div class="view-toggle">
|
|
<button class="active">月视图</button>
|
|
<button>周视图</button>
|
|
<button>时间轴</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Calendar + Timeline -->
|
|
<div class="cal-body">
|
|
<div class="cal-left">
|
|
<!-- Mood summary -->
|
|
<div class="mood-summary">
|
|
<h4>本月心情概览</h4>
|
|
<div class="mood-bar-chart">
|
|
<div class="mood-bar" style="height:65%;background:var(--secondary)">😊</div>
|
|
<div class="mood-bar" style="height:45%;background:var(--accent)">🥰</div>
|
|
<div class="mood-bar" style="height:30%;background:var(--tertiary)">😌</div>
|
|
<div class="mood-bar" style="height:15%;background:#5B7DB1">😔</div>
|
|
<div class="mood-bar" style="height:20%;background:#8B7E74">😴</div>
|
|
</div>
|
|
<div class="mood-labels">
|
|
<span>开心 12天</span>
|
|
<span>幸福 8天</span>
|
|
<span>平静 5天</span>
|
|
<span>低落 2天</span>
|
|
<span>疲惫 3天</span>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Calendar grid -->
|
|
<div class="weekday-row">
|
|
<span>日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span>六</span>
|
|
</div>
|
|
<div class="calendar-grid">
|
|
<div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div><div class="cal-day empty"></div>
|
|
<div class="cal-day" data-day="1"><span>1</span><div class="mood-dot happy"></div></div>
|
|
<div class="cal-day" data-day="2"><span>2</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="3"><span>3</span><div class="mood-dot calm"></div></div>
|
|
<div class="cal-day" data-day="4"><span>4</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="5"><span>5</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="6"><span>6</span><div class="mood-dot happy"></div></div>
|
|
<div class="cal-day" data-day="7"><span>7</span><div class="mood-dot tired"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="8"><span>8</span><div class="mood-dot happy"></div></div>
|
|
<div class="cal-day" data-day="9"><span>9</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="10"><span>10</span><div class="mood-dot calm"></div></div>
|
|
<div class="cal-day" data-day="11"><span>11</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="12"><span>12</span><div class="mood-dot tired"></div></div>
|
|
<div class="cal-day" data-day="13"><span>13</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="14"><span>14</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="15"><span>15</span><div class="mood-dot calm"></div></div>
|
|
<div class="cal-day" data-day="16"><span>16</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="17"><span>17</span><div class="mood-dot sad"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="18"><span>18</span><div class="mood-dot calm"></div></div>
|
|
<div class="cal-day" data-day="19"><span>19</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="20"><span>20</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="21"><span>21</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="22"><span>22</span><div class="mood-dot tired"></div></div>
|
|
<div class="cal-day" data-day="23"><span>23</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="24"><span>24</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="25"><span>25</span><div class="mood-dot calm"></div></div>
|
|
<div class="cal-day" data-day="26"><span>26</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="27"><span>27</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="28"><span>28</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="29"><span>29</span><div class="mood-dot love"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day" data-day="30"><span>30</span><div class="mood-dot happy"></div><div class="entry-indicator"></div></div>
|
|
<div class="cal-day today selected" data-day="31"><span>31</span><div class="mood-dot love" style="background:var(--accent-on)"></div></div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Right timeline panel -->
|
|
<aside class="cal-right" role="complementary" aria-label="日期详情">
|
|
<div class="timeline-title">5月31日 · 今天</div>
|
|
<div class="timeline-date">3条记录</div>
|
|
|
|
<div class="timeline-item">
|
|
<div class="timeline-line"></div>
|
|
<div class="timeline-dot">🥰</div>
|
|
<div class="timeline-content">
|
|
<div class="tl-time">14:30 · 心情: 幸福</div>
|
|
<div class="tl-title">图书馆的午后时光</div>
|
|
<div class="tl-excerpt">今天下午去图书馆自习,阳光从窗外洒进来,暖暖的...</div>
|
|
</div>
|
|
</div>
|
|
<div class="timeline-item">
|
|
<div class="timeline-line"></div>
|
|
<div class="timeline-dot">😊</div>
|
|
<div class="timeline-content">
|
|
<div class="tl-time">09:15 · 心情: 开心</div>
|
|
<div class="tl-title">周末早起的奖励</div>
|
|
<div class="tl-excerpt">难得周末早起,去食堂吃了喜欢的豆浆油条...</div>
|
|
</div>
|
|
</div>
|
|
<div class="timeline-item">
|
|
<div class="timeline-line"></div>
|
|
<div class="timeline-dot">😌</div>
|
|
<div class="timeline-content">
|
|
<div class="tl-time">07:00 · 心情: 平静</div>
|
|
<div class="tl-title">晨跑记录</div>
|
|
<div class="tl-excerpt">早起跑了两圈操场,空气很清新...</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<script src="../../js/theme-switcher.js"></script>
|
|
</body>
|
|
</html>
|