Files
nj/docs/opendesign/screens/desktop/editor.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

480 lines
36 KiB
HTML

<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=1440, height=900, initial-scale=1">
<title>暖记 — 桌面端编辑器</title>
<link rel="stylesheet" href="../css/tokens.css">
<link rel="stylesheet" href="../css/components.css">
<link rel="stylesheet" href="../css/editor-common.css">
<link rel="stylesheet" href="shared.css">
<style>
body {
width: 1440px;
height: 900px;
overflow: hidden;
background: var(--bg);
font-family: var(--font-body);
}
.editor-layout {
display: flex;
height: 900px;
padding-top: 32px;
}
.sidebar { position: relative; flex-shrink: 0; }
.editor-main {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.editor-topbar {
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 var(--space-8);
background: var(--surface);
border-bottom: 1px solid var(--border-soft);
flex-shrink: 0;
}
.topbar-left, .topbar-right {
display: flex;
align-items: center;
gap: var(--space-3);
}
.topbar-btn {
width: 38px; height: 38px; border-radius: var(--radius-pill); border: none; background: none;
display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--fg);
transition: background var(--motion-fast);
}
.topbar-btn:hover { background: var(--surface-warm); }
.topbar-btn svg { width: 20px; height: 20px; }
.topbar-center {
font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; color: var(--fg-2);
display: flex; align-items: center; gap: var(--space-4);
}
.topbar-center .date-mood {
display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm);
color: var(--muted); font-weight: 400;
}
.topbar-center .date-mood strong { color: var(--fg); font-weight: 600; }
.mood-mini {
width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border);
display: flex; align-items: center; justify-content: center; font-size: 15px;
background: var(--surface); cursor: pointer;
}
.mood-mini.selected { border-color: var(--accent); background: var(--surface-warm); }
.topbar-undo-redo { display: flex; align-items: center; gap: 2px; }
.undo-btn, .redo-btn {
width: 34px; height: 34px; border-radius: var(--radius-pill); border: none; background: none;
display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
transition: all var(--motion-fast);
}
.undo-btn:hover:not(:disabled), .redo-btn:hover:not(:disabled) { background: var(--surface-warm); color: var(--fg); }
.undo-btn:disabled, .redo-btn:disabled { opacity: 0.35; cursor: default; }
.undo-btn svg, .redo-btn svg { width: 18px; height: 18px; }
.autosave-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--success); font-weight: 500; }
.autosave-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.save-btn {
padding: 10px 28px; background: var(--accent); color: var(--accent-on); border: none;
border-radius: var(--radius-pill); font-family: var(--font-display); font-size: var(--text-sm);
font-weight: 600; cursor: pointer; transition: all var(--motion-fast);
}
.save-btn:hover { background: var(--accent-hover); }
.editor-body { flex: 1; display: flex; overflow: hidden; }
.tool-strip {
width: 64px; background: var(--surface); border-right: 1px solid var(--border-soft);
display: flex; flex-direction: column; align-items: center; padding: var(--space-4) 0;
gap: var(--space-2); flex-shrink: 0;
}
.strip-btn {
width: 48px; height: 48px; border-radius: var(--radius-sm); border: none; background: none;
display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
cursor: pointer; color: var(--muted); transition: all var(--motion-fast);
}
.strip-btn:hover { color: var(--accent); background: var(--surface-warm); }
.strip-btn.active { color: var(--accent); background: var(--surface-warm); }
.strip-btn svg { width: 22px; height: 22px; }
.strip-btn span { font-size: 9px; font-weight: 500; }
.strip-divider { width: 32px; height: 1px; background: var(--border-soft); margin: var(--space-2) 0; }
.canvas-wrapper { flex: 1; padding: var(--space-6); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.canvas-wrapper::-webkit-scrollbar { width: 4px; }
.canvas-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.canvas-paper {
max-width: 720px; margin: 0 auto; background: var(--surface); border-radius: var(--radius-md);
box-shadow: var(--elev-medium); border: 1px solid var(--border-soft); padding: var(--space-10);
min-height: 700px; position: relative;
}
.canvas-grid {
position: absolute; inset: 0; background-image: radial-gradient(circle, var(--border) 1px, transparent 1px);
background-size: 28px 28px; opacity: 0.35; pointer-events: none; border-radius: var(--radius-md);
}
.washi-tape {
position: absolute; top: 20px; right: 50px; width: 120px; height: 24px;
background: repeating-linear-gradient(45deg, var(--tertiary), var(--tertiary) 4px, var(--surface-warm) 4px, var(--surface-warm) 8px);
transform: rotate(-8deg); border-radius: 2px; opacity: 0.8;
}
.placed-sticker { position: absolute; font-size: 40px; cursor: move; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.journal-content { position: relative; z-index: 1; }
.journal-title {
font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; color: var(--fg);
margin-bottom: var(--space-4); border: none; outline: none; width: 100%; background: transparent;
}
.format-bar {
display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0;
margin-bottom: var(--space-5); border-bottom: 1px solid var(--border-soft);
}
.format-btn {
width: 34px; height: 34px; border-radius: 6px; border: none; background: none;
display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted);
font-size: var(--text-sm); font-weight: 600; transition: all var(--motion-fast);
}
.format-btn:hover { background: var(--surface-warm); color: var(--fg); }
.format-btn.active { background: var(--accent); color: var(--accent-on); }
.format-divider { width: 1px; height: 22px; background: var(--border); }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: all var(--motion-fast); }
.color-dot:hover { transform: scale(1.15); }
.color-dot.active { border-color: var(--fg); }
.journal-body {
font-size: var(--text-md); line-height: 2; color: var(--fg-2); border: none; outline: none;
width: 100%; background: transparent; resize: none; min-height: 280px;
}
.placed-photo {
width: 100%; height: 180px; border-radius: var(--radius-sm);
background: linear-gradient(135deg, var(--secondary-soft), var(--secondary-soft)); margin: var(--space-6) 0;
display: flex; align-items: center; justify-content: center;
}
.tool-panel-side {
width: 360px; background: var(--surface); border-left: 1px solid var(--border-soft);
overflow-y: auto; scrollbar-width: thin; flex-shrink: 0;
}
.tool-panel-side::-webkit-scrollbar { width: 4px; }
.tool-panel-side::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.panel-header { padding: var(--space-5); border-bottom: 1px solid var(--border-soft); display: flex; gap: var(--space-2); align-items: center; }
.panel-tab {
padding: 8px 18px; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500;
background: var(--surface-warm); color: var(--fg-2); border: none; cursor: pointer;
white-space: nowrap; transition: all var(--motion-fast);
}
.panel-tab.active { background: var(--accent); color: var(--accent-on); }
.panel-content { padding: var(--space-5); }
.panel-sub-tabs { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); flex-wrap: wrap; }
.sub-tab {
padding: 5px 14px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
background: var(--surface-warm); color: var(--fg-2); border: none; cursor: pointer; transition: all var(--motion-fast);
}
.sub-tab.active { background: var(--accent); color: var(--accent-on); }
.sticker-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-3); }
.sticker-item {
aspect-ratio: 1; border-radius: var(--radius-sm); background: var(--surface-warm);
display: flex; align-items: center; justify-content: center; font-size: 28px; cursor: pointer;
transition: all var(--motion-fast) var(--ease-bounce); border: 1px solid transparent;
}
.sticker-item:hover { transform: scale(1.1); border-color: var(--accent); }
.template-preview { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-top: var(--space-4); }
.template-thumb {
height: 160px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--bg);
cursor: pointer; transition: all var(--motion-fast); display: flex; align-items: center;
justify-content: center; flex-direction: column; gap: var(--space-2);
}
.template-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.template-thumb .icon { font-size: 28px; }
.template-thumb .name { font-size: var(--text-xs); color: var(--muted); }
/* Brush panel */
.brush-section-title {
font-size: var(--text-xs); font-weight: 600; color: var(--muted);
text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--space-3);
}
.brush-tools-row { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.brush-tool-btn {
display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
border-radius: var(--radius-sm); border: 2px solid transparent; background: var(--surface-warm);
cursor: pointer; color: var(--muted); transition: all var(--motion-fast);
}
.brush-tool-btn:hover { color: var(--fg); border-color: var(--border); }
.brush-tool-btn.active { border-color: var(--accent); color: var(--accent); }
.brush-tool-btn svg { width: 22px; height: 22px; }
.brush-size-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.brush-size-label { font-size: var(--text-xs); color: var(--muted); font-weight: 500; min-width: 24px; }
.brush-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--border); outline: none; }
.brush-slider::-webkit-slider-thumb {
-webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
background: var(--accent); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.brush-size-input {
width: 52px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
text-align: center; font-size: var(--text-sm); font-weight: 600; color: var(--fg); background: var(--surface);
}
.brush-size-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.brush-colors-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4); }
.brush-color-dot { width: 100%; aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent; cursor: pointer; transition: all var(--motion-fast); }
.brush-color-dot:hover { transform: scale(1.1); }
.brush-color-dot.active { border-color: var(--fg); box-shadow: 0 0 0 2px var(--surface); }
.brush-color-custom { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-5); }
.brush-color-custom input[type="color"] { width: 36px; height: 30px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; padding: 2px; }
.brush-color-custom-label { font-size: var(--text-xs); color: var(--muted); }
.brush-opacity-row { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); transition: opacity var(--motion-fast); }
.brush-opacity-row.disabled { opacity: 0.35; pointer-events: none; }
.brush-opacity-label { font-size: var(--text-xs); color: var(--muted); font-weight: 500; min-width: 36px; }
.brush-opacity-input {
width: 52px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
text-align: center; font-size: var(--text-sm); font-weight: 600; color: var(--fg); background: var(--surface);
}
.brush-opacity-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.brush-shortcuts { background: var(--surface-warm); border-radius: var(--radius-sm); padding: var(--space-3); }
.brush-shortcut-item { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; }
.brush-shortcut-item span { font-size: var(--text-xs); color: var(--muted); }
.brush-shortcut-key {
display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px;
padding: 0 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
font-size: 11px; font-weight: 600; color: var(--fg-2); font-family: var(--font-mono);
}
/* Tags panel */
.tags-section { margin-bottom: var(--space-5); }
.tag-selected-area {
display: flex; flex-wrap: wrap; gap: var(--space-2); min-height: 36px;
}
.tag-pill {
display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px;
border-radius: 9999px; background: var(--surface-warm); color: var(--accent);
font-size: 13px; font-weight: 500;
}
.tag-pill .remove {
width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
color: var(--surface); display: flex; align-items: center; justify-content: center;
font-size: 10px; cursor: pointer; border: none; line-height: 1;
transition: background var(--motion-fast);
}
.tag-pill .remove:hover { background: var(--accent-hover); }
.tag-input-row { display: flex; }
.tag-input {
flex: 1; height: 36px; border: 1.5px solid var(--border); border-radius: var(--radius-pill);
padding: 0 var(--space-4); font-size: var(--text-sm); color: var(--fg);
background: var(--bg); outline: none; transition: border-color var(--motion-fast);
font-family: var(--font-body);
}
.tag-input::placeholder { color: var(--meta); }
.tag-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--shadow-input-focus); }
.tag-suggest-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tag-suggest-item {
display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 9999px;
background: var(--surface-warm); color: var(--fg-2); font-size: var(--text-sm);
font-weight: 500; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
transition: all var(--motion-fast);
}
.tag-suggest-item:hover { border-color: var(--accent); color: var(--accent); }
</style>
</head>
<body>
<div class="editor-layout">
<nav class="sidebar">
<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"><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"><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"><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>
</div>
<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>
<div class="editor-main">
<div class="editor-topbar">
<div class="topbar-left"><button class="topbar-btn"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M15 18l-6-6 6-6"/></svg></button></div>
<div class="topbar-center"><span>5月31日 · 周日</span><div class="date-mood"><strong>14:32</strong><span>· 晴 26°</span><div class="mood-mini" style="display:inline-flex">😊</div><div class="mood-mini selected" style="display:inline-flex">🥰</div></div></div>
<div class="topbar-right">
<div class="topbar-undo-redo">
<button class="undo-btn" disabled aria-label="撤销"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 10h10a5 5 0 015 5v2"/><polyline points="3 10 7 6"/><polyline points="3 10 7 14"/></svg></button>
<button class="redo-btn" disabled aria-label="重做"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10H11a5 5 0 00-5 5v2"/><polyline points="21 10 17 6"/><polyline points="21 10 17 14"/></svg></button>
</div>
<div class="autosave-status" aria-live="polite"><span class="autosave-dot"></span><span>已保存</span></div>
<button class="topbar-btn"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 12v6h14v-6"/><polyline points="14 6 10 2 6 6"/><line x1="10" y1="2" x2="10" y2="13"/></svg></button>
<button class="topbar-btn"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="10" cy="10" r="3"/><path d="M10 1v2M10 17v2M3.2 3.2l1.4 1.4M15.4 15.4l1.4 1.4M1 10h2M17 10h2M3.2 16.8l1.4-1.4M15.4 4.6l1.4-1.4"/></svg></button>
<button class="save-btn">保存</button>
</div>
</div>
<div class="editor-body">
<div class="tool-strip">
<button class="strip-btn active" onclick="switchRightPanel('stickers',this)"><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><span>贴纸</span></button>
<button class="strip-btn" onclick="switchRightPanel('brush',this)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 19l7-7 3 3-7 7-3-3z"/><path d="M18 13l-1.5-7.5L2 2l3.5 14.5L13 18l5-5z"/><path d="M2 2l7.586 7.586"/></svg><span>画笔</span></button>
<button class="strip-btn" onclick="switchRightPanel('templates',this)"><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><span>模板</span></button>
<button class="strip-btn" onclick="switchRightPanel('tags',this)"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M20.59 13.41l-7.17 7.17a2 2 0 01-2.83 0L2 12V2h10l8.59 8.59a2 2 0 010 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg><span>标签</span></button>
<div class="strip-divider"></div>
<button class="strip-btn"><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="2"/><circle cx="8.5" cy="8.5" r="1.5"/><polyline points="21 15 16 10 5 21"/></svg><span>照片</span></button>
<button class="strip-btn"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M4 7V4h16v3"/><path d="M9 20h6"/><path d="M12 4v16"/></svg><span>文字</span></button>
<div class="strip-divider"></div>
<button class="strip-btn"><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="2"/><path d="M3 9h18"/><path d="M9 21V9"/></svg><span>背景</span></button>
</div>
<div class="canvas-wrapper">
<div class="canvas-paper">
<div class="canvas-grid"></div>
<div class="washi-tape"></div>
<div class="placed-sticker" style="top:12px;left:12px">🌸</div>
<div class="placed-sticker" style="top:200px;right:20px"></div>
<div class="journal-content">
<input class="journal-title" type="text" value="图书馆的午后时光" placeholder="给日记起个标题...">
<div class="format-bar">
<button class="format-btn active" style="font-weight:800">B</button>
<button class="format-btn" style="font-style:italic">I</button>
<button class="format-btn" style="text-decoration:underline">U</button>
<button class="format-btn">S</button>
<div class="format-divider"></div>
<div class="color-dot active" style="background:#2D2420"></div>
<div class="color-dot" style="background:var(--accent)"></div>
<div class="color-dot" style="background:var(--secondary)"></div>
<div class="color-dot" style="background:#5B7DB1"></div>
<div class="color-dot" style="background:var(--rose)"></div>
<div class="format-divider"></div>
<button class="format-btn"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><rect x="1" y="3" width="14" height="2" rx="1"/><rect x="1" y="7" width="10" height="2" rx="1"/><rect x="1" y="11" width="6" height="2" rx="1"/></svg></button>
</div>
<textarea class="journal-body" rows="12">今天下午去图书馆自习,找了一个靠窗的位置。阳光从窗外洒进来,落在摊开的高数课本上,暖暖的。
不知不觉就学了三个小时,中间喝了一杯抹茶拿铁☕。虽然期末压力大,但看到窗外的樱花还在开,觉得一切都会好的。
晚上回宿舍路上,买了喜欢的草莓蛋糕犒劳自己 🍰
回到宿舍打开台灯,在日记本上贴了一张今天在校园里捡到的银杏叶,黄黄的好好看。希望能一直保持这种小确幸的感觉。</textarea>
<div class="placed-photo"><div style="text-align:center;color:var(--secondary)"><svg width="40" height="40" viewBox="0 0 32 32" fill="none" stroke="currentColor" stroke-width="1.5" style="margin-bottom:4px"><rect x="4" y="6" width="24" height="20" rx="3"/><circle cx="12" cy="14" r="3"/><path d="M4 22l6-6 4 4 6-8 8 10"/></svg><div style="font-size:14px">图书馆窗边的阳光 ☀</div></div></div>
</div>
</div>
</div>
<div class="tool-panel-side">
<div id="panelStickers">
<div class="panel-header"><button class="panel-tab active">贴纸</button><button class="panel-tab">模板</button><button class="panel-tab">背景</button></div>
<div class="panel-content">
<div class="panel-sub-tabs"><button class="sub-tab">热门</button><button class="sub-tab active">可爱</button><button class="sub-tab">植物</button><button class="sub-tab">天气</button><button class="sub-tab">节日</button><button class="sub-tab">校园</button><button class="sub-tab">手绘</button></div>
<div class="sticker-grid">
<div class="sticker-item">🌸</div><div class="sticker-item"></div><div class="sticker-item">🌿</div><div class="sticker-item">☀️</div><div class="sticker-item">🌙</div><div class="sticker-item">🍰</div><div class="sticker-item">📚</div><div class="sticker-item">🎵</div><div class="sticker-item">💡</div><div class="sticker-item">🎀</div><div class="sticker-item">🍂</div><div class="sticker-item"></div><div class="sticker-item">🌈</div><div class="sticker-item">✏️</div><div class="sticker-item">🦋</div><div class="sticker-item">🐱</div><div class="sticker-item">🎈</div><div class="sticker-item">🌻</div><div class="sticker-item">🎨</div><div class="sticker-item">🍀</div><div class="sticker-item">🎊</div><div class="sticker-item">💧</div><div class="sticker-item">🌙</div><div class="sticker-item">💌</div><div class="sticker-item">🐱</div>
</div>
</div>
</div>
<div id="panelBrush" style="display:none">
<div class="panel-header"><span style="font-family:var(--font-display);font-size:var(--text-base);font-weight:600;color:var(--fg)">画笔</span></div>
<div class="panel-content">
<div class="brush-section-title">工具</div>
<div class="brush-tools-row">
<button class="brush-tool-btn active" data-tool="pen" onclick="selectBrushTool(this,'pen')" title="钢笔"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3l4 4L7 21H3v-4L17 3z"/></svg></button>
<button class="brush-tool-btn" data-tool="pencil" onclick="selectBrushTool(this,'pencil')" title="铅笔"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 20l1.5-5.5L18 2l4 4L9.5 18.5 4 20z"/><path d="M15 5l4 4"/></svg></button>
<button class="brush-tool-btn" data-tool="marker" onclick="selectBrushTool(this,'marker')" title="马克笔"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="3" width="14" height="8" rx="2" transform="rotate(45 13 7)"/><path d="M4 20l3-7"/></svg></button>
<button class="brush-tool-btn" data-tool="eraser" onclick="selectBrushTool(this,'eraser')" title="橡皮擦"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20H9L3.5 14.5a2 2 0 010-2.83l9.17-9.17a2 2 0 012.83 0L20 7"/><path d="M6 12l6 6"/></svg></button>
</div>
<div class="brush-section-title">粗细</div>
<div class="brush-size-row">
<span class="brush-size-label">px</span>
<input type="range" class="brush-slider" id="brushSizeSlider" min="1" max="20" value="2">
<input type="number" class="brush-size-input" id="brushSizeInput" value="2" min="1" max="20">
</div>
<div class="brush-section-title">颜色</div>
<div class="brush-colors-grid">
<div class="brush-color-dot active" style="background:#2D2420" data-color="#2D2420" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--accent)" data-color="#E07A5F" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--secondary)" data-color="#81B29A" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--tertiary)" data-color="#F2CC8F" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:var(--rose)" data-color="#D4A5A5" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#5B8FB9" data-color="#5B8FB9" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#9B72AA" data-color="#9B72AA" onclick="selectBrushColor(this)"></div>
<div class="brush-color-dot" style="background:#C93D3D" data-color="#C93D3D" onclick="selectBrushColor(this)"></div>
</div>
<div class="brush-color-custom">
<input type="color" id="brushCustomColor" value="#2D2420">
<span class="brush-color-custom-label">自定义颜色</span>
</div>
<div class="brush-opacity-row disabled" id="brushOpacityRow">
<span class="brush-opacity-label">透明度</span>
<input type="range" class="brush-slider" id="brushOpacitySlider" min="0" max="100" value="50">
<input type="number" class="brush-opacity-input" id="brushOpacityInput" value="50" min="0" max="100">
<span style="font-size:var(--text-xs);color:var(--muted)">%</span>
</div>
<div class="brush-section-title">快捷键</div>
<div class="brush-shortcuts">
<div class="brush-shortcut-item"><span>画笔工具</span><span class="brush-shortcut-key">B</span></div>
<div class="brush-shortcut-item"><span>橡皮擦</span><span class="brush-shortcut-key">E</span></div>
<div class="brush-shortcut-item"><span>减小粗细</span><span class="brush-shortcut-key">[</span></div>
<div class="brush-shortcut-item"><span>增大粗细</span><span class="brush-shortcut-key">]</span></div>
</div>
</div>
</div>
<div id="panelTemplates" style="display:none">
<div class="panel-header"><button class="panel-tab active">模板</button></div>
<div class="panel-content">
<div class="panel-sub-tabs"><button class="sub-tab active">日视图</button><button class="sub-tab">周视图</button><button class="sub-tab">月视图</button></div>
<div class="template-preview">
<div class="template-thumb"><div class="icon">📝</div><div class="name">简约日记</div></div>
<div class="template-thumb"><div class="icon">🌸</div><div class="name">手账风</div></div>
<div class="template-thumb"><div class="icon">📊</div><div class="name">数据日记</div></div>
<div class="template-thumb"><div class="icon">🎨</div><div class="name">自由画布</div></div>
</div>
</div>
</div>
<div id="panelTags" style="display:none">
<div class="panel-header"><span style="font-family:var(--font-display);font-size:var(--text-base);font-weight:600;color:var(--fg)">标签</span></div>
<div class="panel-content">
<div class="tags-section">
<div class="brush-section-title">已选标签</div>
<div class="tag-selected-area" id="tagSelectedArea">
<span class="tag-pill">#图书馆<span class="remove" aria-label="删除标签 图书馆" role="button" onclick="this.parentElement.remove()">&times;</span></span>
<span class="tag-pill">#学习<span class="remove" aria-label="删除标签 学习" role="button" onclick="this.parentElement.remove()">&times;</span></span>
</div>
</div>
<div class="tags-section">
<div class="brush-section-title">添加标签</div>
<div class="tag-input-row">
<input class="tag-input" type="text" id="tagInput" placeholder="输入标签后回车添加..." autocomplete="off" aria-label="输入新标签" onkeydown="handleTagInput(event)">
</div>
</div>
<div class="tags-section">
<div class="brush-section-title">推荐标签</div>
<div class="tag-suggest-grid">
<button class="tag-suggest-item" aria-label="添加标签 日常" onclick="addSuggestedTag(this)">#日常</button>
<button class="tag-suggest-item" aria-label="添加标签 学习" onclick="addSuggestedTag(this)">#学习</button>
<button class="tag-suggest-item" aria-label="添加标签 读书" onclick="addSuggestedTag(this)">#读书</button>
<button class="tag-suggest-item" aria-label="添加标签 运动" onclick="addSuggestedTag(this)">#运动</button>
<button class="tag-suggest-item" aria-label="添加标签 旅行" onclick="addSuggestedTag(this)">#旅行</button>
<button class="tag-suggest-item" aria-label="添加标签 美食" onclick="addSuggestedTag(this)">#美食</button>
<button class="tag-suggest-item" aria-label="添加标签 心情" onclick="addSuggestedTag(this)">#心情</button>
<button class="tag-suggest-item" aria-label="添加标签 灵感" onclick="addSuggestedTag(this)">#灵感</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="desktop-statusbar">
<div class="traffic-lights"><div class="dot" style="background:#FF5F57"></div><div class="dot" style="background:#FEBC2E"></div><div class="dot" style="background:#28C840"></div></div>
<span>暖记 — 手账编辑器</span>
<span style="font-variant-numeric:tabular-nums">14:32</span>
</div>
<script>
function switchRightPanel(name,stripBtn){var s=document.querySelectorAll('.strip-btn');for(var i=0;i<s.length;i++)s[i].classList.remove('active');stripBtn.classList.add('active');var p=['panelStickers','panelBrush','panelTemplates','panelTags'];var n=['stickers','brush','templates','tags'];for(var i=0;i<p.length;i++){var el=document.getElementById(p[i]);if(el)el.style.display=n[i]===name?'':'none';}}
function selectBrushTool(btn,tool){var b=document.querySelectorAll('.brush-tool-btn');for(var i=0;i<b.length;i++)b[i].classList.remove('active');btn.classList.add('active');var d={pen:2,pencil:3,marker:8,eraser:10};var v=d[tool]||2;document.getElementById('brushSizeSlider').value=v;document.getElementById('brushSizeInput').value=v;var o=document.getElementById('brushOpacityRow');if(tool==='marker'){o.classList.remove('disabled');}else{o.classList.add('disabled');}}
function selectBrushColor(dot){var d=document.querySelectorAll('.brush-color-dot');for(var i=0;i<d.length;i++)d[i].classList.remove('active');dot.classList.add('active');document.getElementById('brushCustomColor').value=dot.getAttribute('data-color');}
document.getElementById('brushSizeSlider').addEventListener('input',function(){document.getElementById('brushSizeInput').value=this.value;});
document.getElementById('brushSizeInput').addEventListener('input',function(){var v=Math.min(20,Math.max(1,parseInt(this.value)||1));document.getElementById('brushSizeSlider').value=v;});
document.getElementById('brushOpacitySlider').addEventListener('input',function(){document.getElementById('brushOpacityInput').value=this.value;});
document.getElementById('brushOpacityInput').addEventListener('input',function(){var v=Math.min(100,Math.max(0,parseInt(this.value)||0));document.getElementById('brushOpacitySlider').value=v;});
document.getElementById('brushCustomColor').addEventListener('input',function(){var d=document.querySelectorAll('.brush-color-dot');for(var i=0;i<d.length;i++)d[i].classList.remove('active');});
function handleTagInput(e){if(e.key==='Enter'){var input=e.target;var text=input.value.trim();if(text){if(!text.startsWith('#'))text='#'+text;var area=document.getElementById('tagSelectedArea');var pill=document.createElement('span');pill.className='tag-pill';pill.innerHTML=text+'<span class="remove" aria-label="删除标签 '+text.slice(1)+'" role="button" onclick="this.parentElement.remove()">&times;</span>';area.appendChild(pill);input.value='';}}}
function addSuggestedTag(btn){var text=btn.textContent.trim();var area=document.getElementById('tagSelectedArea');var pill=document.createElement('span');pill.className='tag-pill';pill.innerHTML=text+'<span class="remove" aria-label="删除标签 '+text.slice(1)+'" role="button" onclick="this.parentElement.remove()">&times;</span>';area.appendChild(pill);btn.style.display='none';}
</script>
<script src="../../js/theme-switcher.js"></script>
</body>
</html>