此刻:妈妈头像由卡通 SVG 换成 12 张 AI 写实头像 (v26101002)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BIN
assets/img/mom/m01.jpg
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/img/mom/m02.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/img/mom/m03.jpg
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/img/mom/m04.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/img/mom/m05.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/img/mom/m06.jpg
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/img/mom/m07.jpg
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
assets/img/mom/m08.jpg
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
assets/img/mom/m09.jpg
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/img/mom/m10.jpg
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
assets/img/mom/m11.jpg
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
assets/img/mom/m12.jpg
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
@@ -7,7 +7,7 @@
|
|||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
<title>兜爸心选 · 孕育陪伴</title>
|
<title>兜爸心选 · 孕育陪伴</title>
|
||||||
<!-- V:26101001 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
<!-- V:26101002 缓存版本标记:改 css/js 时同步 bump 该值(与 js/app.js 的 VER 同源),静态资源按 mtime 走 ETag 自动刷新 -->
|
||||||
<link rel="stylesheet" href="mama-box.css">
|
<link rel="stylesheet" href="mama-box.css">
|
||||||
<link rel="stylesheet" href="night.css">
|
<link rel="stylesheet" href="night.css">
|
||||||
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
|
<!-- 夜晚模式:首屏绘制前就按上次的选择加 class,避免先白后黑闪一下(开关在首页右上角 #nightBtn,逻辑见 app.js) -->
|
||||||
|
|||||||
27
js/app.js
@@ -3,7 +3,7 @@
|
|||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
/* 页面版本号(YYMMDD+序号):显示在「关于兜爸心选」页底部;bump 时同步 head 注释与 ?v= */
|
||||||
var VER = '26101001';
|
var VER = '26101002';
|
||||||
const $ = (s, c) => (c || document).querySelector(s);
|
const $ = (s, c) => (c || document).querySelector(s);
|
||||||
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
const $$ = (s, c) => Array.from((c || document).querySelectorAll(s));
|
||||||
|
|
||||||
@@ -3513,24 +3513,13 @@
|
|||||||
function pulseIco(k, cls) {
|
function pulseIco(k, cls) {
|
||||||
return '<span class="' + cls + '">' + (PULSE_ICO[k] || PULSE_ICO.box) + '</span>';
|
return '<span class="' + cls + '">' + (PULSE_ICO[k] || PULSE_ICO.box) + '</span>';
|
||||||
}
|
}
|
||||||
/* 妈妈头像插画(纯 SVG,5 种发色 × 3 种发型 × 5 种底色,按 seed 取)。只是装饰,不代表任何真实用户。 */
|
/* 妈妈头像(2026-10-10 用户:「此刻的头像换成真实人物的,不要卡通」)→ 12 张 AI 生成的写实头像照片,按 seed 取。
|
||||||
const MOM_HAIR = ['#4A3328', '#2F2420', '#6B4532', '#3B2A2A', '#7A5038'];
|
都是 AI 虚构人物,不对应任何真实用户、也不是真人照片(避免肖像权问题);96×96 JPG,共约 32KB,懒加载。
|
||||||
const MOM_BG = ['#FFD9CB', '#E6DCFF', '#FFE9B8', '#CDEBDD', '#FFD3E1'];
|
原来的 SVG 卡通头像(5 发色 × 3 发型 × 5 底色)见 git 历史 v26101001。 */
|
||||||
const MOM_TOP = ['#FF9E85', '#9F8CF0', '#F2B84B', '#6CBF9A', '#F07AA0'];
|
const MOM_N = 12;
|
||||||
function momAva(seed) {
|
function momAva(seed) {
|
||||||
const i = Math.abs(seed | 0), h = MOM_HAIR[i % 5], st = Math.floor(i / 5) % 3;
|
const n = ('0' + (Math.abs(seed | 0) % MOM_N + 1)).slice(-2);
|
||||||
const bg = MOM_BG[Math.floor(i / 3) % 5], top = MOM_TOP[(i + 2) % 5];
|
return '<img src="assets/img/mom/m' + n + '.jpg" alt="" loading="lazy" decoding="async" width="48" height="48">';
|
||||||
const back = st === 0 ? '<circle cx="20" cy="9" r="4.6" fill="' + h + '"/><path d="M11 21c0-7 4-11.5 9-11.5s9 4.5 9 11.5z" fill="' + h + '"/>'
|
|
||||||
: st === 1 ? '<path d="M9.5 23c0-9 4.6-14 10.5-14s10.5 5 10.5 14v11h-21z" fill="' + h + '"/>'
|
|
||||||
: '<path d="M10.3 25c-1-9 3.4-15.4 9.7-15.4S30.7 16 29.7 25l-2 2.4H12.3z" fill="' + h + '"/>';
|
|
||||||
return '<svg viewBox="0 0 40 40" aria-hidden="true"><rect width="40" height="40" fill="' + bg + '"/>' + back +
|
|
||||||
'<path d="M7 41c1.2-6.4 6.4-9.6 13-9.6S31.8 34.6 33 41z" fill="' + top + '"/>' +
|
|
||||||
'<rect x="17.6" y="28" width="4.8" height="4.6" rx="2" fill="#F6CDB8"/>' +
|
|
||||||
'<ellipse cx="20" cy="22.4" rx="8" ry="8.8" fill="#FFE3D3"/>' +
|
|
||||||
'<path d="M12 21.4c0-5.6 3.6-9.4 8-9.4s8 3.8 8 9.4c-2.6-2.6-5.8-3.9-8.6-4.1-2.4 1.6-4.6 3-7.4 4.1z" fill="' + h + '"/>' +
|
|
||||||
'<path d="M15.8 23.4q1.3 1.1 2.6 0M21.6 23.4q1.3 1.1 2.6 0" stroke="#5A3A2E" stroke-width="1.2" fill="none" stroke-linecap="round"/>' +
|
|
||||||
'<circle cx="15" cy="26" r="1.5" fill="#FF8F7A" opacity=".45"/><circle cx="25" cy="26" r="1.5" fill="#FF8F7A" opacity=".45"/>' +
|
|
||||||
'<path d="M18.6 27.2q1.4 1 2.8 0" stroke="#D9735E" stroke-width="1" fill="none" stroke-linecap="round"/></svg>';
|
|
||||||
}
|
}
|
||||||
const strSeed = t => { let x = 7; for (let i = 0; i < t.length; i++) x = (x * 31 + t.charCodeAt(i)) | 0; return Math.abs(x); };
|
const strSeed = t => { let x = 7; for (let i = 0; i < t.length; i++) x = (x * 31 + t.charCodeAt(i)) | 0; return Math.abs(x); };
|
||||||
/* 「此刻」重绘钩子:足迹 / 档案 / 盲盒状态回来时调用(它们决定「和你比」「今日待办」和孕周) */
|
/* 「此刻」重绘钩子:足迹 / 档案 / 盲盒状态回来时调用(它们决定「和你比」「今日待办」和孕周) */
|
||||||
@@ -4131,7 +4120,7 @@
|
|||||||
if (avs.dataset.seed === String(seed)) return;
|
if (avs.dataset.seed === String(seed)) return;
|
||||||
avs.dataset.seed = seed;
|
avs.dataset.seed = seed;
|
||||||
/* 2026-10-02 用户:「头像现在展示 3 个,给我展示 6 到 8 个」→ 7 个 */
|
/* 2026-10-02 用户:「头像现在展示 3 个,给我展示 6 到 8 个」→ 7 个 */
|
||||||
avs.innerHTML = [3, 11, 7, 19, 2, 14, 23].map(x => '<i>' + momAva(x + seed) + '</i>').join('');
|
avs.innerHTML = [3, 10, 7, 0, 5, 9, 1].map(x => '<i>' + momAva(x + seed) + '</i>').join(''); // 7 个按 12 取模互不相同,叠在一起不撞脸
|
||||||
}
|
}
|
||||||
function paintPeer(p) {
|
function paintPeer(p) {
|
||||||
paintAvs(p.week);
|
paintAvs(p.week);
|
||||||
|
|||||||
@@ -2712,7 +2712,8 @@ a.skip:focus{left:16px;top:16px}
|
|||||||
/* 此刻 · 同孕周(A+B 改版,2026-10-01):人物头像表现「人」,不用应用 logo,和上面工具卡(色块 + logo)拉开。 */
|
/* 此刻 · 同孕周(A+B 改版,2026-10-01):人物头像表现「人」,不用应用 logo,和上面工具卡(色块 + logo)拉开。 */
|
||||||
.pl-row .pr-ava,.pp-avs i{flex:0 0 auto;display:block;border-radius:50%;overflow:hidden;background:#FFE3D3}
|
.pl-row .pr-ava,.pp-avs i{flex:0 0 auto;display:block;border-radius:50%;overflow:hidden;background:#FFE3D3}
|
||||||
.pl-row .pr-ava{width:18px;height:18px}
|
.pl-row .pr-ava{width:18px;height:18px}
|
||||||
.pr-ava svg,.pp-avs svg{display:block;width:100%;height:100%}
|
.pr-ava svg,.pp-avs svg,.pr-ava img,.pp-avs img{display:block;width:100%;height:100%}
|
||||||
|
.pr-ava img,.pp-avs img{object-fit:cover}
|
||||||
.pp-avs{flex:0 0 auto;display:flex}
|
.pp-avs{flex:0 0 auto;display:flex}
|
||||||
.pp-avs:empty{display:none}
|
.pp-avs:empty{display:none}
|
||||||
.pp-avs i{width:22px;height:22px;margin-left:-7px;border:1.5px solid #FFF6F0}
|
.pp-avs i{width:22px;height:22px;margin-left:-7px;border:1.5px solid #FFF6F0}
|
||||||
|
|||||||