diff --git a/static/app.js b/static/app.js index 060f947..9977df5 100644 --- a/static/app.js +++ b/static/app.js @@ -388,6 +388,14 @@ addEveningRow('', ''); }; + /* 切换卡片编辑模式 */ + window.toggleEditMode = function(btn) { + var card = btn.closest('.card'); + if (!card) return; + var editing = card.classList.toggle('editing'); + btn.classList.toggle('active', editing); + }; + /* ================================================================ Load & Auto Save Checkin ================================================================ */ diff --git a/static/style.css b/static/style.css index 09902c1..bd3abdf 100644 --- a/static/style.css +++ b/static/style.css @@ -492,16 +492,57 @@ body { .card-head { display: flex; align-items: center; - gap: 8px; + justify-content: space-between; margin-bottom: 4px; } +.card-head-left { + display: flex; + align-items: center; + gap: 8px; +} + .card-head h3 { font-size: 14px; font-weight: 600; color: var(--text); } +/* ── 编辑模式切换按钮 ── */ + +.btn-edit-toggle { + display: flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + border: none; + background: transparent; + color: var(--text-muted); + border-radius: 6px; + cursor: pointer; + transition: all 0.2s; + flex-shrink: 0; +} + +.btn-edit-toggle:hover { + background: var(--bg); + color: var(--primary); +} + +.btn-edit-toggle.active { + background: var(--primary-light); + color: var(--primary); +} + +/* 编辑模式下才显示的元素 */ +.edit-only { display: none; } +.card.editing .edit-only { display: flex; } +.card.editing .btn-del { display: inline-flex; } + +/* 默认隐藏删除按钮 */ +.btn-del { display: none; } + .icon-h2 { width: 16px; height: 16px; @@ -568,7 +609,6 @@ body { line-height: 1; border-radius: 6px; transition: background 0.2s; - display: inline-flex; align-items: center; } diff --git a/templates/icons.html b/templates/icons.html index edc1e4e..a79d318 100644 --- a/templates/icons.html +++ b/templates/icons.html @@ -63,4 +63,8 @@ + + + + diff --git a/templates/index.html b/templates/index.html index 92d5faa..e18a9c3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -104,23 +104,33 @@
- -

早间立志

+
+ +

早间立志

+
+

今天最重要的 1~3 件事

-
- -

责善 · 改过

+
+ +

责善 · 改过

+
+

今天犯的错 & 改进方案(最多5条)

-