孕妈广场加「测一测」:25 个测试(知识考卷/趣味心理/闯关打分,共 341 题)+ 广场入口横滑卡;v26110218
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -129,6 +129,19 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
.hot{display:flex;gap:10px;padding:0 12px 2px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;scroll-snap-type:x mandatory}
|
||||
.hot::-webkit-scrollbar{display:none}
|
||||
.hot::after{content:"";flex:none;width:2px}
|
||||
/* 11-02 测一测入口:祈福树下面一排横滑小卡,点了进 ceshi/(25 个测试) */
|
||||
.cs{margin:14px 0 0}
|
||||
.cs .sh{padding:0 16px}
|
||||
.cs-l{display:flex;gap:10px;overflow-x:auto;padding:8px 12px 4px;scrollbar-width:none;scroll-snap-type:x proximity}
|
||||
.cs-l::-webkit-scrollbar{display:none}
|
||||
.cs-c{flex:none;width:128px;height:96px;padding:11px 12px;border-radius:16px;color:#fff;text-align:left;position:relative;overflow:hidden;scroll-snap-align:start;display:flex;flex-direction:column;box-shadow:0 8px 16px -12px rgba(120,60,40,.6)}
|
||||
.cs-c:active{transform:scale(.97)}
|
||||
.cs-c small{font-size:10.5px;font-weight:700;opacity:.88}
|
||||
.cs-c b{margin-top:4px;font-size:14px;font-weight:900;line-height:1.35}
|
||||
.cs-c::after{content:"";position:absolute;right:-22px;bottom:-22px;width:64px;height:64px;border-radius:50%;background:rgba(255,255,255,.2)}
|
||||
.cs-c.q{background:linear-gradient(135deg,#FF9A6B,#F2604A)}.cs-c.p{background:linear-gradient(135deg,#B49CFF,#8461E0)}.cs-c.g{background:linear-gradient(135deg,#5FD3B6,#1C9C86)}
|
||||
.cs-c.all{background:#fff;color:#2B2320;align-items:center;justify-content:center;text-align:center;width:96px}
|
||||
.cs-c.all::after{display:none}.cs-c.all b{font-size:22px;color:#F2704E;margin:0}.cs-c.all small{color:#9A8380;opacity:1}
|
||||
.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}
|
||||
@@ -438,6 +451,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
<symbol id="i-bulb" viewBox="0 0 24 24"><path d="M9 17.5h6M9.8 20.5h4.4M12 3.5a6 6 0 00-3.6 10.8c.5.4.8 1 .8 1.6v1.6h5.6v-1.6c0-.6.3-1.2.8-1.6A6 6 0 0012 3.5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
|
||||
<symbol id="i-gift" viewBox="0 0 24 24"><path d="M4 10.5h16v3H4zM5.5 13.5h13v6.5h-13zM12 10.5V20M12 10.5c-1.2-2.6-4.8-4.4-6-2.6-1 1.6 1.6 2.6 6 2.6zm0 0c1.2-2.6 4.8-4.4 6-2.6 1 1.6-1.6 2.6-6 2.6z" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round"/></symbol>
|
||||
<symbol id="i-fire" viewBox="0 0 24 24"><path d="M12 21c-4 0-6.5-2.7-6.5-6.2 0-3.6 2.9-5.6 3.6-9.3 2.6 1.4 3.6 3.6 3.6 5.4 1-.6 1.6-1.8 1.7-3 2.4 1.9 4.1 4.3 4.1 7 0 3.5-2.5 6.1-6.5 6.1z" fill="currentColor"/></symbol>
|
||||
<symbol id="i-spark" viewBox="0 0 24 24"><path d="M12 3l2 6.2L20 12l-6 2.8L12 21l-2-6.2L4 12l6-2.8z" fill="currentColor"/></symbol>
|
||||
<symbol id="i-x" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6L6 18" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></symbol>
|
||||
<symbol id="i-right" viewBox="0 0 24 24"><path d="M9 5l7 7-7 7" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/></symbol>
|
||||
<symbol id="i-ring" viewBox="0 0 24 24"><path d="M12 20.3s-7.6-4.6-9.2-9.4C1.7 7.6 3.9 4.5 7.2 4.5c2 0 3.6 1.1 4.8 2.8 1.2-1.7 2.8-2.8 4.8-2.8 3.3 0 5.5 3.1 4.4 6.4-1.6 4.8-9.2 9.4-9.2 9.4z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/></symbol>
|
||||
@@ -498,9 +512,9 @@ 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=26110217"></script>
|
||||
<script src="data.js?v=26110217"></script>
|
||||
<script src="feed.js?v=26110217"></script>
|
||||
<script src="topics.js?v=26110218"></script>
|
||||
<script src="data.js?v=26110218"></script>
|
||||
<script src="feed.js?v=26110218"></script>
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
@@ -683,6 +697,19 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
} catch (e) {}
|
||||
haptic(); location.href = target;
|
||||
}
|
||||
/* 11-02 用户:「把这 25 个测试放到孕妈广场里,点进去就是这 25 个测试」→ 祈福树下一排横滑卡,题库在 ceshi/tests.js,这里只挑几张露出 */
|
||||
var CS_PICK = [['t11', 'p', '趣味心理', '松弛型还是内卷型妈妈?'], ['t01', 'q', '知识考卷', '孕妈孕期知识考卷'], ['t21', 'g', '闯关挑战', '准爸爸胎教合格大挑战'],
|
||||
['t16', 'p', '趣味心理', '夫妻育儿默契大测试'], ['t03', 'q', '知识考卷', '新手妈妈育儿摸底考卷'], ['t24', 'g', '趣味测试', '宝宝气质预判小测试']];
|
||||
function ceshiURL(id) {
|
||||
var q = new URLSearchParams(location.search); ['t', 'n', 'c', 'id'].forEach(function (k) { q.delete(k); });
|
||||
if (id) q.set('id', id); var s = q.toString();
|
||||
return 'ceshi/' + (s ? '?' + s : '') + location.hash;
|
||||
}
|
||||
function ceshiHTML() {
|
||||
return '<div class="cs"><div class="sh"><svg class="fire"><use href="#i-spark"/></svg><h2>测一测</h2><button type="button" class="more" data-cs="">全部 25 个<svg class="ic" style="width:13px;height:13px"><use href="#i-right"/></svg></button></div>' +
|
||||
'<div class="cs-l">' + CS_PICK.map(function (x) { return '<button type="button" class="cs-c ' + x[1] + '" data-cs="' + x[0] + '"><small>' + x[2] + '</small><b>' + x[3] + '</b></button>'; }).join('') +
|
||||
'<button type="button" class="cs-c all" data-cs=""><b>25</b><small>全部测试 ›</small></button></div></div>';
|
||||
}
|
||||
function rewardHTML(sm) {
|
||||
return '<button type="button" class="rw' + (sm ? ' sm' : '') + '" data-rule="1"><span class="gf"><svg class="ic"><use href="#i-gift"/></svg></span>' +
|
||||
'<span class="rt"><small>参与话题投稿 · 被选中奖励</small><b>' + REWARD + '</b></span><span class="go">怎么参与<svg class="ic" style="width:12px;height:12px"><use href="#i-right"/></svg></span></button>';
|
||||
@@ -701,7 +728,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var t = TBY[cur], el = $('#head'), fh = $('#fh');
|
||||
if (!t) {
|
||||
var hl = hotList();
|
||||
el.innerHTML = qifuHTML() +
|
||||
el.innerHTML = qifuHTML() + ceshiHTML() +
|
||||
'<div class="sh"><svg class="fire"><use href="#i-fire"/></svg><h2>热门话题</h2><button type="button" class="more" data-all="1">全部 ' + hl.length + ' 个<svg class="ic" style="width:13px;height:13px"><use href="#i-right"/></svg></button></div>' +
|
||||
/* 11-02 用户:「热门话题不要一块一块的,改成井号、偏列表的形式」→ 排行列表:名次 + #话题# + 一行简介 + 篇数/热,右侧「参与」
|
||||
投稿奖励从顶部大横幅挪到这里当列表头一行(用户:「30 现金 + 500 兜豆看放哪」→ 跟「参与」放一起,点了看规则) */
|
||||
@@ -816,7 +843,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
var sx = 0, sy = 0, t0 = 0, mode = '', ok = false, dx = 0, sc = $('#sc'), pane = $('#pane');
|
||||
sc.addEventListener('touchstart', function (e) {
|
||||
var t = e.touches[0]; sx = t.clientX; sy = t.clientY; t0 = Date.now(); mode = ''; dx = 0;
|
||||
ok = !paneBusy && e.touches.length === 1 && !e.target.closest('.tcs,.hot,.cats,#sheet,#note,.nd') && !document.body.classList.contains('lock');
|
||||
ok = !paneBusy && e.touches.length === 1 && !e.target.closest('.tcs,.hot,.cats,.cs-l,#sheet,#note,.nd') && !document.body.classList.contains('lock');
|
||||
}, { passive: true });
|
||||
sc.addEventListener('touchmove', function (e) {
|
||||
if (!ok) return;
|
||||
@@ -859,6 +886,7 @@ button{font:inherit;color:inherit;border:0;background:none;padding:0;cursor:poin
|
||||
$('#more').addEventListener('click', function (e) { if (e.target.closest('[data-t]')) { haptic(); selectTopic(''); } });
|
||||
$('#head').addEventListener('click', function (e) {
|
||||
if (e.target.closest('#qfBanner')) { goQifu(); return; }
|
||||
var csb = e.target.closest('[data-cs]'); if (csb) { haptic(); location.href = ceshiURL(csb.dataset.cs); return; }
|
||||
var j = e.target.closest('[data-join]'); if (j) { haptic(); openRule(j.dataset.join); return; }
|
||||
if (e.target.closest('[data-rule]')) { openRule(''); return; }
|
||||
if (e.target.closest('[data-all]')) { openTopics(); return; }
|
||||
|
||||
Reference in New Issue
Block a user