@@ -157,6 +157,20 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
. csf . tx . go { display : inline-flex ; align-items : center ; gap : 2 px ; margin-top : 10 px ; height : 30 px ; padding : 0 14 px ; border-radius : 99 px ; background : var ( - - tg ) ; color : #fff ; font-size : 13 px ; font-weight : 800 ; box-shadow : 0 5 px 12 px -5 px var ( - - tg ) }
. csf . tx . go . ic { width : 13 px ; height : 13 px ; stroke-width : 2.4 }
. csf img { flex : none ; width : 118 px ; height : 118 px ; border-radius : 28 px 28 px 28 px 8 px ; object-fit : cover ; object-position : center 30 % ; border : 3 px solid #fff ; box-shadow : 0 8 px 18 px -10 px var ( - - tg ) }
. csk . ckl { margin-top : 8 px ; border-radius : 20 px ; background : #fff ; box-shadow : 0 3 px 12 px rgba ( 170 , 110 , 90 , .07 ) ; overflow : hidden }
. ckr { display : flex ; align-items : center ; gap : 12 px ; width : 100 % ; padding : 11 px 12 px ; text-align : left ; border-top : 1 px solid #F7EDE9 }
. ckr : first-child { border-top : 0 }
. ckr . rk { flex : none ; width : 26 px ; text-align : center ; font-size : 17 px ; font-weight : 900 ; font-style : italic ; color : #C9B3AC ; font-family : Georgia , serif }
. ckr . rk . r1 , . ckr . rk . r2 , . ckr . rk . r3 { width : 26 px ; height : 26 px ; border-radius : 8 px ; font-style : normal ; font-size : 14 px ; line-height : 26 px ; color : #fff }
. ckr . rk . r1 { background : linear-gradient ( 135 deg , #FF8A4C , #F0453A ) } . ckr . rk . r2 { background : linear-gradient ( 135 deg , #FFB547 , #F28A1E ) } . ckr . rk . r3 { background : linear-gradient ( 135 deg , #FFD166 , #F2B21E ) }
. ckr . tx { flex : 1 ; min-width : 0 }
. ckr b { display : block ; font-size : 14 px ; font-weight : 800 ; line-height : 1.4 ; color : #2A1E1E ; overflow : hidden ; white-space : nowrap ; text-overflow : ellipsis }
. ckr . hb { display : block ; height : 4 px ; margin : 5 px 0 4 px ; border-radius : 4 px ; background : #F6EEEA ; overflow : hidden }
. ckr . hb i { display : block ; height : 100 % ; border-radius : 4 px ; background : linear-gradient ( 90 deg , #FFB08C , #F0603E ) }
. ckr small { display : block ; font-size : 11.5 px ; color : #A08B85 }
. ckr small em { font-style : normal ; font-weight : 800 ; color : var ( - - tg ) ; margin-right : 6 px }
. ckr . go { flex : none ; height : 26 px ; padding : 0 11 px ; border-radius : 99 px ; background : var ( - - tl ) ; color : var ( - - tg ) ; font-size : 12 px ; font-weight : 800 ; line-height : 26 px }
. ckm { display : block ; width : 100 % ; margin-top : 8 px ; height : 36 px ; border-radius : 12 px ; background : rgba ( 255 , 255 , 255 , .7 ) ; color : #8A7470 ; font-size : 12.5 px ; font-weight : 800 }
. csq { margin-top : 8 px ; border-radius : 20 px ; background : #fff ; box-shadow : 0 3 px 12 px rgba ( 170 , 110 , 90 , .07 ) ; overflow : hidden }
. csn { display : flex ; align-items : center ; gap : 12 px ; width : 100 % ; padding : 12 px 12 px 12 px 14 px ; text-align : left ; border-top : 1 px dashed #F1E2DC }
. csn : first-child { border-top : 0 }
@@ -590,10 +604,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=26110224 " > < / script >
< script src = "data.js?v=26110224 " > < / script >
< script src = "feed.js?v=26110224 " > < / script >
< script src = "ceshi/meta.js?v=26110224 " > < / script >
< script src = "topics.js?v=26110225 " > < / script >
< script src = "data.js?v=26110225 " > < / script >
< script src = "feed.js?v=26110225 " > < / script >
< script src = "ceshi/meta.js?v=26110225 " > < / script >
< script >
( function ( ) {
'use strict' ;
@@ -798,6 +812,8 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
'<div class="nb"><h3>' + esc ( x . title ) + '</h3><div class="nf">' + ( d ? '<span class="gs dn">已测 · ' + esc ( d . title ) + '</span>' : '<span class="gs">' + TG [ x . group ] + '</span>' ) +
'<span class="gt">' + ( d ? '再测' : '去测' ) + ' › </span></div></div></button>' ;
}
/* 热度排序: 按「N人测过」( ceshi/meta.js gcTested, 模拟数, 见 AGENTS.md 12b) 从高到低 */
var byHot = function ( l ) { return l . slice ( ) . sort ( function ( a , b ) { return gcTested ( b . id ) - gcTested ( a . id ) ; } ) ; } , hotOpen = false ;
var TGD = { quiz : '有标准答案,答完看解析' , psy : '没有对错,测测你是哪一型' , game : '挑战一下,看能拿什么称号' , shop : '看看你是哪一类育儿采购玩家' } ;
/* 每组换一种排法,避免整页一个样:考卷=编号卷宗,心理=双列卡,闯关=横滑大卡,好物=图文行 */
function rest ( g , l , done ) {
@@ -815,7 +831,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
} ) . join ( '' ) + '</ol>' ;
if ( g === 'quiz' ) return '<div class="csq">' + l . map ( function ( x , i ) {
var d = done [ x . id ] ;
return '<button type="button" class="csn" data-test="' + x . id + '"><span class="no"><small>NO. </small>' + ( '0' + ( TM . filter ( function ( y ) { return y . group === 'quiz' ; } ) . indexOf ( x ) + 1 ) ) . slice ( - 2 ) + '</span><span class="tx"><b>' + esc ( x . title ) + '</b>' +
return '<button type="button" class="csn" data-test="' + x . id + '"><span class="no"><small>TOP </small>' + ( '0' + ( byHot ( TM . filter ( function ( y ) { return y . group === 'quiz' ; } ) ) .indexOf ( x ) + 1 ) ) . slice ( - 2 ) + '</span><span class="tx"><b>' + esc ( x . title ) + '</b>' +
'<small>' + ( d ? '<em>已测 · ' + esc ( d . title ) + '</em>' : esc ( x . sub ) ) + '</small>' + '<i class="pc">' + gcTestedText ( x . id ) + '</i>' + '</span><span class="ar"><svg class="ic"><use href="#i-right"/></svg></span></button>' ;
} ) . join ( '' ) + '</div>' ;
return l . map ( function ( x ) {
@@ -824,15 +840,26 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
'<small>' + ( d ? '<em>已测 · ' + esc ( d . title ) + '</em>' : esc ( x . sub ) ) + '</small>' + '<i class="pc">' + gcTestedText ( x . id ) + '</i>' + '</span><span class="ar"><svg class="ic"><use href="#i-right"/></svg></span></button>' ;
} ) . join ( '' ) ;
}
function hotHTML ( done ) {
var l = byHot ( TM ) , top = gcTested ( l [ 0 ] . id ) ;
return '<section class="csg csk"><div class="csg-h"><b>热度榜</b><small>按测过的人数排名</small></div><div class="ckl">' +
l . slice ( 0 , hotOpen ? l . length : 10 ) . map ( function ( x , i ) {
var d = done [ x . id ] ;
return '<button type="button" class="ckr g-' + x . group + '" data-test="' + x . id + '"><span class="rk r' + ( i < 3 ? i + 1 : 0 ) + '">' + ( i + 1 ) + '</span>' +
'<span class="tx"><b>' + esc ( x . title ) + '</b><span class="hb"><i style="width:' + Math . max ( 18 , Math . round ( gcTested ( x . id ) / top * 100 ) ) + '%"></i></span>' +
'<small><em>' + TG [ x . group ] + '</em>' + gcTestedText ( x . id ) + ( d ? ' · 已测' : '' ) + '</small></span>' +
'<span class="go">' + ( d ? '再测' : '去测' ) + '</span></button>' ;
} ) . join ( '' ) + '</div><button type="button" class="ckm" data-hot="1">' + ( hotOpen ? '收起' : '查看完整榜单(' + l . length + ' 个)' ) + '</button></section>' ;
}
function ceshiListHTML ( ) {
var done = csDone ( ) ;
return '<div class="csl">' + [ 'quiz' , 'psy' , 'game' , 'shop' ] . filter ( function ( g ) { return ! tGrp || tGrp === g ; } ) . map ( function ( g ) {
var l = TM . filter ( function ( x ) { return x . group === g ; } ) ; if ( ! l . length ) return '' ;
return '<div class="csl">' + ( tGrp ? '' : hotHTML ( done ) ) + [ 'quiz' , 'psy' , 'game' , 'shop' ] . filter ( function ( g ) { return ! tGrp || tGrp === g ; } ) . map ( function ( g ) {
var l = byHot ( TM. filter ( function ( x ) { return x . group === g ; } ) ) ; if ( ! l . length ) return '' ;
var nd = l . filter ( function ( x ) { return done [ x . id ] ; } ) . length ;
var f = l . filter ( function ( x ) { return ! done [ x . id ] ; } ) [ 0 ] || l [ 0 ] ; /* 推荐位:本组第一个没测过的 */
if ( g === 'psy' || g === 'game' ) return '<section class="csg g-' + g + '"><div class="csg-h"><b>' + TG [ g ] + '</b><small>' + l . length + ' 套 · ' + TGD [ g ] + '</small>' + ( nd ? '<em>已测 ' + nd + '</em>' : '' ) + '</div>' + rest ( g , l , done ) + '</section>' ;
return '<section class="csg g-' + g + '"><div class="csg-h"><b>' + TG [ g ] + '</b><small>' + l . length + ' 套 · ' + TGD [ g ] + '</small>' + ( nd ? '<em>已测 ' + nd + '</em>' : '' ) + '</div>' +
'<button type="button" class="csf" data-test="' + f . id + '"><span class="tx"><small>' + ( done [ f . id ] ? '再测一次' : '本组推荐' ) + '</small><b>' + esc ( f . title ) + '</b><p>' + esc ( f . sub ) + '</p><i class="pc">' + gcTestedText ( f . id ) + '</i>' +
'<button type="button" class="csf" data-test="' + f . id + '"><span class="tx"><small>' + ( done [ f . id ] ? '再测一次' : f === l [ 0 ] ? '本组最热' : '本组推荐' ) + '</small><b>' + esc ( f . title ) + '</b><p>' + esc ( f . sub ) + '</p><i class="pc">' + gcTestedText ( f . id ) + '</i>' +
'<span class="go">' + ( done [ f . id ] ? '再测' : '开始测' ) + '<svg class="ic"><use href="#i-right"/></svg></span></span><img src="ceshi/img/' + f . id + '_s.webp" alt="" loading="lazy"></button>' +
rest ( g , l . filter ( function ( x ) { return x !== f ; } ) , done ) + '</section>' ;
} ) . join ( '' ) + '</div>' ;
@@ -1111,6 +1138,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
} ) ;
}
$ ( '#more' ) . addEventListener ( 'click' , function ( e ) {
if ( e . target . closest ( '[data-hot]' ) ) { e . stopPropagation ( ) ; haptic ( ) ; hotOpen = ! hotOpen ; var k = $ ( '#more .csk' ) ; if ( k ) k . outerHTML = hotHTML ( csDone ( ) ) ; return ; }
var ts = e . target . closest ( '[data-test]' ) ;
if ( ts ) { e . stopPropagation ( ) ; haptic ( ) ; location . href = ceshiURL ( ts . dataset . test , true ) ; }
} , true ) ;