v26110270 预览:广场 179 篇标题正文去 AI 味重写;首页倒计时「距离见面」移到天数前;百宝箱下方改便签墙;首页支持 ?go=me / ?go=rec 直达
Co-Authored-By: AI 助手
This commit is contained in:
16
js/app.js
16
js/app.js
@@ -3,7 +3,7 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
||||
var VER = '26110269';
|
||||
var VER = '26110270';
|
||||
const $ = (s, c) => (c || document).querySelector(s);
|
||||
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
||||
|
||||
@@ -863,6 +863,19 @@
|
||||
const fq = $('#fpQifu');
|
||||
if (fq) fq.addEventListener('click', e => { e.preventDefault(); e.stopPropagation(); jumpApp(QIFU_URL); });
|
||||
$$('[data-sheet="close"]').forEach(b => b.addEventListener('click', closeSheet));
|
||||
|
||||
/* 11-03 档案页(/chengzhang-dangan/)底部也放首页这排 tab:那边点「我的」「记一下」回到首页并直达 —— 带 ?go=me / ?go=rec 进来。
|
||||
用完就从地址里去掉,刷新不会重复弹。 */
|
||||
{
|
||||
const sp = new URLSearchParams(location.search), gv = sp.get('go');
|
||||
if (gv === 'me' || gv === 'rec') {
|
||||
sp.delete('go');
|
||||
const qs = sp.toString();
|
||||
try { history.replaceState(history.state, '', location.pathname + (qs ? '?' + qs : '') + location.hash); } catch (e) {}
|
||||
window.__mbDeepAt = Date.now(); /* 首次 pageshow 会把屏重置回首页(resetScreenOnShow),刚直达的这一下要放过 */
|
||||
requestAnimationFrame(() => { if (gv === 'me') go('me'); else openSheet(); });
|
||||
}
|
||||
}
|
||||
scrim.addEventListener('click', closeSheet);
|
||||
|
||||
/* 下拉关闭 */
|
||||
@@ -6556,6 +6569,7 @@
|
||||
SPA 还停留在切走前的屏(如「我的」),与"回到首页"的预期不符。
|
||||
只在"当前不是首页"时才切,避免打断用户在首页上的浏览/滚动。 */
|
||||
function resetScreenOnShow() {
|
||||
if (window.__mbDeepAt && Date.now() - window.__mbDeepAt < 3000) return; /* ?go=me 直达后的首次 pageshow 不重置 */
|
||||
var cur = document.querySelector('.screen.is-active');
|
||||
if (cur && cur.dataset.screen && cur.dataset.screen !== 'home') go('home');
|
||||
}
|
||||
|
||||
@@ -231,5 +231,5 @@
|
||||
}
|
||||
/* feed.js 首页默认不加载(index.html 只引了 topics.js),这里按需拉一次 */
|
||||
if (window.GC_FEED) init();
|
||||
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110269'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
|
||||
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110270'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
|
||||
})();
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
(function () {
|
||||
var sec = document.getElementById('gcHome');
|
||||
if (!sec) return;
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110269';
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/gch/v4.css?v=26110270';
|
||||
document.head.appendChild(l);
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110269';
|
||||
var s = document.createElement('script'); s.src = 'js/gch/v4.js?v=26110270';
|
||||
s.onload = function () { if (sec.querySelector('.g4-foot')) merge(); else sec.addEventListener('gc4-ready', merge, { once: true }); }; /* v4 要先拉 feed.js 才渲染 */
|
||||
document.body.appendChild(s);
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
/* 首页头图倒计时(11-03,见 js/hero-cd.js)。只在 .hero-pane.cd 时生效;关掉(未填预产期 / 已出生)就是原来的样子。
|
||||
竖向:小标 18 → 数字牌 46 → 时分秒 20 → 孕周一行 20 → 进度条 16,加间距后和旧版总高一样,下面「我的孕期工具」卡不会被顶下去。 */
|
||||
竖向(11-03 二改):「距离见面」竖排挪到数字牌左边、不再单占一行 → 数字牌 46 → 时分秒 20 → 孕周一行 20 → 进度条 16;
|
||||
省下的一行高度给孕周和进度条往下挪(用户:「跟上面的天数上下有一点距离」)。整组仍在头图里,下面卡片位置不变。 */
|
||||
.hi-cd{display:none}
|
||||
.hero-pane.cd{margin-top:2px}
|
||||
.hero-pane.cd{margin-top:14px}
|
||||
.hero-pane.cd .hi-due{display:none}
|
||||
.hero-pane.cd .hi-cd{display:flex;flex-direction:column;align-items:flex-start}
|
||||
.cd-lb{display:inline-flex;align-items:center;gap:5px;height:18px;font-size:12.5px;font-weight:700;color:#fff;letter-spacing:.5px;white-space:nowrap}
|
||||
.cd-lb svg{width:12px;height:12px;color:#FFD9C7;animation:hiBeat 1.6s ease-in-out infinite}
|
||||
.cd-row{display:flex;align-items:flex-end;gap:6px;margin-top:5px}
|
||||
.cd-lb{display:flex;flex-direction:column;justify-content:center;gap:3px;height:46px;margin-right:2px}
|
||||
.cd-lb b{font-size:13px;font-weight:800;line-height:1;color:#fff;letter-spacing:1px;white-space:nowrap}
|
||||
.cd-row{display:flex;align-items:flex-end;gap:6px}
|
||||
.cd-d{display:flex;gap:4px}
|
||||
/* 一位一块牌:上半亮、下半略暗,中间一道翻页缝 + 两侧小铆点,像机场翻牌钟 */
|
||||
.cd-d i{position:relative;display:block;width:34px;height:46px;border-radius:9px;font-style:normal;
|
||||
@@ -26,11 +27,11 @@
|
||||
.cd-tk b{min-width:22px;height:20px;padding:0 3px;border-radius:5px;background:rgba(110,35,18,.24);color:#fff;font-size:12.5px;font-weight:800;line-height:20px;text-align:center;font-variant-numeric:tabular-nums;text-shadow:none}
|
||||
.cd-tk i{margin:0 3px 0 1px;font-style:normal;font-size:11px;font-weight:700;color:#FFE6BF}
|
||||
/* 孕周退成一行小字「孕 26 周 +6天」,不再和倒计时抢主角 */
|
||||
.hero-pane.cd .hi-week{height:20px;margin-top:5px;align-items:center}
|
||||
.hero-pane.cd .hi-week{height:20px;margin-top:16px;align-items:center}
|
||||
.hero-pane.cd .hi-week::before{content:"孕";margin-right:3px;font-size:13px;font-weight:800;color:#FFE6BF}
|
||||
.hero-pane.cd .hi-week b{font-size:17px;line-height:20px;letter-spacing:0;text-shadow:0 1px 3px rgba(120,30,10,.28)}
|
||||
.hero-pane.cd .hi-unit{flex-direction:row;align-items:center;margin:0 0 0 3px}
|
||||
.hero-pane.cd .hi-unit em{font-size:13px}
|
||||
.hero-pane.cd .hi-unit span{margin:0 0 0 5px;padding:0 6px;font-size:10.5px;line-height:16px}
|
||||
.hero-pane.cd .hi-prog{margin-top:5px}
|
||||
@media (prefers-reduced-motion:reduce){.cd-d i.flip span,.cd-lb svg{animation:none}}
|
||||
.hero-pane.cd .hi-prog{margin-top:9px}
|
||||
@media (prefers-reduced-motion:reduce){.cd-d i.flip span{animation:none}}
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
var cur = '', timer = 0;
|
||||
var p2 = function (n) { return (n < 10 ? '0' : '') + n; };
|
||||
box.innerHTML =
|
||||
'<span class="cd-lb"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 21s-8-5-8-11a4.5 4.5 0 018-2.8A4.5 4.5 0 0120 10c0 6-8 11-8 11z" fill="currentColor"/></svg>距离和宝宝见面还有</span>' +
|
||||
'<div class="cd-row"><span class="cd-d" id="heroCdD"></span><em>天</em></div>' +
|
||||
/* 11-03 二改(用户:「距离见面」四个字放到天数前面)→ 竖排两行「距离 / 见面」贴在数字牌左边,原来单独一行的小标去掉 */
|
||||
'<div class="cd-row"><span class="cd-lb"><b>距离</b><b>见面</b></span><span class="cd-d" id="heroCdD"></span><em>天</em></div>' +
|
||||
'<div class="cd-tk"><b id="heroCdH">--</b><i>时</i><b id="heroCdM">--</b><i>分</i><b id="heroCdS">--</b><i>秒</i></div>';
|
||||
var D = document.getElementById('heroCdD'), H = document.getElementById('heroCdH'), M = document.getElementById('heroCdM'), S = document.getElementById('heroCdS');
|
||||
function tick() {
|
||||
|
||||
18
js/kit.css
18
js/kit.css
@@ -38,3 +38,21 @@ html.night .kit-e span{color:#B9A9B2}
|
||||
html.night .kit-e{background:rgba(255,255,255,.06);box-shadow:none}
|
||||
html.night .kit-e img{mix-blend-mode:normal}
|
||||
html.night .kit-lh{border-color:rgba(255,255,255,.1)}
|
||||
/* 11-03 下方 6 条改「便签墙」(见 kit.js paint 注释) */
|
||||
.kit-notes{display:grid;grid-template-columns:1fr 1fr;gap:16px 12px;padding:14px 2px 6px}
|
||||
.kn{position:relative;display:flex;flex-direction:column;gap:8px;min-height:118px;padding:16px 12px 11px;border-radius:6px 16px 16px 16px;text-decoration:none;color:inherit;
|
||||
background:var(--kb);box-shadow:0 8px 16px -10px var(--ks),0 1px 0 rgba(255,255,255,.7) inset;transform:rotate(var(--r));transition:transform .2s}
|
||||
.kn:active{transform:rotate(0) scale(.97)}
|
||||
.kn.t-qz{--kb:linear-gradient(160deg,#F5F0FF,#EBE3FF);--ks:rgba(124,92,252,.55);--kc:#7C5CFC}
|
||||
.kn.t-qa{--kb:linear-gradient(160deg,#EEFAF4,#DDF3E8);--ks:rgba(46,155,120,.5);--kc:#2E9B78}
|
||||
.kn.t-js{--kb:linear-gradient(160deg,#FFF6EC,#FFE8D3);--ks:rgba(240,122,46,.5);--kc:#E86F22}
|
||||
.kn-tape{position:absolute;left:50%;top:-7px;width:46px;height:14px;margin-left:-23px;border-radius:2px;background:rgba(255,255,255,.72);box-shadow:0 1px 2px rgba(0,0,0,.06);transform:rotate(calc(var(--r) * -2))}
|
||||
.kn-tg{display:inline-flex;align-items:center;gap:3px;align-self:flex-start;height:20px;padding:0 7px 0 5px;border-radius:99px;background:rgba(255,255,255,.75);color:var(--kc);font-size:11px;font-weight:800}
|
||||
.kn-tg svg{width:12px;height:12px}
|
||||
.kn-q{flex:1;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;font-size:14px;font-weight:800;line-height:1.45;color:#2A1E1E}
|
||||
.kn-n{display:flex;align-items:center;gap:2px;font-size:11px;font-weight:600;color:#9A8783}
|
||||
.kn-n svg{width:11px;height:11px;color:#FF6A3D}
|
||||
.kn-n b{font-size:12px;font-weight:900;color:var(--kc);font-variant-numeric:tabular-nums}
|
||||
html.night .kn{background:#2F2737;box-shadow:none}
|
||||
html.night .kn-q{color:#F1E6EE}
|
||||
html.night .kn-tg{background:rgba(255,255,255,.08)}
|
||||
|
||||
16
js/kit.js
16
js/kit.js
@@ -9,7 +9,7 @@
|
||||
if (/[?&]kit=0(?:&|$)/.test(location.search)) return;
|
||||
var box = document.getElementById('kit'), sec = document.getElementById('kitHome');
|
||||
if (!box || !sec) return;
|
||||
var V = '26110269';
|
||||
var V = '26110270';
|
||||
var l = document.createElement('link'); l.rel = 'stylesheet'; l.href = 'js/kit.css?v=' + V; document.head.appendChild(l);
|
||||
document.documentElement.classList.add('has-kit');
|
||||
|
||||
@@ -93,14 +93,22 @@
|
||||
return { r: r, wk: wk };
|
||||
}
|
||||
var TAG = { qz: '测试', qa: '百问', js: '计算器' };
|
||||
var KN_IC = {
|
||||
qz: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M9 3h6M10 3v6l-5 9a2 2 0 001.8 3h10.4a2 2 0 001.8-3l-5-9V3" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',
|
||||
qa: '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5h16v11H9l-5 4z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M10 9.5a2 2 0 113 1.7c-.6.4-1 .8-1 1.5M12 14.5h.01" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>',
|
||||
js: '<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="5" y="3" width="14" height="18" rx="2.5" fill="none" stroke="currentColor" stroke-width="2"/><path d="M8.5 7h7M8.5 12h.01M12 12h.01M15.5 12h.01M8.5 16h.01M12 16h.01M15.5 16h.01" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></svg>'
|
||||
};
|
||||
function paint() {
|
||||
nums();
|
||||
var d = rows(), L = box.querySelector('.kit-list');
|
||||
box.querySelector('.kit-wk').textContent = d.wk ? '孕 ' + d.wk + ' 周' : '';
|
||||
/* 11-03 用户:「这 6 条跟下面孕妈广场那 6 条太像,换个有创意的形式」→ 便签墙:两列六张小便签,按类型配色(测试紫 / 百问绿 / 计算器橙),
|
||||
顶上一条半透明胶带、左右轻微歪一点,角上类型小章,问题写大、人数放底下。不再用编号列表。 */
|
||||
L.className = 'kit-list kit-notes';
|
||||
L.innerHTML = d.r.map(function (x, i) {
|
||||
return '<a class="ms-it ripple kit-it" href="' + esc(x.href) + '"><i class="ms-no">' + (i + 1) + '</i>' +
|
||||
'<span class="ms-m"><span class="ms-q">' + esc(x.q) + '</span><span class="ms-h">' + FIRE + '<b>' + wan(x.n) + x.u + '</b></span></span>' +
|
||||
'<span class="kit-tg t-' + x.c + '">' + TAG[x.c] + '</span><i class="ms-go">›</i></a>';
|
||||
return '<a class="kn ripple t-' + x.c + '" href="' + esc(x.href) + '" style="--r:' + ([-1.6, 1.2, 1.4, -1.1, -1.3, 1.6][i] || 0) + 'deg">' +
|
||||
'<i class="kn-tape" aria-hidden="true"></i><span class="kn-tg">' + KN_IC[x.c] + TAG[x.c] + '</span>' +
|
||||
'<span class="kn-q">' + esc(x.q) + '</span><span class="kn-n">' + FIRE + '<b>' + wan(x.n) + '</b>' + x.u + '</span></a>';
|
||||
}).join('');
|
||||
}
|
||||
fetch('assets/data/qa/hot.json?v=' + V).then(function (r) { return r.ok ? r.json() : []; }).catch(function () { return []; })
|
||||
|
||||
Reference in New Issue
Block a user