feat(首页头图): 羊水囊不再动,改成囊里的宝宝自己动(吸手指、蹬腿) (v26093006)

- 去掉整层浮动和整图「胎动」扭动(用户:球不要动,要里面的宝宝动)。
- 母婴作图的 25w.mp4 取前 10s,只截囊内 600×600,正放 + 倒放拼成 20s 无缝循环,
  400×400 / 288KB(assets/video/b6476cfce328.mp4),遮罩只露囊内,叠在静态囊图上。
- 静态囊图换成视频第 1 帧(70812d56ec5f.jpg),视频淡入时画面对得上;放不了就停在静态图。
- 微信 iOS 等 WeixinJSBridgeReady 再 play();页面隐藏时暂停;减少动态效果下不放。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 09:20:13 +00:00
parent b69a02e570
commit f21af1e25b
6 changed files with 52 additions and 31 deletions

View File

@@ -192,7 +192,7 @@ a.skip:focus{left:16px;top:16px}
⚠️ 上面这些是**设计稿**的数,不是现在的实现值。设计稿里没有 slogan,
加进去之后品牌字以下整列都下移了,实际纵向排布以 .home-hero 里那笔账为准。 */
/* 2026-09-30 背景换成孕 25 周图(底子 assets/img/7dfe5be4e828.jpg,1560×750 = 3 倍图 520×250;
羊水囊 + 宝宝单独一层 bc6367fcad38.jpg,见 .hero-baby):
羊水囊 + 宝宝单独一层 70812d56ec5f.jpg + 视频 b6476cfce328.mp4,见 .hero-baby):
只抠了原图里的羊水囊 + 宝宝(孕肚太写实,用户要求去掉),缩到原来约 8 成放在右侧,
底子是按原图色调重铺的紫玫瑰渐变 + 囊后一圈暖光晕 + 散景光点。
图高钉死 = 橙区高、右对齐,屏宽 ≤520 都铺得满;再宽就露底色 #5c344e(=图左缘色)。
@@ -297,33 +297,30 @@ a.skip:focus{left:16px;top:16px}
底子背景图右对齐、高 = 橙区高 H;这张囊图是从同一张 1560×750 合成图里原样切出来的
(x 940..1560, y 50..710),所以按 H 换算摆回原位就严丝合缝:
宽 620/750 = .8267H,高 660/750 = .88H,顶 50/750 = .0667H,右 0。
方图四角带着底色,用径向渐变遮罩把边缘羽化掉 —— 这样宝宝动起来,边上不会露出方块。
动效分两层,transform 才不会互相覆盖:
外壳 .hero-baby 慢慢上下浮(6s,像漂在羊水里)
图片 .hero-sac 「胎动」:大部分时间静止,每 7.3s 里突然小幅扭一下、再轻轻蹬一下,
周期和外壳的 6s 错开,叠起来就不像在同一个节拍上重复。 */
方图四角带着底色,用径向渐变遮罩把边缘羽化掉。
2026-09-30 用户要求:「球」(羊水囊)不动,只让里面的宝宝自己动(吸手指、蹬腿)。
所以去掉了整层浮动和整图扭动,改成:
.hero-sac 静态图垫底 = 母婴作图给的 25w.mp4 第 1 帧(囊内 600×600 摆在容器 (10,30))
.hero-kid 同一块 600×600 截成的短视频:原片前 10s 正放 + 倒放 = 20s 无缝循环
(原片镜头在慢慢推近、结尾姿势和开头对不上,直接 loop 会跳;倒放回来首尾就是同一帧)。
只露囊内(遮罩 86%→98%),囊壁用底下静态图的,镜头推近时囊壁不会跟着胀。
放起来之前 opacity:0,JS 收到 playing 再淡入 —— 放不了就一直是静态图,不会出现黑框/播放按钮。 */
.hero-baby{position:absolute;z-index:2;right:0;
top:calc((250px + env(safe-area-inset-top)) * .0667);
width:calc((250px + env(safe-area-inset-top)) * .8267);
height:calc((250px + env(safe-area-inset-top)) * .88);
pointer-events:none;user-select:none;animation:float 6s ease-in-out infinite}
.hero-sac{display:block;width:100%;height:100%;transform-origin:52% 55%;
pointer-events:none;user-select:none}
.hero-sac{display:block;width:100%;height:100%;
-webkit-mask-image:radial-gradient(closest-side,#000 91%,transparent 100%);
mask-image:radial-gradient(closest-side,#000 91%,transparent 100%);
animation:kick 7.3s ease-in-out infinite}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-5px)}}
@keyframes kick{
0%,52%,100%{transform:none}
56%{transform:rotate(-2.6deg) translate(-2px,1px) scale(1.012)}
61%{transform:rotate(1.4deg) translate(1px,-1px)}
66%{transform:none}
80%{transform:none}
83%{transform:rotate(-1.2deg) translate(-1px,0)}
87%{transform:none}
}
/* 嘴边的小气泡。起点定在囊图里嘴(拳头)的位置(50.6%/48.2%),往左上飘 ——
宝宝头朝右上侧躺,左上正好是「水面」方向。 */
.hb-bub{position:absolute;left:50.6%;top:48.2%;width:7px;height:7px;border-radius:50%;
mask-image:radial-gradient(closest-side,#000 91%,transparent 100%)}
.hero-kid{position:absolute;left:1.613%;top:4.545%;width:96.774%;height:90.909%;
object-fit:cover;background:transparent;opacity:0;transition:opacity .8s ease;
-webkit-mask-image:radial-gradient(closest-side,#000 86%,transparent 98%);
mask-image:radial-gradient(closest-side,#000 86%,transparent 98%)}
.hero-kid.is-on{opacity:1}
/* 嘴边的小气泡。起点定在视频里嘴(拳头)大致的位置(50%/47%),往左上飘 ——
宝宝头朝右上侧躺,左上正好是「水面」方向。z-index 压在视频上面。 */
.hb-bub{position:absolute;z-index:1;left:50%;top:47%;width:7px;height:7px;border-radius:50%;
background:rgba(255,255,255,.5);box-shadow:inset 0 0 0 1px rgba(255,255,255,.8);
opacity:0;animation:bub 4.2s ease-in-out infinite}
@keyframes bub{
@@ -333,11 +330,11 @@ a.skip:focus{left:16px;top:16px}
100%{transform:translate(-16px,-46px) scale(1.15);opacity:0}
}
/* 三颗错开大小、时长和出发点,才不像在同一个节拍上打点 */
.hb-bub.b2{left:47.8%;top:50%;width:5px;height:5px;animation-duration:5.1s;animation-delay:1.4s}
.hb-bub.b3{left:52.4%;top:46.8%;width:9px;height:9px;animation-duration:4.7s;animation-delay:2.7s}
.hb-bub.b2{left:47.2%;top:48.8%;width:5px;height:5px;animation-duration:5.1s;animation-delay:1.4s}
.hb-bub.b3{left:51.8%;top:45.6%;width:9px;height:9px;animation-duration:4.7s;animation-delay:2.7s}
/* 系统开了「减少动态效果」就全部停下:这类装饰性循环动画是前庭不适的常见诱因 */
@media (prefers-reduced-motion:reduce){
.hero-baby,.hero-sac{animation:none}
.hero-kid{display:none}
.hb-bub{animation:none;opacity:0}
}