diff --git a/.workbuddy/memory/2026-10-19.md b/.workbuddy/memory/2026-10-19.md index 8b90140..90344fd 100644 --- a/.workbuddy/memory/2026-10-19.md +++ b/.workbuddy/memory/2026-10-19.md @@ -173,3 +173,32 @@ P2 = 图标统一(UIkit icons 取代 emoji/位图 png)、标签减量、view `outputs/preview-{home,box,explore}-{light,dark}.html`,用无头 Chrome 截图核对过亮暗两套。 ⚠️ 本机 **Chrome 新版 headless 会挂住**,必须 `--headless=old`,且页面外部资源要本地化 (`outputs/preview-assets/`,从 cdnjs.snrat.com 取 UIkit 3.3.3;cloudflare/jsdelivr 在本机不通)。 + +## 封面遮罩 P0 缺陷修复(重要) + +**症状**:`.tb-cover::after` 遮罩不渲染,且**完全不报错**——截图对比像素只差 ±1(只看着像"没效果")。 + +**根因**:UIkit 3.3.3 自带 +`.uk-flex::after,.uk-flex::before{display:none}`(优先级 0,2,0), +而封面元素是 `uk-flex`,我写的 `.tb-cover::after`(0,1,1)优先级不够 → 被压成 display:none。 +定位方法:`getComputedStyle(el,'::after').display` 得到 `none`;再逐个 `classList.remove` 试 → +去掉 `uk-flex` 立刻变 `block`。最后在 uikit.min.css 里 grep 到那条规则。 +**修法**:选择器写成 `.tb-cover::after, .tb-cover.uk-flex::after` 并显式 `display:block`。 + +**实测效果**(无头 Chrome 截图 + 像素测量,非目测): +- 深色渐变背景 + 白字:封面底部亮度 0.229→0.102,白字对比度 **3.77→6.89**(过 WCAG AA 4.5) +- 线上默认背景(`box_background.png` 2048×1152,接近全白)+ 黑字:0.912→0.971,对比度 19.25→20.42, + 即**对默认背景几乎没有可见影响** +- 亮度判定 JS 已验证:`#fff` 会加 `tb-cover-dark`,`#000` 不加。 + +**教训**:CSS 改动不能只看"规则写上了/类加上了",必须量像素。伪元素 + UIkit 工具类组合要在计算样式层验证。 + +## 账号背景图的真实链路(回答用户提问时查证) + +- 注册时把 `[upload] default_background` **一次性复制**进 `users.background`(`route/auth/register.go:51`), + 不是每次渲染兜底 → 之后改配置**不影响存量用户**。 +- 页面只用 `.PageUser.Background` 渲染 `data-src`;为空则无背景图、无遮罩。 +- 分享卡是另一条路:`route/question/share.go:345` 用 `user.Background`,为空时回退 `conf.App.ShareBackground`。 +- 线上 `box.shiroko.one/_/tamakyi` 实际值 = `https://r2.337845818.best/tamabox/box_background.png`。 +- 预览里那张"渐变图"是 `zz_preview_test.go` 造的测试数据(data: URI 渐变),**不是产品行为**; + 顺带发现 Go 模板会把 `data:` URI 在属性上下文里替换成 `#ZgotmplZ`(真实 http URL 不受影响)。 diff --git a/outputs/cmp-bg-with.png b/outputs/cmp-bg-with.png new file mode 100644 index 0000000..ef9eaf0 Binary files /dev/null and b/outputs/cmp-bg-with.png differ diff --git a/outputs/cmp-bg-without.png b/outputs/cmp-bg-without.png new file mode 100644 index 0000000..3298c0c Binary files /dev/null and b/outputs/cmp-bg-without.png differ diff --git a/outputs/cmp-new-with.png b/outputs/cmp-new-with.png new file mode 100644 index 0000000..633d9e3 Binary files /dev/null and b/outputs/cmp-new-with.png differ diff --git a/outputs/cmp-new-without.png b/outputs/cmp-new-without.png new file mode 100644 index 0000000..46e8b71 Binary files /dev/null and b/outputs/cmp-new-without.png differ diff --git a/outputs/default-bg.png b/outputs/default-bg.png new file mode 100644 index 0000000..f3656e6 Binary files /dev/null and b/outputs/default-bg.png differ diff --git a/outputs/preview-box-dark.html b/outputs/preview-box-dark.html index fb83682..730ea7b 100644 --- a/outputs/preview-box-dark.html +++ b/outputs/preview-box-dark.html @@ -3,7 +3,7 @@ - 预览 10:58 · + 预览 11:18 · @@ -53,15 +53,11 @@ - + - - + +
-
+

测试箱主

@@ -1276,7 +1275,7 @@ document.getElementById("introcolor").style.color = "#ffffff"; href="/_/tester/1">查看回答
⭐ - 2026-10-19 10:58:34 + 2026-10-19 11:18:39

置顶的问题

@@ -1288,7 +1287,7 @@ document.getElementById("introcolor").style.color = "#ffffff"; href="/_/tester/2">查看回答
- 2026-10-19 09:58:34 + 2026-10-19 10:18:39

普通问题

diff --git a/outputs/preview-box-light.html b/outputs/preview-box-light.html index 469e809..0d48969 100644 --- a/outputs/preview-box-light.html +++ b/outputs/preview-box-light.html @@ -3,7 +3,7 @@ - 预览 10:58 · + 预览 11:18 · @@ -53,15 +53,11 @@ - + - - + +
-
+

测试箱主

@@ -1276,7 +1275,7 @@ document.getElementById("introcolor").style.color = "#ffffff"; href="/_/tester/1">查看回答
⭐ - 2026-10-19 10:58:34 + 2026-10-19 11:18:39

置顶的问题

@@ -1288,7 +1287,7 @@ document.getElementById("introcolor").style.color = "#ffffff"; href="/_/tester/2">查看回答
- 2026-10-19 09:58:34 + 2026-10-19 10:18:39

普通问题

diff --git a/outputs/preview-defaultbg-with.html b/outputs/preview-defaultbg-with.html new file mode 100644 index 0000000..ae8c5bb --- /dev/null +++ b/outputs/preview-defaultbg-with.html @@ -0,0 +1,1505 @@ + + + + + + 预览 10:58 · + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+ + + + + + + + +
+
+
+ +

测试箱主

+

欢迎提问

+
+ + + + + +
+
+
+
+ +
+
+ + + + +
+ + +

扫码向@测试箱主提问
谁都可以以匿名的形式提问

+ + + + + + + + + + + + + + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + + +
+ +
+
+ + + +
+ +
+
+ +
+ + + +
+ +
+
+
+ + + +
+ +
+ +
+ +
+
+
+ + + + + + +

@测试箱主 以前回答过的问题 (2)

+ +
+ +
+
+ 查看回答 +
+ ⭐ + 2026-10-19 10:58:34 +
+

置顶的问题 +

+
+ +
+
+ 查看回答 +
+ + 2026-10-19 09:58:34 +
+

普通问题 +

+
+ +
+ + +
+ +
+
+ 无更多留言 +

+
+
+ + +
+ + +
+
+ +

+
+ 社区规则 | + + 找站长 +
+ 盘 + | 公告板 + | 聊天室 + | 监控板 + | 导航页 +
Powered by NekoBox | +
提问箱已成功存活: +

+ + +
+
+ + + + diff --git a/outputs/preview-defaultbg-without.html b/outputs/preview-defaultbg-without.html new file mode 100644 index 0000000..ae8c5bb --- /dev/null +++ b/outputs/preview-defaultbg-without.html @@ -0,0 +1,1505 @@ + + + + + + 预览 10:58 · + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+ + + + + + + + +
+
+
+ +

测试箱主

+

欢迎提问

+
+ + + + + +
+
+
+
+ +
+
+ + + + +
+ + +

扫码向@测试箱主提问
谁都可以以匿名的形式提问

+ + + + + + + + + + + + + + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + + +
+ +
+
+ + + +
+ +
+
+ +
+ + + +
+ +
+
+
+ + + +
+ +
+ +
+ +
+
+
+ + + + + + +

@测试箱主 以前回答过的问题 (2)

+ +
+ +
+
+ 查看回答 +
+ ⭐ + 2026-10-19 10:58:34 +
+

置顶的问题 +

+
+ +
+
+ 查看回答 +
+ + 2026-10-19 09:58:34 +
+

普通问题 +

+
+ +
+ + +
+ +
+
+ 无更多留言 +

+
+
+ + +
+ + +
+
+ +

+
+ 社区规则 | + + 找站长 +
+ 盘 + | 公告板 + | 聊天室 + | 监控板 + | 导航页 +
Powered by NekoBox | +
提问箱已成功存活: +

+ + +
+
+ + + + diff --git a/outputs/preview-explore-dark.html b/outputs/preview-explore-dark.html index b76b788..ba476cf 100644 --- a/outputs/preview-explore-dark.html +++ b/outputs/preview-explore-dark.html @@ -3,7 +3,7 @@ - 预览 10:58 · 投票 + 预览 11:18 · 投票 @@ -53,15 +53,11 @@ - + - - + + + - - + + + - - + + + - - + + ` for _, theme := range []string{"light", "dark"} { box, err := renderToString(t, "question/list", boxData)