当前 footer.php 是这样计算的:
const start = new Date('<?php echo date('Y'); ?>-01-01');const now = new Date();
const d = document.getElementById('running-days');
if (d) {
d.textContent =
Math.max(1, Math.ceil((now - start) / 86400000)) + ' days';}
所以例如现在是 2026 年,它实际计算的是:
当前日期−2026-01-01
也就是说它显示的是:
今年已经过去多少天
而不是:
网站从建站日期到现在运行了多少天
因此它每到 1 月 1 日都会重新变成 1 days
同时修改了统计组件区域的样式,
原本是搬来的
父容器仍采用了原 Mizuki 的纵向布局
这次应该改父元素为类似:
.stat-item {
display: flex;
align-items: center;
gap: 0.4em;}
同时 SVG:
.stat-item svg {
width: 1em;
height: 1em;
flex: 0 0 1em;}
这样图标会严格跟随文字字号,
并与 Posts / Categories / Comments / Running Time 同列同行、垂直居中。
留言