feat(首页头图): 宝宝按孕周 9 阶段换形态、孕囊随之缩放;花瓣换成阳光水波 (v26100407)

- 背景换成去掉羊水囊的空背景,羊水囊+宝宝整幅按阶段换(4/8/11/14/18/24/28/32/36 周)
- 每阶段一张本地程序化形变 GIF(呼吸、轻浮、小手、蹬脚;脸不动,闭眼闭嘴)+ 同帧静图打底
- 孕囊直径按阶段 .42~1.03 倍,围绕原圆心缩放
- 去掉花瓣飘落;新增 #heroFx 画布:斜照光束 + 水波焦散,离开首页/不可见时停画
- 逻辑独立在 js/hero-fx.js,调试 ?kidweek=N

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 02:14:41 +00:00
parent 51b1e392aa
commit e718e8298d
23 changed files with 174 additions and 62 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26100406';
var VER = '26100407';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
@@ -445,22 +445,6 @@
requestAnimationFrame(() => { b.style.width = p + '%'; });
}
/* ================= 花瓣飘落 ================= */
(function petals() {
const box = $('#petals');
if (!box) return;
for (let i = 0; i < 10; i++) {
const p = document.createElement('i');
p.style.left = Math.random() * 100 + '%';
p.style.animationDuration = (6 + Math.random() * 6) + 's';
p.style.animationDelay = (Math.random() * 8) + 's';
p.style.opacity = 0.3 + Math.random() * 0.5;
const s = 5 + Math.random() * 7;
p.style.width = s + 'px'; p.style.height = s + 'px';
box.appendChild(p);
}
})();
/* ================= 分段控件(档案) ================= */
function initSegmented(segId, thumbId, attr, onChange) {
const seg = $(segId), thumb = $(thumbId);
@@ -5172,15 +5156,7 @@
if (document.visibilityState !== 'hidden') resetScreenOnShow();
});
/* 首页头图里会动的宝宝(2026-09-30,v6 起是 GIF)。装饰用:加载完再淡入,没加载出来就停在底下的静态图上。
「减少动态效果」下 CSS 直接隐藏。 */
(function heroKid() {
var g = document.getElementById('heroKid');
if (!g) return;
function on() { g.classList.add('is-on'); }
if (g.complete && g.naturalWidth) on();
else g.addEventListener('load', on);
})();
/* 首页头图里会动的宝宝:2026-10-04 起按孕周换图,整段移到 js/hero-fx.js */
if (document.readyState === 'complete') init();
else window.addEventListener('load', init);