测试列表宫格卡每组随机 2~3 张加「谁刚测出什么」,这几张底部去头像(v26110404)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -320,9 +320,9 @@ mark{background:linear-gradient(transparent 62%,var(--c20) 0);color:inherit;padd
|
||||
</div>
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script src="../../js/share-card.js?v=26110403"></script>
|
||||
<script src="meta.js?v=26110403"></script>
|
||||
<script src="tests.js?v=26110403"></script>
|
||||
<script src="../../js/share-card.js?v=26110404"></script>
|
||||
<script src="meta.js?v=26110404"></script>
|
||||
<script src="tests.js?v=26110404"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
@@ -239,7 +239,14 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
.ck .cv{height:146px}
|
||||
.c2 .ck .cv{height:160px}
|
||||
#more .ck .cv{padding-top:14px;height:160px}#more .c2 .ck .cv{height:172px}
|
||||
#more .ck .cv b{font-size:15.5px;line-height:1.32}#more .c2 .ck .cv b{font-size:17px;padding:0 4px}
|
||||
#more .ck .cv b{font-size:15.5px;line-height:1.32}
|
||||
#more .c2 .ck .cv{height:206px}
|
||||
#more .c2 .ck .cv:has(.ck-hl){padding-bottom:40px}
|
||||
.ck .cv .ck-hl{position:absolute;left:7px;right:7px;bottom:7px;display:flex;align-items:center;gap:6px;height:38px;padding:0 8px 0 5px;border-radius:12px;background:rgba(255,255,255,.82);text-align:left;box-shadow:0 2px 6px -3px rgba(80,40,90,.25)}
|
||||
.ck .cv .ck-hl img{flex:none;width:26px;height:26px;border-radius:50%;object-fit:cover;border:1.5px solid #fff}
|
||||
.ck .cv .ck-hl>span{display:flex;flex-direction:column;min-width:0;line-height:1.25}
|
||||
.ck .cv .ck-hl i{font-style:normal;font-size:10.5px;color:#8D8091;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
||||
.ck .cv .ck-hl b,#more .ck .cv .ck-hl b{position:static;display:block;margin-left:-4px;padding:0;font-size:11.5px;font-weight:900;line-height:1.3;color:var(--cb);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:unset;letter-spacing:0}#more .c2 .ck .cv b{font-size:17px;padding:0 4px}
|
||||
.ck .cnn{margin-top:8px}
|
||||
.ck .cv small{font-size:10.5px;color:#8D8091;white-space:nowrap}
|
||||
.ck .cv em{margin-top:2px;height:22px;padding:0 10px;border-radius:6px;background:var(--cb);color:#fff;font-size:11px;font-style:normal;font-weight:800;line-height:22px;box-shadow:0 3px 8px -3px var(--cb)}
|
||||
@@ -847,11 +854,11 @@ 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=26110403"></script>
|
||||
<script src="data.js?v=26110403"></script>
|
||||
<script src="feed.js?v=26110403"></script>
|
||||
<script src="ceshi/meta.js?v=26110403"></script>
|
||||
<script src="../js/share-card.js?v=26110403"></script>
|
||||
<script src="topics.js?v=26110404"></script>
|
||||
<script src="data.js?v=26110404"></script>
|
||||
<script src="feed.js?v=26110404"></script>
|
||||
<script src="ceshi/meta.js?v=26110404"></script>
|
||||
<script src="../js/share-card.js?v=26110404"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -917,7 +924,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var CMD = null, CMERR = false;
|
||||
/* 头像编码:数字 = av/NNNN.webp(旧代码头像);'av:c012' = av/c012.webp(卡通/可爱卡通);'/…' = 站内绝对路径(内置头像库 /_bridge/avatars/);其余 = assets/img/mom/xxx.jpg */
|
||||
var avP = function (a) { return typeof a === 'number' ? 'av/' + ('000' + a).slice(-4) + '.webp' : a.indexOf('av:') === 0 ? 'av/' + a.slice(3) + '.webp' : a.charAt(0) === '/' ? a : '../assets/img/mom/' + a + '.jpg'; };
|
||||
fetch('cm.json?v=26110403').then(function (r) { return r.json(); }).then(function (j) {
|
||||
fetch('cm.json?v=26110404').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) {
|
||||
@@ -1201,13 +1208,23 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
game: '<svg class="cbl" viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true"><path class="b1" d="M70 0L100 0 100 34z"/><path class="b2" d="M0 100L0 70 34 100z M60 100L100 62 100 100z"/><path class="b3" d="M0 0H22L0 22z"/></svg>',
|
||||
shop: '<svg class="cbl" viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true"><rect class="b1" x="64" y="-8" width="44" height="30" rx="14"/><rect class="b2" x="-10" y="76" width="120" height="34" rx="16"/><rect class="b3" x="-6" y="6" width="26" height="14" rx="7"/></svg>'
|
||||
};
|
||||
function csCardHTML(x, done, i) {
|
||||
var d = done[x.id], who = (x.sub || '').split('·')[0].trim();
|
||||
/* 11-04 用户:「宫格卡随机几张,在『开始测试』下面、白边上面加一行『谁测出了什么结果』;有这行的卡底下不要头像,只留 N 人测过」
|
||||
每组宫格(最多 6 张)随机挑 2~3 张;昵称 / 头像同战报那批(模拟,AGENTS.md 12b),结果名取 meta.js GC_RES 真实结果名;同一屏昵称不重复 */
|
||||
var ckHlUsed = [];
|
||||
function ckHlLine(x) {
|
||||
var rs = (window.GC_RES || {})[x.id]; if (!rs || !rs.length) return '';
|
||||
var c = [], k; for (k = 0; k < CL_NM.length; k++) if (ckHlUsed.indexOf(k) < 0) c.push(k);
|
||||
if (!c.length) { ckHlUsed = []; c = CL_NM.map(function (_, j) { return j; }); }
|
||||
k = c[Math.floor(Math.random() * c.length)]; ckHlUsed.push(k);
|
||||
return '<span class="ck-hl"><img src="../assets/img/mom/' + CL_AV[k % CL_AV.length] + '.jpg" alt="" loading="lazy"><span><i>' + esc(CL_NM[k]) + ' 刚测出</i><b>「' + esc(rs[Math.floor(Math.random() * rs.length)]) + '」</b></span></span>';
|
||||
}
|
||||
function csCardHTML(x, done, i, hl) {
|
||||
var d = done[x.id], who = (x.sub || '').split('·')[0].trim(), hs = hl ? ckHlLine(x) : '';
|
||||
var top = byHot(TM).slice(0, 3).map(function (y) { return y.id; }).indexOf(x.id);
|
||||
return '<button type="button" class="ck ' + CS_GPAL[x.group] + '" data-test="' + x.id + '"><span class="cv">' + (CS_BLOBS[x.group] || CS_BLOB) +
|
||||
(top >= 0 ? '<i class="ck-top t' + (top + 1) + '">TOP' + (top + 1) + '</i>' : '') +
|
||||
'<i class="ck-wm">' + csTI(x) + '</i><b>' + esc(x.title.replace(/^测一测|/, '')) + '</b><small>' + esc(who) + ' · ' + x.n + ' 题</small><em>' + (d ? '再测一次' : '开始测试') + '</em>' + (d ? '<i class="dn">已测</i>' : '') + '</span>' +
|
||||
'<span class="cnn">' + csAvs(3) + '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12.6 2.5c.4 3-1.6 4.6-3 6.2C8 10.4 7 12 7 14.3A5 5 0 0012 19.5a5 5 0 005-5.2c0-2-1-3.6-1.9-4.6-.2 1.3-.9 2.2-1.9 2.6.6-3.4-.2-7-.6-9.8z" fill="currentColor"/></svg>' + gcTestedText(x.id) + '</span></button>';
|
||||
'<i class="ck-wm">' + csTI(x) + '</i><b>' + esc(x.title.replace(/^测一测|/, '')) + '</b><small>' + esc(who) + ' · ' + x.n + ' 题</small><em>' + (d ? '再测一次' : '开始测试') + '</em>' + (d ? '<i class="dn">已测</i>' : '') + hs + '</span>' +
|
||||
'<span class="cnn">' + (hs ? '' : csAvs(3)) + '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12.6 2.5c.4 3-1.6 4.6-3 6.2C8 10.4 7 12 7 14.3A5 5 0 0012 19.5a5 5 0 005-5.2c0-2-1-3.6-1.9-4.6-.2 1.3-.9 2.2-1.9 2.6.6-3.4-.2-7-.6-9.8z" fill="currentColor"/></svg>' + gcTestedText(x.id) + '</span></button>';
|
||||
}
|
||||
/* ---------- 11-04 用户:「测试列表页太安静,要热闹、有创意」 ----------
|
||||
① banner 下一条「此刻 N 人正在测」(红点呼吸、数字隔 2 秒小跳)+ 战报滚动「谁 刚测出「结果」· 哪个测试」(点了进那个测试);
|
||||
@@ -1379,13 +1396,16 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
[].forEach.call(els, function (el) { el.classList.add('pre'); io.observe(el); });
|
||||
}
|
||||
function ceshiListHTML() {
|
||||
var done = csDone(), gs = ['quiz', 'psy', 'game', 'shop'].filter(function (g) { return !tGrp || tGrp === g; }), k = 0; csAvK = 0;
|
||||
var done = csDone(), gs = ['quiz', 'psy', 'game', 'shop'].filter(function (g) { return !tGrp || tGrp === g; }), k = 0; csAvK = 0; ckHlUsed = [];
|
||||
return '<div class="csl">' + gs.map(function (g, gi) {
|
||||
var l = byHot(TM.filter(function (x) { return x.group === g; })); if (!l.length) return '';
|
||||
var c = CS_SEC[g], nc = Math.min(6, l.length - l.length % 2);
|
||||
return (gi ? '<div class="csd"><span>' + (gi === 1 && !tGrp ? '点上方标签,可以只看某一类' : '继续往下看') + '</span></div>' : '') +
|
||||
'<section class="csg g-' + g + '"><i class="csg-deco" aria-hidden="true">' + CS_ICO[g] + '</i><div class="csg-h"><b><i class="csg-ic">' + CS_ICO[g] + '</i>' + TG[g] + '<span class="csg-n">' + csAvs(4) + Math.round(l.reduce(function (a, x) { return a + gcTested(x.id); }, 0) / 1e4) + ' 万人测过</span></b><small>' + c[1] + '</small></div>' +
|
||||
'<div class="ckg c2">' + l.slice(0, nc).map(function (x) { return csCardHTML(x, done, k++); }).join('') + '</div>' +
|
||||
'<div class="ckg c2">' + (function () {
|
||||
var ix = l.slice(0, nc).map(function (_, j) { return j; }).sort(function () { return Math.random() - .5; }).slice(0, nc >= 4 ? 2 + Math.floor(Math.random() * 2) : 1);
|
||||
return l.slice(0, nc).map(function (x, j) { return csCardHTML(x, done, k++, ix.indexOf(j) >= 0); }).join('');
|
||||
})() + '</div>' +
|
||||
(l.length > nc ? '<div class="csrl">' + l.slice(nc).map(function (x) { return csRowHTML(x, done, k++); }).join('') + '</div>' : '') + '</section>';
|
||||
}).join('') + '</div>';
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ main{padding:6px 16px 0}
|
||||
</div>
|
||||
<div class="wb"><button type="button" id="write"><svg class="ic" viewBox="0 0 24 24"><path d="M12 20h9M16.5 3.5a2.1 2.1 0 013 3L7 19l-4 1 1-4z"/></svg>写新的故事</button></div>
|
||||
|
||||
<script src="../topics.js?v=26110403"></script>
|
||||
<script src="../topics.js?v=26110404"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
Reference in New Issue
Block a user