v26110480 踢屏幕统一静止 25~35 秒一次;精彩分享 4~6 篇也出点赞头像(4~6 个随机),白底头像换深色

This commit is contained in:
deploy
2026-11-05 16:37:25 +00:00
parent b20cc204ab
commit aed6d78721
26 changed files with 71 additions and 42 deletions

BIN
guangchang/av/g114.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
guangchang/av/g115.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

BIN
guangchang/av/g117.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
guangchang/av/g118.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 510 B

BIN
guangchang/av/g119.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
guangchang/av/g120.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
guangchang/av/g121.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
guangchang/av/g122.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
guangchang/av/g124.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
guangchang/av/g125.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
guangchang/av/g126.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
guangchang/av/g127.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
guangchang/av/g128.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
guangchang/av/g129.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
guangchang/av/g130.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
guangchang/av/g131.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
guangchang/av/g132.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
guangchang/av/g133.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -1,5 +1,4 @@
孕妈广场占位照片来源:Burst(Shopify 免费图库,可免费商用、无需署名)。
f01-1 https://burst.shopifycdn.com/photos/young-woman-with-hair-wrapped-while-on-her-phone.jpg young woman with hair wrapped while on her phone
f02-1 https://burst.shopifycdn.com/photos/laundry-basket-ready-to-be-washed.jpg laundry basket ready to be washed
f03-1 https://burst.shopifycdn.com/photos/woman-in-soft-white-dress-sits-and-holds-her-pregnant-belly.jpg woman in soft white dress sits and holds her pregnant belly
@@ -38,7 +37,6 @@ b07-1 https://burst.shopifycdn.com/photos/a-water-jug-and-glass-on-a-table-by-a-
b08-1 https://burst.shopifycdn.com/photos/a-woman-holds-a-pink-flower-to-her-belly.jpg a woman holds a pink flower to her belly
b09-1 https://burst.shopifycdn.com/photos/camera-looks-down-at-a-plate-of-watermelon-and-lime.jpg camera looks down at a plate of watermelon and lime
b10-1 https://burst.shopifycdn.com/photos/too-many-stairs.jpg too many stairs
# 11-02 第四版新增/替换(每行:帖子标识 / 原图地址或 AI / 描述或提示词;AI 图约 13%,其余为 Burst 免费商用图)
b10-5 https://burst.shopifycdn.com/photos/persons-torso-and-jeans-standing-on-a-balcony.jpg persons torso and jeans standing on a balcony
m09-6 https://burst.shopifycdn.com/photos/holding-hands-on-wedding-day.jpg holding hands on wedding day
@@ -201,7 +199,6 @@ b01-2 AI 东亚男性在家里厨房水槽前洗碗的背影,写实摄影
b10-1 AI 穿宽松连衣裙的东亚孕妇扶着扶手在办公楼楼梯慢慢上楼,写实摄影
b10-2 https://burst.shopifycdn.com/photos/bedroom-bed-with-brown-throw-pillows.jpg bedroom-bed-with-brown-throw-pillows
w07-3 AI 东亚年轻妈妈在家用笔记本电脑整理工作,身旁婴儿摇椅里躺着宝宝,写实摄影
# 11-02 换图(用户:不放人、不露头)
f01-1 https://burst.shopifycdn.com/photos/black-coffee-and-phone-flatlay.jpg 早晨床上的手机、咖啡和本子(妈妈每日电话)
f02-3 https://burst.shopifycdn.com/photos/teapot-without-the-lid-on-the-white-plate.jpg 木桌上的紫砂壶与茶杯(听长辈说话)
@@ -279,7 +276,6 @@ b08-2 https://stocksnap.io/photo/notepad-paper-DB7F22291B 桌上的纸和笔(1
b10-3 https://wordpress.org/photos/photo/2866969dd6/ 纸巾盒(11-04 换图,wordpress CC0)
b10-4 https://wordpress.org/photos/photo/9276a1d3e0/ 工位上的水杯(11-04 换图,wordpress CC0)
b08-1 https://stocksnap.io/photo/couple-love-9Z2X6CTRAL 夜里床上两人手臂挨着、手牵手(不露脸)(11-04 换图,StockSnap CC0)
# 11-05 用户:所有图要真实、像手机随手拍。下面 11 篇原为 AI 图,换 Burst 真实照片;仍为 AI 的 8 篇待定:f09-2 f10-6 m01-2 m06-1 w06-3 b09-3 f10-7 b09-5
f04-3 https://burst.shopifycdn.com/photos/a-bowl-of-white-rice-surrounded-by-balls-of-dough.jpg 11-05 换真实照片
f06-5 https://burst.shopifycdn.com/photos/hands-hold-phone-in-bed.jpg 11-05 换真实照片
@@ -299,3 +295,21 @@ b11-3 https://burst.shopifycdn.com/photos/hands-using-a-tube-of-hand-cream.jpg 1
b11-4 https://burst.shopifycdn.com/photos/pink-sunglasses-on-white.jpg 11-05 新话题 b11 孕期护肤(phone2 处理,文件 907a18bf4027.jpg)
b11-5 https://burst.shopifycdn.com/photos/copper-light-in-bedroom.jpg 11-05 新话题 b11 孕期护肤(phone2 处理,文件 cf2001405d6e.jpg)
b11-6 https://burst.shopifycdn.com/photos/bathroom-shelving-mirror.jpg 11-05 新话题 b11 孕期护肤(phone2 处理,文件 53de7528f80f.jpg)
g114 https://burst.shopifycdn.com/photos/yellow-daisies-in-the-sun.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g114.webp)
g115 https://burst.shopifycdn.com/photos/sunflower-fills-center-of-a-frame.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g115.webp)
g117 https://burst.shopifycdn.com/photos/bath-bomb-near-tub.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g117.webp)
g118 https://burst.shopifycdn.com/photos/overhead-coffee-brown.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g118.webp)
g119 https://burst.shopifycdn.com/photos/stationery-and-pin-badges.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g119.webp)
g120 https://burst.shopifycdn.com/photos/globe-on-black-background.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g120.webp)
g121 https://burst.shopifycdn.com/photos/deep-red-sunset-on-the-horizon.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g121.webp)
g122 https://burst.shopifycdn.com/photos/relaxing-in-nature.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g122.webp)
g124 https://burst.shopifycdn.com/photos/hands-hold-red-apple.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g124.webp)
g125 https://burst.shopifycdn.com/photos/ripe-red-strawberries-in-a-white-bowl.jpg 11-05 首页「孕妈们的精彩分享」第 4~6 篇点赞头像(likers 扩充,av/g125.webp)
g126 https://burst.shopifycdn.com/photos/close-up-of-puppys-eyes.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g126.webp)
g127 https://burst.shopifycdn.com/photos/cupcakes-in-rows-against-a-red-background.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g127.webp)
g128 https://burst.shopifycdn.com/photos/close-up-of-a-fern-leaf-in-frame.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g128.webp)
g129 https://burst.shopifycdn.com/photos/a-person-with-an-umbrella-through-a-rain-speckled-window.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g129.webp)
g130 https://burst.shopifycdn.com/photos/colorful-rainbows.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g130.webp)
g131 https://burst.shopifycdn.com/photos/view-of-carnival-lights.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g131.webp)
g132 https://burst.shopifycdn.com/photos/young-woman-in-hat.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g132.webp)
g133 https://burst.shopifycdn.com/photos/muddy-farm-pig.jpg 11-05 精彩分享点赞头像换深色底(替换白底头像,av/g133.webp)

View File

@@ -912,10 +912,10 @@ html.night .gtg button.on{background:#F2725B;border-color:#F2725B;color:#fff}
<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=26110479"></script>
<script src="data.js?v=26110479"></script>
<script src="feed.js?v=26110479"></script>
<script src="../js/ava-pool.js?v=26110479"></script> <!-- 11-05 装饰头像分配表(各模块互不重复) -->
<script src="topics.js?v=26110480"></script>
<script src="data.js?v=26110480"></script>
<script src="feed.js?v=26110480"></script>
<script src="../js/ava-pool.js?v=26110480"></script> <!-- 11-05 装饰头像分配表(各模块互不重复) -->
<script src="ceshi/meta.js?v=26110464"></script>
<script src="../js/share-card.js?v=26110464"></script>
<script src="../js/cm-pics.js?v=26110464"></script> <!-- 11-05 评论 / 回复带图 -->
@@ -986,7 +986,7 @@ html.night .gtg button.on{background:#F2725B;border-color:#F2725B;color:#fff}
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=26110479').then(function (r) { return r.json(); }).then(function (j) {
fetch('cm.json?v=26110480').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) {

View File

@@ -107,7 +107,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=26110479"></script>
<script src="../topics.js?v=26110480"></script>
<script>
(function () {
'use strict';

View File

@@ -8,8 +8,8 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<title>兜爸心选 · 孕育陪伴</title>
<!-- 11-04 UGC 总开关(孕妈广场 + 测一测,后台 /box_bm/plaza 顶部切换),见 js/ugc.js -->
<script src="js/ugc.js?v=26110479"></script>
<!-- V:26110479 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<script src="js/ugc.js?v=26110480"></script>
<!-- V:26110480 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
<link rel="stylesheet" href="mama-box.css">
<link rel="stylesheet" href="night.css">
<!-- 11-04 用户:「顶部图片上的倒计时先删除掉」→ 不加载 hero-cd.css / hero-cd.js(文件留着,加回这两行即恢复),头图回到原样式 -->
@@ -2675,13 +2675,13 @@ html.night .rs-pan .rp-card{background:rgba(255,255,255,.06);border-color:rgba(2
<script src="/_bridge/avatar-picker.js?v=26101105"></script>
<script src="/_bridge/hand-icons.js?v=26101202"></script>
<script src="js/zodiac-art.js"></script>
<script src="guangchang/topics.js?v=26110479"></script>
<script src="js/ava-pool.js?v=26110479"></script> <!-- 11-05 装饰头像分配表(各模块互不重复) -->
<script src="guangchang/topics.js?v=26110480"></script>
<script src="js/ava-pool.js?v=26110480"></script> <!-- 11-05 装饰头像分配表(各模块互不重复) -->
<script src="js/app.js"></script>
<script src="js/kit.js?v=26110479"></script>
<script src="js/kit.js?v=26110480"></script>
<!-- 11-05 用户:孕期百问加上跟趣味小测试一样的底部 Tab(孕期百问 / 记一下 / 返回首页)。挂在 #detailQA 里,面板关着时跟着滑出屏外;
「记一下」直接开首页自己的记一下弹层(z 95 盖在百问 z 80 上),「返回首页」= 关掉百问面板 -->
<script src="js/mb-tabbar.js?v=26110479"></script>
<script src="js/mb-tabbar.js?v=26110480"></script>
<script>
(function () {
var d = document.getElementById('detailQA'); if (!d || !window.MBTab) return;
@@ -2701,7 +2701,7 @@ html.night .rs-pan .rp-card{background:rgba(255,255,255,.06);border-color:rgba(2
if (gchDone || !window.__mbUgc) return; gchDone = true;
var m = location.search.match(/[?&]gcv=([1-6])(?:&|$)/);
if (!m) window.__gcDefault = 1;
var n = m ? m[1] : '6', l = document.createElement('link'), s = document.createElement('script'), q = m ? Date.now() : 'v=26110479';
var n = m ? m[1] : '6', l = document.createElement('link'), s = document.createElement('script'), q = m ? Date.now() : 'v=26110480';
var dir = n === '4' || n === '6' ? 'js/gch/' : 'demo/gch/'; /* 11-03 上正式:定稿 V6(含它套的 V4)并进 js/gch/,其余效果稿仍在 demo/ */
l.rel = 'stylesheet'; l.href = dir + 'v' + n + '.css?' + q;
s.src = dir + 'v' + n + '.js?' + q;
@@ -2716,19 +2716,19 @@ html.night .rs-pan .rp-card{background:rgba(255,255,255,.06);border-color:rgba(2
/* 11-02 品牌露出(用户定 4 处都要):默认加载,?brand=0 可关掉对比;11-03 已并进 js/gch/ */
if (!/[?&]brand=0/.test(location.search)) {
var bl = document.createElement('link'), bs = document.createElement('script');
bl.rel = 'stylesheet'; bl.href = 'js/gch/brand.css?v=26110479'; bs.src = 'js/gch/brand.js?v=26110479';
bl.rel = 'stylesheet'; bl.href = 'js/gch/brand.css?v=26110480'; bs.src = 'js/gch/brand.js?v=26110480';
document.head.appendChild(bl); document.body.appendChild(bs);
}
})();
</script>
<!-- 2026-10-03 首页彩蛋:宝宝在肚皮底下动(独立文件,删掉这一行即整体下线;开关在「隐私权限」) -->
<script src="js/bump.js?v=26110479"></script>
<script src="js/bump.js?v=26110480"></script>
<!-- 2026-10-04 首页头图:按孕周换宝宝 + 阳光水波(独立文件) -->
<script src="js/hero-fx.js"></script>
<!-- 2026-10-05 首页头图:宝宝时不时动一动小手小脚(独立文件,删掉这一行即下线) -->
<script src="js/baby-limbs.js?v=26110479"></script>
<script src="js/coach.js?v=26110479"></script>
<script src="js/birth-flow.js?v=26110479"></script>
<script src="js/baby-limbs.js?v=26110480"></script>
<script src="js/coach.js?v=26110480"></script>
<script src="js/birth-flow.js?v=26110480"></script>
<!-- 禁止下拉回弹(2026-10-11 统一规则,与孕期体重同一段):竖向拖动时从手指下往上找还能朝该方向滚的容器,找不到才拦;横滑、双指、可滚列表不受影响 -->
<script>

File diff suppressed because one or more lines are too long

View File

@@ -83,9 +83,10 @@
/* ---------- 孕周 → 阶段 ---------- */
const STAGES = {
// drum:原地带节奏连踢的概率;chain:踢完不歇、旁边紧接着再踢的概率,最多连 chainMax 下(2026-10-04 用户:「有时会带点节奏、可以连续踢」)
flutter: { order: ['flick', 'flick', 'tap', 'flick'], gap: [10, 18], kick: false, again: 0, double: .45, follow: false, drum: 0, chain: 0 },
active: { order: ORDER, gap: [14, 25], kick: true, again: .34, double: 0, follow: true, drum: .4, chain: .3, chainMax: 3 },
late: { order: ['roll', 'butt', 'foot', 'roll', 'knee'], gap: [14, 25], kick: false, again: .15, double: 0, follow: true, slow: true, drum: .22, chain: .15, chainMax: 2 }
// 11-05 起间隔统一 25~35 秒(gap() 读 GAP,这里各阶段的 gap 只作记录)
flutter: { order: ['flick', 'flick', 'tap', 'flick'], gap: [25, 35], kick: false, again: 0, double: .45, follow: false, drum: 0, chain: 0 },
active: { order: ORDER, gap: [25, 35], kick: true, again: .34, double: 0, follow: true, drum: .4, chain: .3, chainMax: 3 },
late: { order: ['roll', 'butt', 'foot', 'roll', 'knee'], gap: [25, 35], kick: false, again: .15, double: 0, follow: true, slow: true, drum: .22, chain: .15, chainMax: 2 }
};
// 原地连踢的节奏型(每拍间隔,秒):匀速「哒哒哒」、「哒哒—哒」、「哒—哒哒」、两下一组
const RHYTHMS = [[.42, .42, .42], [.3, .3, .75, .3], [.6, .28, .28], [.32, .9, .32], [.38, .38, .38, .38]];
@@ -94,7 +95,12 @@
const stageOf = w => w == null || w < 20 ? null : w < 26 ? STAGES.flutter : w < 34 ? STAGES.active : STAGES.late;
let stage = stageOf(week);
// 两次之间隔多久:20~22 周最稀(再 +40%),越往后越接近本阶段的基准
const gap = () => { const g = stage ? stage.gap : [6, 10], m = week != null && week < 23 ? 1.4 : 1; return (g[0] + Math.random() * (g[1] - g[0])) * m; };
/* 11-05 用户:「用户来到首页静止不动,至少停 25 秒、25~35 秒之间随机才踢一次,所有孕周都这样」→ 各阶段统一 25~35 秒,不再按阶段 / 20~22 周加长;
而且要「一直没动」:点屏幕、滑动都会把倒计时重新从 25~35 秒数起(见 restart() 调用处),回到首页、开关打开也从头数 */
const GAP = [25, 35];
const gap = () => GAP[0] + Math.random() * (GAP[1] - GAP[0]);
let lastInput = -1e9; /* 最近一次真正的手指 / 滚轮操作(图片加载、布局变化引起的 scroll 不算用户动了) */
const restart = () => { if (mode === 'wait') wait = gap(); };
addEventListener('mb-preg', e => {
if (dbgWeek) return;
week = e.detail ? e.detail.week : null; stage = stageOf(week);
@@ -313,7 +319,7 @@
}
scr.addEventListener('pointerdown', e => {
lastTouch = performance.now();
lastTouch = lastInput = performance.now(); restart();
if (isOff() || (mode !== 'show' && !(mode === 'hide' && ft.h.v > 3)) || !ft.catchable) return;
const p = toContent(e.clientX, e.clientY), fx = ft.x + ft.ox, fy = ft.y + ft.oy;
// 只认鼓包中心那一圈;点在边上照常走原来的点击
@@ -329,7 +335,9 @@
window.addEventListener('click', e => {
if (performance.now() < blockUntil) { blockUntil = 0; e.preventDefault(); e.stopImmediatePropagation(); }
}, true);
scr.addEventListener('scroll', () => { lastTouch = performance.now(); run(); }, { passive: true });
/* 手指松开后的惯性滑动(3 秒内)也算在动;上面模块高度变化引起的滚动校正(浏览器 scroll anchoring)不算,否则停在页面中间时一直数不到 */
scr.addEventListener('scroll', () => { const t = performance.now(); if (t - lastInput < 3000) { lastTouch = t; restart(); } run(); }, { passive: true });
['touchstart', 'wheel'].forEach(t => scr.addEventListener(t, () => { lastInput = performance.now(); restart(); }, { passive: true }));
/* ---------- 物理 ---------- */
function step(dt) {
@@ -381,8 +389,8 @@
else if (still < .4 && (still += dt) >= .4) {
const fy = ft.y + ft.oy - top, seen = fy > 30 && fy < scr.clientHeight - 30;
if (!seen && stage && stage.follow) {
if (mode === 'show' || mode === 'hide') { ft.h.v = 0; ft.h.vel = 0; mode = 'wait'; release(); }
if (mode === 'wait') wait = Math.min(wait, 1 + Math.random() * .6);
if (mode === 'show' || mode === 'hide') { ft.h.v = 0; ft.h.vel = 0; mode = 'wait'; release(); wait = gap(); ft.chainNext = false; } /* 11-05 正踢着被滑走:重新等 25~35 秒 */
/* 11-05 起不再把等待缩到 1 秒多(要静止 25~35 秒才踢),只把宝宝挪到这一屏 */
}
}
spring(ft.h, dt); if (ft.h.v < 0) { ft.h.v = 0; ft.h.vel *= -.2; }
@@ -495,9 +503,12 @@
/* ---------- 循环:有东西在动才跑 rAF,静止时只用定时器数「下一次什么时候顶」 ---------- */
let running = false, last = 0, painted = false;
function frame(now) {
const dt = Math.min((now - last) / 1000, 1 / 20); last = now;
const wall = Math.min((now - last) / 1000, 1), dt = Math.min(wall, 1 / 20); last = now;
/* 物理按 dt 封顶防跳帧;等待倒计时按真实时间补齐(掉帧 / 省电模式下 rAF 慢,按封顶的 dt 数会数成一倍长) */
if (mode === 'wait' && active() && idle() && wall > dt) wait -= wall - dt;
if (!active()) {
if (mode !== 'wait') { mode = 'wait'; wait = 2; }
if (mode !== 'wait') mode = 'wait';
wait = gap(); /* 不在首页时一直重置:回到首页后从头数 25~35 秒 */
ft.h.v = ft.h.vel = 0; pk.d.v = pk.d.vel = 0; pk.held = false; jg.x.v = jg.y.v = jg.x.vel = jg.y.vel = 0;
}
const n = Math.max(1, Math.round(dt * 120));
@@ -515,18 +526,21 @@
let tickT = 0;
function tick() {
clearTimeout(tickT);
const t0 = performance.now();
tickT = setTimeout(() => {
if (running) return;
if (active() && idle() && mode === 'wait') { wait -= .25; if (wait <= 0) { appear(); if (running) return; } }
const el = Math.min((performance.now() - t0) / 1000, 1); /* 按真实经过的时间减(定时器会拖慢,按 .25 数会越数越长) */
if (!active()) { if (mode === 'wait') wait = gap(); } /* 11-05 不在首页 / 切后台:回来从头数 25~35 秒 */
else if (idle() && mode === 'wait') { wait -= el; if (wait <= 0) { appear(); if (running) return; } }
tick();
}, 250);
}
// 开关切换(「隐私权限」里那一行)
addEventListener('mb-bump', () => {
if (isOff()) { mode = 'wait'; ft.h.v = pk.d.v = 0; release(); cx.clearRect(0, 0, cv.width, cv.height); }
else { wait = 1.2; tick(); }
else { wait = gap(); tick(); }
});
// 调试 / 截图用:URL 带 bumpdebug 才挂
if (/bumpdebug/.test(location.href)) window.__bump = { ft, pk, atoms: () => atoms.map(a => [a.el.className || a.el.tagName, Math.round(a.x), Math.round(a.y), a.el.style.transform.slice(0, 90)]), mode: () => mode, now: () => { wait = 0; lastTouch = 0; }, week: () => week, at: (k, x, y) => { lastTouch = 0; appear(k, { x, y: y + scr.scrollTop }); } };
wait = 3; tick();
if (/bumpdebug/.test(location.href)) window.__bump = { ft, pk, atoms: () => atoms.map(a => [a.el.className || a.el.tagName, Math.round(a.x), Math.round(a.y), a.el.style.transform.slice(0, 90)]), mode: () => mode, w: () => [Math.round(wait * 10) / 10, Math.round(performance.now() - lastTouch), active(), running], now: () => { wait = 0; lastTouch = 0; }, week: () => week, at: (k, x, y) => { lastTouch = 0; appear(k, { x, y: y + scr.scrollTop }); } };
wait = gap(); tick();
})();

View File

@@ -244,5 +244,5 @@
}
/* feed.js 首页默认不加载(index.html 只引了 topics.js),这里按需拉一次 */
if (window.GC_FEED) init();
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110479'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
else { var fs = document.createElement('script'); fs.src = 'guangchang/feed.js?v=26110480'; fs.onload = fs.onerror = init; document.body.appendChild(fs); }
})();

View File

@@ -95,7 +95,7 @@
/* 11-04 用户:一行放下 作者头像 + 名字 + 点赞头像(仅前 3 条)+ N 点赞;不要小心心、不换行;同日再改:名字后面的孕周删掉 */
var n = x.likes || 0,
au = x.author ? '<span class="g6-au"><img src="' + esc(x.avatar || (window.MB_AVA && MB_AVA.S.author[x.id] ? MB_AVA.src(MB_AVA.S.author[x.id], '') : auAv(x.author))) + '" alt="" loading="lazy" decoding="async" width="36" height="36"><b>' + esc(x.author) + '</b></span>' : '',
heat = '<span class="g6-meta g6-sw"><span class="g6-rt">' + (i < 3 ? avs(i) : '') + '<span class="ms-h"><b>' + (n >= 1e4 ? Math.round(n / 1e3) / 10 + '万' : n) + ' 人点赞</b></span></span>' + au + '</span>'; /* 11-05 用户:两边对调 → 点赞头像 + N 人点赞在左,作者头像 + 名字在右 */ /* 11-04 用户:作者在左;访客头像 + 点赞数一起靠最右(点赞数在头像右边) */
heat = '<span class="g6-meta g6-sw"><span class="g6-rt">' + avs(i) + '<span class="ms-h"><b>' + (n >= 1e4 ? Math.round(n / 1e3) / 10 + '万' : n) + ' 人点赞</b></span></span>' + au + '</span>'; /* 11-05 用户:两边对调 → 点赞头像 + N 人点赞在左,作者头像 + 名字在右 */ /* 11-04 用户:作者在左;访客头像 + 点赞数一起靠最右(点赞数在头像右边) */
var q = new URLSearchParams(location.search); q.set('n', x.id);
return '<a class="ms-it ripple g6-nt" href="' + esc('guangchang/?' + q.toString() + location.hash) + '"><i class="ms-no">' + (i + 1) + '</i>' +
'<span class="ms-m"><span class="ms-q">' + esc(x.title) + '</span>' + heat + '</span>' +
@@ -133,7 +133,8 @@
function lkSrc(n) { return /:|^\//.test(n) && window.MB_AVA ? MB_AVA.src(n, '') : 'assets/img/mom/' + n + '.jpg'; }
function avaEl(n) { return '<img src="' + lkSrc(n) + '" alt="" loading="lazy" decoding="async" width="40" height="40">'; }
/* 11-03 用户:「头像错落一下,不一定都是 3 个,3、4、5、6 个都有」→ 每行个数打乱(固定表,刷新不跳),头像按顺序不重复取 */
var AV_N = [5, 6, 6]; /* 11-05 用户:「大家都在关注」第二篇头像 4 → 6 */ /* 11-04 三改:作者 + 孕周 + 点赞头像要挤一行,6~8 个放不下 → 4~6 个 */ /* 11-04 二改:只前 3 条带头像,每条 6~8 个、头像缩小 */
/* 11-05 用户:第 4、5、6 篇前面也出点赞头像,每篇随机 4~6 个(每次打开随机);头像池 likers 扩到 36 个,6 篇最多 35 个不重复 */
var AV_N = [5, 6, 6].concat([0, 0, 0].map(function () { return 4 + Math.floor(Math.random() * 3); })); /* 11-05 用户:「大家都在关注」第二篇头像 4 → 6 */ /* 11-04 三改:作者 + 孕周 + 点赞头像要挤一行,6~8 个放不下 → 4~6 个 */ /* 11-04 二改:只前 3 条带头像,每条 6~8 个、头像缩小 */
function avs(i) {
var h = '', c = AV_N[i] || 3;
if (!i) avaAt = 0;
@@ -156,7 +157,7 @@
likeT.forEach(clearTimeout); likeT = [];
(function loop() {
likeT[0] = setTimeout(function () {
var rs = list.querySelectorAll('.g6-nt'), i = Math.floor(Math.random() * Math.min(3, rs.length));
var rs = list.querySelectorAll('.g6-nt'), i = Math.floor(Math.random() * rs.length); /* 11-05 起 6 篇都有头像,6 篇里随机挑一篇换 */
if (rs[i] && !document.hidden && list.offsetParent) swapOne(rs[i]);
loop();
}, 3000 + Math.random() * 6000);