记一下弹窗压到半屏以内:标题一行、今天卡合成一条、宫格5列;修关闭弹窗阴影漏到屏幕底部 (v26100182)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
50
js/app.js
50
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 ? '<img class="a-ico" src="' + ico + '" alt="" loading="lazy">' : '<span class="a-ico a-ico-letter" style="background:' + bg + '">' + name.slice(0, 1) + '</span>';
|
||||
return '<button class="app ripple" data-url="' + encodeURIComponent(a.url) + '" data-id="' + encodeURIComponent(a.identifier || '') + '">' + img + name + '</button>';
|
||||
return '<button class="app ripple" data-url="' + encodeURIComponent(a.url) + '" data-id="' + encodeURIComponent(a.identifier || '') + '">' + img + '<span class="a-n">' + name + '</span></button>';
|
||||
}).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 ? '<img alt="" loading="lazy">' : '<span class="sk-l"></span>') + '<b></b><em></em><span class="sk-go">去记 ›</span>';
|
||||
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 里那条首屏占位同构 */
|
||||
|
||||
Reference in New Issue
Block a user