style(首页头图): LOGO 深棕白描边;倒计时白胶囊、孕周层次;光束摆动加大;水波恢复且避开宝宝 (v26100419)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 06:28:24 +00:00
parent a031686ec0
commit 55e293874f
4 changed files with 29 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
(function () {
'use strict';
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
var VER = '26100418';
var VER = '26100419';
const $ = (s, c) => (c || document).querySelector(s);
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));

View File

@@ -90,7 +90,7 @@
// 宝宝保护:孕囊中心附近 → 0,囊边 → 1
function guard(x, y) {
const d = Math.hypot(x - SX, y - SY) / SR;
return d < .45 ? 0 : d > .95 ? 1 : (d - .45) / .5;
return d < .62 ? 0 : d > 1.05 ? 1 : (d - .62) / .43; // 宝宝缩到 70% 后大约占孕囊半径的 6 成
}
// 水波:四层不同方向、不同速度的长波叠加,取正半部分 → 一片片柔和的亮斑缓缓流过
function water(t) {
@@ -101,7 +101,7 @@
let w = Math.sin(u * 1.1 + T) + Math.sin(v * 1.3 - T * .8 + u * .4) + Math.sin((u - v) * .9 + T * .6) + Math.sin(Math.hypot(u - 4.5, v - 1) * 1.6 - T * 1.1);
w = w / 4; w = w > 0 ? w * w : 0; // 只留亮的那半,平方让过渡更软
const X = x / CW * W, Y = y / ch * H;
const g = .15 + .85 * guard(X, Y);
const g = guard(X, Y); // 宝宝那一圈完全不叠水波
const o = (y * CW + x) * 4;
d[o] = 255; d[o + 1] = 238; d[o + 2] = 214; d[o + 3] = w * 200 * g * (1 - y / ch * .35);
}
@@ -123,8 +123,9 @@
rx.clearRect(0, 0, w, h);
rx.globalCompositeOperation = 'lighter';
RAYS.forEach(([a0, ww, al], i) => {
const a = Math.PI * .6 + a0 + Math.sin(t * .09 + i * 1.9) * .03;
const k = al * (.6 + .4 * Math.sin(t * .23 + i * 2.1));
// 2026-10-04 用户:「射下来的光束可以动一动」→ 摆幅 .03→.07、摆速加快,明暗起伏更明显
const a = Math.PI * .6 + a0 + Math.sin(t * .16 + i * 1.9) * .07;
const k = al * (.45 + .55 * Math.sin(t * .35 + i * 2.1));
const wv = ww * (1 + .2 * Math.sin(t * .17 + i));
const gr = rx.createLinearGradient(ox, oy, ox + Math.cos(a) * L * .8, oy + Math.sin(a) * L * .8);
gr.addColorStop(0, 'rgba(255,248,228,0)');
@@ -173,7 +174,10 @@
const t = now / 1000;
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
ctx.clearRect(0, 0, W, H);
// 2026-10-04 用户:「水波纹那一层先去掉,动的是宝宝自己(腿脚、嘴角),不是水」→ 不再画水波
/* 水波:2026-10-04 先关后开 —— 用户之前看到的「宝宝脸/腿变形」其实是 GIF 自带的扭动(已停用 GIF),
这层只是叠加的柔光,不做任何形变;而且宝宝那一圈(guard)完全不叠,宝宝表情一点不受影响。 */
if ((tick ^= 1)) water(t);
drawWater();
rays(t);
dots(t, dt);
}