今日脚印改版(撕页日历+小脚丫时间线+宝宝便签),消消乐卡压矮

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 16:22:55 +00:00
parent da995ae540
commit 3f115bd37f
3 changed files with 145 additions and 83 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26100138';
var VER = '26100139';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -1373,6 +1373,7 @@
$('#dockTitle').textContent = babyWord('的孕育工具');
$('#abTag').textContent = babyWord('今天想说');
$('#tlTitle').textContent = babyWord('的今日脚印');
const _sg = $('#fpSign'); if (_sg) _sg.textContent = '—— 爱你的' + (state.babyName || '宝宝');
/* 整条时间轴自己是个 role="button",它的 aria-label 里也写着模块名。
只刷可见的 #tlTitle、把这句留在原地,读屏用户会一直听见上一个小名 ——
而这种不同步在屏幕上根本看不出来,只能靠这行和它的断言守着。 */
@@ -4033,6 +4034,12 @@
function fpApply(mode, r) { _fpMode = mode; _fpData = r || null; fpRender(); if (plHook) plHook(); }
function fpRender() {
const tl = document.querySelector('.today-line'), steps = $('#tlSteps'), guide = $('#tlGuide');
const _cd = $('#fpCalD');
if (_cd) {
const n = new Date();
_cd.textContent = (n.getDate() < 10 ? '0' : '') + n.getDate();
$('#fpCalM').textContent = (n.getMonth() + 1) + '月 · 周' + '日一二三四五六'[n.getDay()];
}
if (!tl || !steps) return;
const mode = _fpMode, r = _fpData || {};
if (mode === 'hide') { tl.style.display = 'none'; return; }
@@ -4085,7 +4092,9 @@
const b = document.createElement('button');
b.type = 'button';
b.className = 'tl-chip ripple';
b.textContent = u.appName || app.name || ident;
const logo = (app && (app.logo || app.icon)) || '';
if (logo) { const im = document.createElement('img'); im.src = logo; im.alt = ''; im.loading = 'lazy'; b.appendChild(im); }
b.append(u.appName || (app && app.name) || ident);
b.addEventListener('click', () => jumpApp(href, (app && app.identifier) || ident || ''));
box.appendChild(b);
} else if (u.appName) {
@@ -4097,8 +4106,8 @@
});
if (sub) {
sub.textContent = box.childElementCount
? '从下面这些记一笔,今天的脚印就会长出来'
: '去上面的工具记一笔,这里就会长出你今天的脚印';
? '挑一个记一笔,今天的第一只小脚丫就会印上来'
: '去上面的工具记一笔,今天的第一只小脚丫就会印上来';
}
}
@@ -4108,8 +4117,10 @@
const time = document.createElement('span'); time.className = 'st-time'; time.textContent = '今天';
const dot = document.createElement('span'); dot.className = 'st-dot';
const txt = document.createElement('span'); txt.className = 'st-txt'; txt.textContent = '正在获取今天的脚印…';
const from = document.createElement('span'); from.className = 'st-from';
d.append(time, dot, txt, from);
dot.innerHTML = FP_FOOT;
const card = document.createElement('span'); card.className = 'st-card';
card.append(txt);
d.append(dot, card);
return d;
}
@@ -4156,10 +4167,19 @@
txt.textContent = String(e.label || '');
}
const from = document.createElement('span'); from.className = 'st-from';
from.textContent = e.app ? '来源 · ' + e.app : '';
d.append(time, dot, txt, from);
from.textContent = e.app || '';
/* 2026-10-01 脚印改版:圆点里放一只小脚丫(左右交替靠 CSS :nth-child 翻转),
文案 + 时间 + 来源包进一张小卡 .st-card。SVG 是写死的常量,不含上游字段。 */
dot.innerHTML = FP_FOOT;
const card = document.createElement('span'); card.className = 'st-card';
const meta = document.createElement('span'); meta.className = 'st-meta';
meta.append(time, from);
if (e.detail) { const dt = document.createElement('span'); dt.className = 'st-det'; dt.textContent = e.detail; meta.append(dt); }
card.append(txt, meta);
d.append(dot, card);
return d;
}
const FP_FOOT = '<svg viewBox="0 0 16 22" width="12" height="16" aria-hidden="true"><ellipse cx="8.4" cy="13.6" rx="4.6" ry="6.6" fill="currentColor"/><circle cx="3.6" cy="4.6" r="1.7" fill="currentColor"/><circle cx="6.6" cy="2.6" r="1.6" fill="currentColor"/><circle cx="9.8" cy="2.4" r="1.5" fill="currentColor"/><circle cx="12.6" cy="3.8" r="1.3" fill="currentColor"/></svg>';
/* 无足迹占位行:同构的一行,读屏和眼睛都不会把空卡当成坏卡。 */