diff --git a/README.md b/README.md
index 40c39ea..92ff38d 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
# DevBox · 开发者工具箱
-一个开发者工具箱:300+ 个工具(图片转格式与加水印、哈希与 AES、JWT、时间戳、Cron、JSON、正则、Diff、颜色、CIDR、chmod、cURL 转代码……),外加**账号系统、积分计费和 CDK 兑换**,还有一个管理员后台。
+一个开发者工具箱:340+ 个工具(图片转格式与加水印、哈希与 AES、JWT、时间戳、Cron、JSON、正则、Diff、颜色、CIDR、chmod、cURL 转代码……),外加**账号系统、积分计费和 CDK 兑换**,还有一个管理员后台。
工具本身仍然在浏览器里算完,数据不出本机;只有「谁在用、还剩多少积分」记到服务端的 SQLite 里。零第三方依赖,一个 `node server.mjs` 就跑起来。
@@ -238,6 +238,8 @@ DB.tool({
## 更新日志
+- 2026-11-20 侧栏分组可折叠:每组标题带箭头和数量,点一下收起/展开(状态记在本地),搜索时自动全展开
+- 2026-11-20 第四批:补 28 个计时与提醒(番茄钟、煮蛋、Tabata、间隔提醒、久坐/护眼/吃药提醒、在线闹钟、整点报时、翻页时钟、时钟屏保、高考/考研/新年/生日倒计时、跳绳计数)
- 2026-11-20 第三批:工具数 270 → 313,补「画板/白板/看板/打卡/甘特/组织图、字幕位移与格式转换、语音合成与识别、音频测试与白噪音、白板与签名导出、代码转图片、提词器/速读、.ics 日历、邮箱/链接/号码提取」等
- 2026-11-20 首页加了「找工具」条:搜索框 + 分类小按钮(带数量),点分类立刻过滤
- 2026-11-20 参照 deertools.cn 大扩一轮:工具数 44 → 201,新增「随机 / 检测 / 办公 / 生活」分组
diff --git a/css/style.css b/css/style.css
index cfa94ca..f31ffc6 100644
--- a/css/style.css
+++ b/css/style.css
@@ -764,3 +764,13 @@ html, body { overflow-x: hidden; }
.meter { margin-top: 12px; height: 18px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.meter-in { height: 100%; width: 0; background: linear-gradient(90deg, #33d6a6, #5b8cff); transition: width .06s linear; }
.fullscreen-stage { position: fixed; inset: 0; z-index: 999; cursor: pointer; }
+
+/* 侧栏分组折叠 */
+.nav-title{display:flex;align-items:center;gap:8px;width:100%;background:none;border:0;cursor:pointer;
+ font:inherit;font-size:12px;letter-spacing:.08em;color:var(--muted);text-transform:uppercase;
+ padding:8px 10px;border-radius:8px}
+.nav-title:hover{background:var(--soft);color:var(--text)}
+.nav-caret{width:12px;flex:none;font-size:10px;opacity:.8}
+.nav-gname{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
+.nav-count{flex:none;font-size:11px;padding:1px 6px;border-radius:999px;background:var(--soft);color:var(--muted)}
+.nav-group.closed .nav-item{display:none}
diff --git a/index.html b/index.html
index ea54889..4279bbc 100644
--- a/index.html
+++ b/index.html
@@ -169,6 +169,7 @@
+
diff --git a/js/app.js b/js/app.js
index 056ec9f..1ad7725 100644
--- a/js/app.js
+++ b/js/app.js
@@ -15,15 +15,34 @@
const groupOf = (id) => groups.find((g) => g.id === id) || groups[0]
/* ---------------- 侧栏 ---------------- */
+ const NAV_CLOSED = 'devbox.navclosed'
+ const closedSet = () => {
+ try { return new Set(JSON.parse(localStorage.getItem(NAV_CLOSED) || '[]')) } catch (e) { return new Set() }
+ }
+ const toggleGroup = (id) => {
+ const set = closedSet()
+ if (set.has(id)) set.delete(id); else set.add(id)
+ localStorage.setItem(NAV_CLOSED, JSON.stringify([...set]))
+ renderNav(navSearch.value)
+ }
+
function renderNav(keyword = '') {
nav.textContent = ''
const kw = keyword.trim().toLowerCase()
+ const closed = closedSet()
let shown = 0
for (const g of groups) {
const list = tools.filter((t) => t.group === g.id && match(t, kw))
if (!list.length) continue
- const box = el('div', { class: 'nav-group' })
- box.append(el('div', { class: 'nav-title', text: g.name }))
+ /* 有关键词或当前工具在这一组时强制展开 */
+ const forceOpen = !!kw || list.some((t) => t.id === currentId)
+ const isClosed = !forceOpen && closed.has(g.id)
+ const box = el('div', { class: 'nav-group' + (isClosed ? ' closed' : '') })
+ const head = el('button', { class: 'nav-title', onclick: () => toggleGroup(g.id) })
+ head.append(el('span', { class: 'nav-caret', text: isClosed ? '▸' : '▾' }))
+ head.append(el('span', { class: 'nav-gname', text: g.name }))
+ head.append(el('span', { class: 'nav-count', text: String(list.length) }))
+ box.append(head)
for (const t of list) {
box.append(el('button', {
class: 'nav-item' + (currentId === t.id ? ' active' : ''),
diff --git a/js/cat-timers.js b/js/cat-timers.js
index 1a7b15b..8c34726 100644
--- a/js/cat-timers.js
+++ b/js/cat-timers.js
@@ -74,9 +74,19 @@
el('div', { class: 'row' }, btn('开始', start), btn('停止', () => { clearInterval(iv); iv = 0; st.textContent = '已停止' }, 'ghost')), btn('试听提醒音', () => beep(880)))
},
})
- DB.tool({ id: 'sit-reminder', name: '久坐提醒', group: 'time', icon: 'clock', desc: '每 45 分钟提醒起来活动', keywords: ['久坐', '提醒'], mount(r) { location.hash = '#/t/interval-timer'; r.append(el('p', { class: 'hint', text: '用「间隔提醒」设为 45 分钟即可。' })) } })
- DB.tool({ id: 'eye-rest-reminder', name: '护眼提醒', group: 'time', icon: 'clock', desc: '20-20-20 法则:每 20 分钟看 20 英尺外 20 秒', keywords: ['护眼', '眼睛'], mount(r) { location.hash = '#/t/interval-timer'; r.append(el('p', { class: 'hint', text: '用「间隔提醒」设为 20 分钟即可。' })) } })
- DB.tool({ id: 'medicine-reminder', name: '吃药提醒', group: 'time', icon: 'clock', desc: '按间隔提醒吃药', keywords: ['吃药', '用药'], mount(r) { location.hash = '#/t/interval-timer'; r.append(el('p', { class: 'hint', text: '用「间隔提醒」按医嘱设置间隔。' })) } })
+ /* 固定间隔提醒(久坐 / 护眼 / 吃药) */
+ function fixedReminder(id, name, desc, minutes, hint, keywords) {
+ DB.tool({ id, name, group: 'time', icon: 'clock', desc, keywords, mount(root) {
+ const st = el('div', { class: 'big-time', text: '未开启' }); let iv = 0, n = 0
+ const start = () => { if (iv) return; n = 0; iv = setInterval(() => { n++; st.textContent = '已提醒 ' + n + ' 次'; beep(880) }, minutes * 60000); st.textContent = '每 ' + minutes + ' 分钟提醒' }
+ root.append(pane(name), st, el('p', { class: 'hint', text: hint }),
+ el('div', { class: 'row' }, btn('开始', start), btn('停止', () => { clearInterval(iv); iv = 0; st.textContent = '已停止' }, 'ghost'), btn('试听', () => beep(880), 'ghost')))
+ } })
+ }
+ fixedReminder('sit-reminder', '久坐提醒', '每 45 分钟提醒起来活动一下', 45, '到点响铃,起来走两分钟。', ['久坐', '提醒'])
+ fixedReminder('eye-rest-reminder', '护眼提醒', '20-20-20 法则:每 20 分钟看 20 英尺外 20 秒', 20, '响铃后抬头看远处 20 秒。', ['护眼', '眼睛'])
+ fixedReminder('medicine-reminder', '吃药提醒', '按固定间隔提醒服药', 480, '按医嘱调整次数,一天两次就是 12 小时。', ['吃药', '用药'])
+
DB.tool({ id: 'online-alarm', name: '在线闹钟', group: 'time', icon: 'clock', desc: '设定几点几分响铃', keywords: ['闹钟', 'alarm'],
mount(root) {
const t = el('input', { type: 'time', class: 'inp', value: '08:00' }); const st = el('p', { class: 'hint', text: '未设置' }); let iv = 0