From ebdb8cda3b8e4f10280675861fffd44fb88fdf57 Mon Sep 17 00:00:00 2001 From: mac Date: Tue, 2 Jun 2026 10:56:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=AB=8B=E5=BF=97/=E6=94=B9=E8=BF=87?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E5=A2=9E=E5=8A=A0=E7=BC=96=E8=BE=91=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=88=87=E6=8D=A2=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/app.js | 8 ++++++++ static/style.css | 44 ++++++++++++++++++++++++++++++++++++++++++-- templates/icons.html | 4 ++++ templates/index.html | 22 ++++++++++++++++------ 4 files changed, 70 insertions(+), 8 deletions(-) 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条)

-