docs: intro animation for 晚晚 (22s, pure canvas, zero assets)

Single-file HTML, Canvas 2D, no libraries, no images, no fonts to load.

The one idea worth explaining: the accent colour IS the valence.
moodColor(v) maps v in [-1,1] across cold blue -> neutral grey -> warm amber,
and every mark in the frame reads from it. So when she drops, the whole
picture goes cold -- no caption has to tell you she is sad. Same data,
three places: the trace colour, the memory hue, the retrieval highlight.

Timeline is a pure function render(t), no RAF accumulation. Every frame
renders in isolation, which means frames are reproducible, any resolution
can be re-exported, and the preview can be captured frame-by-frame instead
of screen-recorded.

Four acts:
  0-6s   membrane   matter bounces off it, information passes through
  6-12s  heartbeat  beats with no input; positive recovers fast, negative slow
  12-17s memory     points sink by salience; one gets pulled back up
                    by a mood-matching cue; floor at 0.03 so nothing vanishes
  17-22s title

Also: ?t=12.5 freezes on that frame (for cover shots), and a REC button
uses canvas.captureStream + MediaRecorder to export webm directly.

Preview: 200 ANMF frames, 22000ms total, verified by parsing the RIFF/ANMF
chunks (Pillow does not expose per-frame WebP duration).

tools/render_preview.py renders frames via headless Chrome and assembles.
On this Windows box Python cannot spawn Chrome (0x80000003, same family as
the 0xC0000142 shell failure), so the render loop was driven from PowerShell
and the script only assembled. Both paths are documented in the script.
This commit is contained in:
mobai
2026-10-19 20:33:13 +08:00
parent 8dea68a25b
commit 1e9b08aed8
9 changed files with 1039 additions and 0 deletions
+30
View File
@@ -6,6 +6,36 @@
---
## 先看一眼
![晚晚 · 介绍动画](docs/preview.webp)
[**▶ 打开完整动画**](docs/intro.html) — 22 秒,纯代码生成,无任何外部资源
```
docs/intro.html 单文件动画,双击即播
docs/preview.webp 渲染好的预览(800×450 / 10fps / 22s / 0.5MB)
tools/render_preview.py 重新渲染、换分辨率、导出静帧
```
动画里有一条贯穿的主线:**强调色 = 当前效价 `v`**。
情绪低落时画面整体转冷,而不是靠字幕告诉你"她现在很难过"。
| 幕 | 时间 | 讲什么 |
|---|---|---|
| 膜 | 0–6s | 物质撞在膜上弹回,信息穿过去 |
| 心跳 | 6–12s | 没有输入时它也在跳;难过恢复得慢 |
| 记忆 | 12–17s | 记得的会沉下去,但沉不到底 |
| 名字 | 17–22s | — |
四张静帧:`docs/01-membrane.png` `02-heartbeat.png` `03-memory.png` `04-title.png`
动画本身的技术取舍:时间轴是纯函数 `render(t)`,不做 RAF 累加。
所以任意一帧都能独立渲染——这也是 `render_preview.py` 能逐帧截图、
而不需要真实录屏的原因。
---
## 它是什么
一个单用户、本地优先、常驻的存在,通过一层"膜"与你通信: