From d62337953f034fa567096f92f78ca7b09c52b339 Mon Sep 17 00:00:00 2001 From: Karlcarlo Date: Fri, 2 Oct 2026 11:57:43 +0000 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E4=B8=80=E4=B8=8B=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E5=8E=8B=E5=88=B0=E5=8D=8A=E5=B1=8F=E4=BB=A5=E5=86=85=EF=BC=9A?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E4=B8=80=E8=A1=8C=E3=80=81=E4=BB=8A=E5=A4=A9?= =?UTF-8?q?=E5=8D=A1=E5=90=88=E6=88=90=E4=B8=80=E6=9D=A1=E3=80=81=E5=AE=AB?= =?UTF-8?q?=E6=A0=BC5=E5=88=97=EF=BC=9B=E4=BF=AE=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E9=98=B4=E5=BD=B1=E6=BC=8F=E5=88=B0=E5=B1=8F?= =?UTF-8?q?=E5=B9=95=E5=BA=95=E9=83=A8=20(v26100182)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- index.html | 13 ++++++------- js/app.js | 50 ++++++++++++++++++-------------------------------- mama-box.css | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 39 deletions(-) diff --git a/index.html b/index.html index eff001c..a8303bc 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ 兜爸心选 · 孕育陪伴 - + @@ -1550,7 +1550,7 @@

— · 今天已记 4 条

- +
+
+
-
-
先记这件花一分钟就好
-
-
-
全部孕期工具
+
全部孕期工具
diff --git a/js/app.js b/js/app.js index 5955b7b..86c6f5e 100644 --- a/js/app.js +++ b/js/app.js @@ -3,7 +3,7 @@ (function () { 'use strict'; /* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */ - var VER = '26100181'; + var VER = '26100182'; const $ = (s, c) => (c || document).querySelector(s); const $$ = (s, c) => Array.from((c || document).querySelectorAll(s)); @@ -338,7 +338,7 @@ ⚠️ colorTheme 目前全是 'blue' 颜色名 —— 有图时别拿它当底色,否则清一色蓝。 */ const bg = ico ? 'background:#fff' : 'background:' + (a.colorTheme || appTileColor(name)); const img = ico ? '' : '' + name.slice(0, 1) + ''; - return ''; + return ''; }).join(''); /* 磁贴点击(事件委托,innerHTML 重建后不用重绑) */ grid.onclick = function (e) { @@ -4662,12 +4662,12 @@ sheetPaint = function () { const n = new Date(Date.now() + 8 * 3600e3); // 北京时间 const wd = '日一二三四五六'[n.getUTCDay()]; - const wk = state.week ? '孕 ' + state.week + ' 周' + (state.day ? ' +' + state.day + ' 天' : '') + ' · ' : ''; + const wk = state.week ? '孕' + state.week + '周' + (state.day ? '+' + state.day + '天' : '') + ' · ' : ''; $('#skSub').textContent = wk + (n.getUTCMonth() + 1) + '月' + n.getUTCDate() + '日 周' + wd; const r = _fpMode === 'rows' || _fpMode === 'guide' ? (_fpData || {}) : null; - const today = $('#skToday'), next = $('#skNext'); + const today = $('#skToday'), go = $('#skGo'); today.classList.toggle('hide', !r); - next.classList.add('hide'); + go.classList.add('hide'); $$('#appsGrid .app').forEach(b => b.classList.remove('is-done')); if (!r) return; const used = (r.used || []).filter(u => u.appName), unused = r.unused || []; @@ -4676,36 +4676,22 @@ $('#skNum').textContent = used.length; $('#skArc').style.strokeDasharray = (total ? used.length / total * 113.1 : 0).toFixed(1) + ' 113.1'; $('#skLine').textContent = used.length ? '今天已经记了 ' + used.length + ' 项' : '今天还没有记录'; - const done = $('#skDone'); - done.textContent = ''; - if (used.length) { - used.slice(0, 4).forEach(u => { const c = document.createElement('i'); c.textContent = u.appName; done.appendChild(c); }); - if (used.length > 4) done.append('等 ' + used.length + ' 项'); - } else done.textContent = '记下一笔,就是' + nm + '今天的第一只小脚丫'; - /* 宫格里今天用过的工具打个小勾 */ + /* 宫格里今天用过的工具打个小勾(代替原来那排「已记」小胶囊) */ const usedIds = new Set(used.map(u => u.identifier).filter(Boolean)); $$('#appsGrid .app').forEach(b => { if (usedIds.has(decodeURIComponent(b.dataset.id || ''))) b.classList.add('is-done'); }); - /* 先记这件:前 2 个还没用的 */ - const box = $('#skCards'); - box.innerHTML = ''; - unused.slice(0, 2).forEach((u, i) => { + /* 下一件:第一个还没用、且有链接的工具 */ + const done = $('#skDone'); + let nx = null; + for (const u of unused) { const ident = u.identifier || '', app = ident ? APP_BY_ID[ident] : null; - const href = u.url || (app && app.url) || ''; - const name = u.appName || (app && app.name) || ''; - if (!href || !name) return; - const [t, d] = todoLine(name); - const logo = (app && (app.logo || app.icon)) || ''; - const c = document.createElement('button'); - c.type = 'button'; - c.className = 'sk-card ripple c' + i; - c.innerHTML = (logo ? '' : '') + '去记 ›'; - if (logo) c.querySelector('img').src = logo; else c.querySelector('.sk-l').textContent = name.slice(0, 1); - c.querySelector('b').textContent = t; - c.querySelector('em').textContent = d; - c.addEventListener('click', () => jumpApp(href, (app && app.identifier) || ident)); - box.appendChild(c); - }); - next.classList.toggle('hide', !box.childElementCount); + const href = u.url || (app && app.url) || '', name = u.appName || (app && app.name) || ''; + if (href && name) { nx = { href, name, id: (app && app.identifier) || ident }; break; } + } + if (nx) { + done.textContent = '下一件:' + todoLine(nx.name)[0]; + go.classList.remove('hide'); + go.onclick = () => jumpApp(nx.href, nx.id); + } else done.textContent = used.length ? '今天要记的都记好啦' : '记下一笔,就是' + nm + '今天的第一只小脚丫'; }; /* 加载中的中性占位(不是假数据):与 index.html 里那条首屏占位同构 */ diff --git a/mama-box.css b/mama-box.css index 0203820..d85cde8 100644 --- a/mama-box.css +++ b/mama-box.css @@ -4063,3 +4063,35 @@ a.skip:focus{left:16px;top:16px} /* 2026-10-02 用户:入口星星小一点、少一点,别挡住「X周孕妈悄悄话」那行字 —— 星星只放在文字行之间 / 四周空处(见 index.html),不再放大 */ .we-sky i{transform:scale(1);opacity:.85;filter:drop-shadow(0 0 1.5px rgba(255,255,255,.6))} @keyframes weTw{0%,100%{opacity:.9;transform:scale(1)}50%{opacity:.2;transform:scale(.55)}} + +/* ================= 「记一下」弹窗压到半屏以内(2026-10-02 二改)================= + 用户:「弹出的框尽量别超过 1/2」。标题一行、今天卡合成一条细条、宫格 5 列小图标;工具多了宫格自己滚。 */ +.sheet{max-height:50%} +.sheet-grip{padding:8px 0 2px} +.sheet-head{align-items:center;padding:4px 18px 10px 22px} +.sheet-head>div{display:flex;align-items:baseline;gap:10px;min-width:0} +.sheet-head h2{font-size:19px;letter-spacing:0;flex:none} +.sheet-head p.sk-sub{margin:0;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.sheet-close{width:30px;height:30px;font-size:0} +.sheet-scroll{padding:0 16px calc(12px + env(safe-area-inset-bottom))} +.sk-today{gap:10px;margin:0 2px 14px;padding:9px 10px 9px 12px;border-radius:16px} +.sk-ring{width:36px;height:36px} +.sk-ring circle{stroke-width:5} +.sk-ring b{font-size:14px} +.sk-tt{gap:2px} +.sk-tt>b{font-size:14px} +.sk-tt>span{display:block;font-size:11.5px;line-height:1.4;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.sk-today .sk-go{flex:none;margin:0;padding:0 14px;height:30px;border-radius:99px;font-size:12.5px;font-weight:700;color:#fff; + background:linear-gradient(135deg,#F09A80,#E07560);box-shadow:0 4px 10px rgba(224,117,96,.28)} +.sk-today .sk-go.hide{display:none} +.sk-today .sk-go:active{transform:scale(.94)} +.apps-grid{grid-template-columns:repeat(5,1fr);grid-auto-rows:auto;gap:14px 4px;align-content:start} +.apps-grid .app{gap:5px;font-size:11px;min-width:0;line-height:1.25} +.apps-grid .app .a-ico{width:42px;height:42px} +.apps-grid .a-ico-letter{width:42px;border-radius:14px;font-size:17px} +.apps-grid .a-n{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10.5px;letter-spacing:-.4px} +.apps-grid .app.is-done::after{top:-4px;right:calc(50% - 27px);width:15px;height:15px;background-size:10px} +#appsGrid{grid-auto-rows:auto;max-height:none;overflow:visible;padding:6px 0 0} +/* 2026-10-02 修:关着的弹窗/弹层都停在屏幕下沿外(translateY(102%)),但向上的 box-shadow 会漏进屏幕底部约 30px, + 六七个叠起来就是底部一条发灰发糊的带子(压在「记一下」最后一行字和首页底部上)。关着时不要阴影。 */ +.modal:not(.show),.sheet:not(.show){box-shadow:none!important}