From 2de0cfb8de7441f80ee01e3e2d2baacf177c35fd Mon Sep 17 00:00:00 2001
From: nanhaoluo <3075912108@qq.com>
Date: Fri, 23 Jan 2026 13:09:56 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=86TODO=E6=8A=98=E5=8F=A0?=
=?UTF-8?q?=E6=8C=89=E9=92=AE=E7=A7=BB=E8=87=B3=E6=9C=AA=E5=AE=8C=E6=88=90?=
=?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B8=8B=E6=96=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 折叠按钮现在作为已完成任务区域的分隔栏显示
- 分隔栏包含已完成图标、文字和数量徽章
- 点击分隔栏可折叠/展开已完成任务
- 桌面端和移动端都采用相同的设计
- 优化了视觉层次,更符合用户使用习惯
---
argontheme.js | 12 ++---
sidebar.php | 142 ++++++++++++++++++++++++++++++--------------------
style.css | 113 +++++++++++++++++++++++++++++++++++++++
3 files changed, 204 insertions(+), 63 deletions(-)
diff --git a/argontheme.js b/argontheme.js
index 2a85de9..41fc4d3 100644
--- a/argontheme.js
+++ b/argontheme.js
@@ -3203,14 +3203,14 @@ $(document).on("click" , "#blog_categories .tag" , function(){
// 同步更新桌面端计数
$(".todo-count").text(count);
- // 更新折叠按钮
- var collapseBtn = $("#mobile-todo-collapse-btn");
- if (collapseBtn.length) {
- collapseBtn.find(".mobile-todo-completed-count").text(completedCount);
+ // 更新分隔栏的已完成数量
+ var divider = $("#mobile-todo-collapse-btn");
+ if (divider.length) {
+ divider.find(".mobile-todo-completed-count").text(completedCount);
if (completedCount > 0) {
- collapseBtn.show();
+ divider.show();
} else {
- collapseBtn.hide();
+ divider.hide();
}
}
}
diff --git a/sidebar.php b/sidebar.php
index 7208d17..a1632f9 100644
--- a/sidebar.php
+++ b/sidebar.php
@@ -165,15 +165,6 @@ $author_desc = get_option('argon_sidebar_author_description');
- 0) :
- ?>
-
-
@@ -191,28 +182,22 @@ $author_desc = get_option('argon_sidebar_author_description');
-
-
+
-
-
-
-
-
-
-
-
-
+
@@ -224,6 +209,34 @@ $author_desc = get_option('argon_sidebar_author_description');
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- 0) : ?>
-
-
@@ -887,28 +894,22 @@ $author_desc = get_option('argon_sidebar_author_description');
-
-
+
-
-
-
-
-
-
-
-
-
+
@@ -920,7 +921,34 @@ $author_desc = get_option('argon_sidebar_author_description');
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
0) {
- collapseBtn.style.display = 'flex';
+ divider.style.display = 'flex';
} else {
- collapseBtn.style.display = 'none';
+ divider.style.display = 'none';
}
}
diff --git a/style.css b/style.css
index f26533e..c3dd550 100644
--- a/style.css
+++ b/style.css
@@ -11053,6 +11053,63 @@ html.darkmode.amoled-dark #content:after {
min-width: 10px;
text-align: center;
}
+
+ /* 移动端已完成任务分隔栏 */
+ .mobile-todo-completed-divider {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 8px 12px;
+ margin: 8px 0 6px;
+ background: var(--color-foreground);
+ border-radius: 10px;
+ cursor: pointer;
+ transition: all var(--animation-fast) var(--ease-standard);
+ user-select: none;
+ border-top: 1px dashed rgba(var(--themecolor-rgbstr), 0.2);
+ border-bottom: 1px dashed rgba(var(--themecolor-rgbstr), 0.2);
+ list-style: none;
+ }
+
+ .mobile-todo-completed-divider:active {
+ background: rgba(var(--themecolor-rgbstr), 0.08);
+ transform: scale(0.98);
+ }
+
+ .mobile-todo-completed-divider .divider-text {
+ display: flex;
+ align-items: center;
+ gap: 5px;
+ font-size: 11px;
+ font-weight: 600;
+ color: #6c757d;
+ }
+
+ .mobile-todo-completed-divider .divider-text i {
+ color: #28a745;
+ font-size: 10px;
+ }
+
+ .mobile-todo-completed-divider .mobile-todo-completed-count {
+ background: rgba(40, 167, 69, 0.15);
+ color: #28a745;
+ font-size: 9px;
+ font-weight: 600;
+ padding: 2px 5px;
+ border-radius: 6px;
+ min-width: 16px;
+ text-align: center;
+ }
+
+ .mobile-todo-completed-divider .divider-arrow {
+ font-size: 9px;
+ color: #6c757d;
+ transition: transform var(--animation-fast) var(--ease-standard);
+ }
+
+ .mobile-todo-completed-divider.collapsed .divider-arrow {
+ transform: rotate(-90deg);
+ }
#navbar_global {
background: var(--color-foreground);
@@ -12652,6 +12709,62 @@ html.navbar-absolute #leftbar_part3.sticky {
text-align: center;
}
+/* 已完成任务分隔栏 */
+.todo-completed-divider {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 8px 10px;
+ margin: 8px 0 6px;
+ background: var(--color-foreground);
+ border-radius: 8px;
+ cursor: pointer;
+ transition: all var(--animation-fast) var(--ease-standard);
+ user-select: none;
+ border-top: 1px dashed rgba(var(--themecolor-rgbstr), 0.2);
+ border-bottom: 1px dashed rgba(var(--themecolor-rgbstr), 0.2);
+ list-style: none;
+}
+
+.todo-completed-divider:hover {
+ background: rgba(var(--themecolor-rgbstr), 0.05);
+}
+
+.todo-completed-divider .divider-text {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ font-size: 12px;
+ font-weight: 600;
+ color: #6c757d;
+}
+
+.todo-completed-divider .divider-text i {
+ color: #28a745;
+ font-size: 11px;
+}
+
+.todo-completed-divider .todo-completed-count {
+ background: rgba(40, 167, 69, 0.15);
+ color: #28a745;
+ font-size: 10px;
+ font-weight: 600;
+ padding: 2px 6px;
+ border-radius: 6px;
+ min-width: 18px;
+ text-align: center;
+}
+
+.todo-completed-divider .divider-arrow {
+ font-size: 10px;
+ color: #6c757d;
+ transition: transform var(--animation-fast) var(--ease-standard);
+}
+
+.todo-completed-divider.collapsed .divider-arrow {
+ transform: rotate(-90deg);
+}
+
/* 站长端:显示未完成数�?*/
.todo-count::before {
content: '';