From 36b58a8b7355348dab5e2507d148d548f35fa657 Mon Sep 17 00:00:00 2001 From: mac Date: Fri, 24 Jul 2026 16:34:20 +0800 Subject: [PATCH] =?UTF-8?q?v2.0.2=20=E2=80=94=20=E6=AF=8F=E5=91=A8?= =?UTF-8?q?=E6=89=93=E5=8D=A1=E4=B8=89=E5=8D=A1=E7=89=87=E6=94=B9=E4=B8=BA?= =?UTF-8?q?Tab=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/app.js | 10 +++++++++ static/style.css | 48 ++++++++++++++++++++++++++------------------ templates/index.html | 17 +++++++++++++--- 3 files changed, 52 insertions(+), 23 deletions(-) diff --git a/static/app.js b/static/app.js index 012eb64..dbab48c 100644 --- a/static/app.js +++ b/static/app.js @@ -441,6 +441,16 @@ btn.classList.toggle('active', editing); }; + /* 切换每周打卡 Tab */ + window.switchDailyTab = function(btn) { + var tab = btn.dataset.tab; + document.querySelectorAll('.daily-tab').forEach(function(t){ t.classList.remove('active'); }); + btn.classList.add('active'); + document.querySelectorAll('.daily-card').forEach(function(c){ c.classList.remove('active'); }); + var card = document.querySelector('.daily-card[data-card="' + tab + '"]'); + if (card) card.classList.add('active'); + }; + /* ================================================================ Load & Auto Save Checkin ================================================================ */ diff --git a/static/style.css b/static/style.css index c50f94e..0166e3b 100644 --- a/static/style.css +++ b/static/style.css @@ -456,29 +456,38 @@ body { ═══════════════════════════════════════════ */ .daily-grid { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16px; - margin-bottom: 20px; + display: block; } +.daily-card { display: none; } +.daily-card.active { display: block; } -/* 立志 — 左上 */ -.card-morning { - grid-column: 1; - grid-row: 1; +/* 每周打卡 Tab */ +.daily-tabs { + display: flex; + gap: 4px; + margin-bottom: 16px; + border-bottom: 1.5px solid var(--border); } - -/* 改过 — 左下 */ -.card-evening { - grid-column: 1; - grid-row: 2; -} - -/* 勤学 — 右列跨2行 */ -.card-study { - grid-column: 2; - grid-row: 1 / 3; +.daily-tab { + display: inline-flex; + align-items: center; + gap: 5px; + padding: 8px 16px; + border: none; + background: none; + font-size: 13px; + font-weight: 500; + color: var(--text-dim); + cursor: pointer; + border-bottom: 2px solid transparent; + margin-bottom: -1.5px; + transition: all 0.15s; + font-family: inherit; } +.daily-tab .icon-sm { opacity: 0.6; } +.daily-tab:hover { color: var(--text); } +.daily-tab.active { color: var(--primary); border-bottom-color: var(--primary); } +.daily-tab.active .icon-sm { opacity: 1; } /* ── Cards ── */ @@ -1405,7 +1414,6 @@ body { :root { --sidebar-w: 240px; } .main-content { padding: 20px 24px; } .daily-grid { grid-template-columns: 1fr; } - .card-morning, .card-evening, .card-study { grid-column: 1; grid-row: auto; } .weekly-overview { flex-direction: column; gap: 16px; text-align: center; } .week-days-grid { grid-template-columns: repeat(4, 1fr); } .history-grid { grid-template-columns: 1fr; } diff --git a/templates/index.html b/templates/index.html index 4f47a36..e3ccbba 100644 --- a/templates/index.html +++ b/templates/index.html @@ -133,8 +133,19 @@ +
+ + + +
-
+
@@ -150,7 +161,7 @@ 增加一条
-
+
@@ -166,7 +177,7 @@ 增加一条
-
+

勤学打卡