孕妈广场:每篇帖子 22~26 条贴合正文的评论 + 作者回复(cm.json,约 4100 条),评论人取自 1000 个人设(av/ 代码绘制头像 + 59 张写实照);带字卡下方加回一行标题;测一测顶部压成一行;AGENTS.md 12c 登记模拟评论例外;v26110231
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -175,12 +175,10 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
.nc.tst .gs{font-size:11px;font-weight:700;color:var(--tg)}
|
||||
.nc.tst .gs.dn{max-width:96px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.nc.tst .gt{flex:none;height:22px;padding:0 9px;border-radius:99px;background:var(--tl);color:var(--tg);font-size:11.5px;font-weight:800;line-height:22px}
|
||||
.csh{position:relative;margin:2px 12px 0;padding:16px 16px 14px;border-radius:20px;overflow:hidden;background:linear-gradient(135deg,#F1EDFF,#FFEFF4 60%,#FFF3EA)}
|
||||
.csh b{display:block;font-size:20px;font-weight:900;color:#2A1E1E;letter-spacing:.5px}
|
||||
.csh p{margin-top:3px;font-size:12.5px;color:#7A6A66;line-height:1.55;max-width:58%}
|
||||
.csh .gn{display:flex;gap:6px;margin-top:10px}
|
||||
.csh .gn span{height:22px;padding:0 8px;border-radius:99px;background:rgba(255,255,255,.85);font-size:11.5px;font-weight:700;line-height:22px;color:var(--tg)}
|
||||
.csh img{position:absolute;right:-6px;bottom:-8px;width:132px;height:132px;object-fit:cover;border-radius:50%;border:4px solid rgba(255,255,255,.8);box-shadow:0 8px 20px -10px rgba(124,92,252,.6)}
|
||||
.csh{display:flex;align-items:center;gap:6px;margin:2px 12px 0;padding:11px 14px;border-radius:16px;background:linear-gradient(120deg,#F1EDFF,#FFEFF4 70%,#FFF3EA)}
|
||||
.csh .ic{width:16px;height:16px;color:#8E6BFF;stroke-width:2.2}
|
||||
.csh b{font-size:15px;font-weight:900;color:#2A1E1E}
|
||||
.csh span{margin-left:auto;font-size:12px;font-weight:700;color:#C0507A}
|
||||
.htl{margin:0 12px;padding:4px 12px 2px;border-radius:18px;background:#fff;box-shadow:0 6px 18px -12px rgba(120,60,40,.25)}
|
||||
.htl .hr{display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px dashed #F0E2DC;--hk:var(--kf)}
|
||||
.htl .hr:last-of-type{border-bottom:0}
|
||||
@@ -304,9 +302,9 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
.nc .tgt span{background:#FFF2A6;padding:1px 5px;-webkit-box-decoration-break:clone;box-decoration-break:clone;border-radius:3px}
|
||||
.nc:nth-child(odd) .tgt span{background:#fff}
|
||||
.nc .ovt~*,.nc .tgt~*{display:none}
|
||||
.nc.s-ov .nb h3,.nc.s-tg .nb h3{display:none}
|
||||
.nc.s-ov .nb .tp,.nc.s-tg .nb .tp{display:none} /* 11-02 用户:图上带字的卡,下方不要放话题,只留作者和点赞 */
|
||||
.nc.s-ov .nb .nf,.nc.s-tg .nb .nf{margin-top:0}
|
||||
.cm-ld{padding:22px 0;text-align:center;font-size:12.5px;color:#B8A39D}
|
||||
.nc.s-ov .nb .tp,.nc.s-tg .nb .tp{display:none} /* 11-02 用户:图上带字的卡,下方放一行标题、不放话题 */
|
||||
.nc.s-ov .nb h3,.nc.s-tg .nb h3{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:unset}
|
||||
|
||||
/* ---------- 详情层 ---------- */
|
||||
#dt{position:fixed;inset:0;z-index:40;background:#fff;transform:translateX(100%);transition:transform .32s cubic-bezier(.2,.8,.2,1);display:flex;flex-direction:column}
|
||||
@@ -551,10 +549,10 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
<div id="sheet" role="dialog" aria-modal="true"><i class="sg"></i><div class="sbd" id="sbd"></div></div>
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script src="topics.js?v=26110230"></script>
|
||||
<script src="data.js?v=26110230"></script>
|
||||
<script src="feed.js?v=26110230"></script>
|
||||
<script src="ceshi/meta.js?v=26110230"></script>
|
||||
<script src="topics.js?v=26110231"></script>
|
||||
<script src="data.js?v=26110231"></script>
|
||||
<script src="feed.js?v=26110231"></script>
|
||||
<script src="ceshi/meta.js?v=26110231"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -614,16 +612,21 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
return out;
|
||||
})();
|
||||
var AGO = ['3 分钟前', '18 分钟前', '1 小时前', '2 小时前', '5 小时前', '昨天 21:40', '昨天 08:12', '10-29', '10-27', '10-25'];
|
||||
/* 评论(11-02 用户:每篇 ≥20 条、紧贴正文、有作者回复;评论人从 1000 个人设里取,一人会在多篇下留言)
|
||||
cm.json = { p: [[昵称, 头像(数字=av/NNNN.webp,字符串=assets/img/mom/xxx.jpg), 阶段]], c: { 帖子id: [[人设, 内容, 赞, [[人设|-1=作者, 内容]]]] } }
|
||||
模拟内容,见 AGENTS.md 12c;文件较大,进页面后后台拉,详情页先显示「评论加载中」 */
|
||||
var CMD = null, CMERR = false;
|
||||
var avP = function (a) { return typeof a === 'number' ? 'av/' + ('000' + a).slice(-4) + '.webp' : '../assets/img/mom/' + a + '.jpg'; };
|
||||
fetch('cm.json?v=26110231').then(function (r) { return r.json(); }).then(function (j) {
|
||||
CMD = j; if (openId && NBY[openId]) { renderComments(NBY[openId]); syncBar(NBY[openId]); }
|
||||
}).catch(function () { CMERR = true; if (openId && NBY[openId]) renderComments(NBY[openId]); });
|
||||
function commentsOf(n) {
|
||||
if (n.real) return []; /* 真实投稿不配占位评论 */
|
||||
var pool = (D[n.t] && D[n.t].comments) || [], r = rng(n.id + 'c');
|
||||
var idx = pool.map(function (_, k) { return k; });
|
||||
for (var k = idx.length - 1; k > 0; k--) { var j = Math.floor(r() * (k + 1)); var x = idx[k]; idx[k] = idx[j]; idx[j] = x; }
|
||||
var cnt = Math.min(pool.length, 3 + (seed(n.id) % 6));
|
||||
return idx.slice(0, cnt).map(function (k, m) {
|
||||
var c = pool[k];
|
||||
return { key: n.id + '#' + k, n: c.n, s: c.s, t: c.t, likes: Math.floor(r() * 180) + 2, ago: AGO[Math.min(AGO.length - 1, m * 2 + Math.floor(r() * 2))],
|
||||
r: (c.r || []).map(function (x, q) { return { n: x.n, t: x.t, au: q === 0 && r() < .35 }; }) };
|
||||
if (n.real || !CMD) return []; /* 真实投稿不配模拟评论 */
|
||||
var L = CMD.c[n.id] || [], P = CMD.p;
|
||||
return L.map(function (c, k) {
|
||||
var p = P[c[0]];
|
||||
return { key: n.id + '#' + k, n: p[0], av: avP(p[1]), s: p[2], t: c[1], likes: c[2],
|
||||
r: c[3].map(function (x) { var q = x[0] < 0 ? null : P[x[0]]; return { n: q ? q[0] : n.author, t: x[1], au: !q }; }) };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -672,7 +675,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
function cardHTML(n, showTopic, sty) {
|
||||
var t = TBY[n.t], r = n.ratio, ov = '';
|
||||
if (!n.photo) sty = '';
|
||||
/* 11-02 用户:图上放的短语「不知所云」→ 图上直接放完整标题,卡片下方不再重复标题 */
|
||||
/* 11-02 用户:图上放的短语「不知所云」→ 图上直接放完整标题;卡片下方再放一行标题(单行省略)、不放话题 */
|
||||
if (sty === 'ov') { r = Math.max(r, 1.33); ov = '<div class="ovt">' + (n.stage ? '<small>' + esc(n.stage) + '</small>' : '') + '<b>' + esc(n.title) + '</b></div>'; }
|
||||
else if (sty === 'tg') { r = Math.max(r, 1.2); ov = '<div class="tgt"><b><span>' + esc(n.title) + '</span></b></div>'; }
|
||||
return '<button type="button" class="nc' + (sty ? ' s-' + sty : '') + '" data-id="' + n.id + '"><div class="cvw">' +
|
||||
@@ -786,11 +789,8 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
'<div class="cpl">' + l.map(function (x) { return rowHTML(x, done); }).join('') + '</div></section>';
|
||||
}).join('') + '</div>';
|
||||
}
|
||||
function ceshiHead() {
|
||||
var n = function (g) { return TM.filter(function (x) { return x.group === g; }).length; };
|
||||
return '<div class="csh"><b>孕育测一测</b><p>累计 ' + Math.round(TM.reduce(function (a, x) { return a + gcTested(x.id); }, 0) / 1e4) + ' 万人次参与 · 知识考卷、趣味心理、闯关挑战、好物配置,测完就有专属结果卡</p>' +
|
||||
'<div class="gn"><span class="g-quiz">考卷 ' + n('quiz') + '</span><span class="g-psy">心理 ' + n('psy') + '</span><span class="g-game">闯关 ' + n('game') + '</span><span class="g-shop">好物 ' + n('shop') + '</span></div>' +
|
||||
'<img src="ceshi/img/t11_s.webp" alt=""></div>';
|
||||
function ceshiHead() { /* 11-02 用户同意:介绍卡压成一行,让热度榜进第一屏 */
|
||||
return '<div class="csh"><svg class="ic"><use href="#i-spark"/></svg><b>孕育测一测</b><span>累计 ' + Math.round(TM.reduce(function (a, x) { return a + gcTested(x.id); }, 0) / 1e4) + ' 万人次参与</span></div>';
|
||||
}
|
||||
function ceshiFh(fh) {
|
||||
fh.className = 'lvw k-ceshi';
|
||||
@@ -1092,7 +1092,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
}
|
||||
var on = !!ME.cl[c.key], n = c.likes + (on ? 1 : 0);
|
||||
var rp = c.r.length ? '<div class="rp">' + c.r.map(function (x) { return '<p><b>' + esc(x.n) + '</b>' + (x.au ? '<span class="au">作者</span>' : '') + ':' + esc(x.t) + '</p>'; }).join('') + '</div>' : '';
|
||||
return '<div class="ci"><img src="' + avSrc(c.n) + '" alt="" loading="lazy"><div class="ci-b"><div class="ci-n"><b>' + esc(c.n) + '</b>' +
|
||||
return '<div class="ci"><img src="' + (c.av || avSrc(c.n)) + '" alt="" loading="lazy"><div class="ci-b"><div class="ci-n"><b>' + esc(c.n) + '</b>' +
|
||||
'<span class="lk' + (on ? ' on' : '') + '" data-cl="' + esc(c.key) + '" data-base="' + c.likes + '" role="button"><svg class="ic"><use href="#i-heart' + (on ? '-f' : '') + '"/></svg>' + n + '</span></div>' +
|
||||
'<p class="ci-t">' + esc(c.t) + '</p>' + (c.s ? '<div class="ci-s">' + esc(c.s) + '</div>' : '') /* 11-02 用户:评论时间先不显示 */ + rp + '</div></div>';
|
||||
}
|
||||
@@ -1106,6 +1106,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
function renderComments(n) {
|
||||
var mine = myCm(n.id).slice().reverse(), cs = commentsOf(n);
|
||||
$('#cmh').innerHTML = '评论 <small>共 ' + cmN(n) + ' 条</small>';
|
||||
if (!CMD && !n.real && !CMERR) { $('#cml').innerHTML = mine.map(function (c) { return commentHTML(c, true); }).join('') + '<div class="cm-ld">评论加载中…</div>'; return; }
|
||||
$('#cml').innerHTML = mine.map(function (c) { return commentHTML(c, true); }).join('') + cs.map(function (c) { return commentHTML(c); }).join('');
|
||||
}
|
||||
function syncBar(n, popK) {
|
||||
|
||||
Reference in New Issue
Block a user