# Weight Wave (字重波)

A line starts at its thinnest; a bold wave about three characters wide sweeps left to right, each character settles at regular weight, and only the accent word ends heaviest. Weight only, no size or position change; for an opening claim or a chapter line.

- Ref: `video/motion-text-weight-wave` (code video · motion · any · any · 4s at 30fps)
- Page: https://uifino.com/en/videos/motion-text-weight-wave
- Markdown: https://uifino.com/md/videos/motion-text-weight-wave.md
- Preview image: https://uifino.com/videos/motion-text-weight-wave/poster.jpg

## Install

- ZIP: https://uifino.com/videos/motion-text-weight-wave/source.zip

A line starts at its thinnest; a bold wave about three characters wide sweeps left to right, each character settles at regular weight, and only the accent word ends heaviest. Weight only, no size or position change; for an opening claim or a chapter line.

Rendered video: https://uifino.com/videos/motion-text-weight-wave/preview.mp4

## Beats

- 0-0.3s Starting state: The whole line at wght 200; the accent word in the accent color Camera: static. On-screen text: "Every detail carries weight".
- 0.3-1.5s Weight wave sweeps the line: About three characters wide; each rises to 800 in 0.13 s and falls to 400 in 0.2 s, sine.inOut, 0.109 s apart; fixed-width cells keep positions still Camera: static.
- 1.8-2.4s Only the accent word stays heaviest: The accent word rises from 400 to 800 in 0.6 s, power3.out; everything else stays Camera: static.
- 2.4-4s Let the viewer read: Fully still: no breathing or drift Camera: static.

## Parameters

- `headline` Headline: default 每个细节，都有分量
- `accentWord` Accent word: default 分量
- `accentColor` Accent color: default #D4412A
- `bg` Background: default #F6F5F2
- `ink` Text color: default #121212
- `fontSize` Max font size: default 160px, range 64 to 200px
- `weightFrom` Start weight: default 200, range 100 to 400
- `weightPeak` Wave peak weight: default 800, range 500 to 900
- `weightRest` Resting weight: default 400, range 300 to 600
- `weightAccent` Accent final weight: default 800, range 600 to 900
- `startAt` Wave start: default 0.3s, range 0 to 1s
- `sweepDuration` Sweep duration: default 1.2s, range 0.6 to 2s
- `waveWidth` Wave width (characters): default 3, range 1.5 to 5
- `waveEase` Wave ease: default sine.inOut
- `accentStart` Accent start: default 1.8s, range 1.5 to 3s
- `accentDuration` Accent duration: default 0.6s, range 0.3 to 1s
- `accentEase` Accent ease: default power3.out

## Good for

- A single claim at the start of a film or chapter
- Pointing at the key word without color or scale
- Single-line copy in Chinese or English (7 to 12 characters, or 3 to 5 words)

## Not for

- Long or multi-line headlines
- Setups without a variable font (the weight axis must be continuous)

## Source files (plain text)

- https://uifino.com/videos/motion-text-weight-wave/source/SPEC.md
- https://uifino.com/videos/motion-text-weight-wave/source/PROMPT.md
- https://uifino.com/videos/motion-text-weight-wave/source/NOTICE.md
- https://uifino.com/videos/motion-text-weight-wave/source/project/assets/fonts/OFL.txt
- https://uifino.com/videos/motion-text-weight-wave/source/project/compositions/wave.html
- https://uifino.com/videos/motion-text-weight-wave/source/project/hyperframes.json
- https://uifino.com/videos/motion-text-weight-wave/source/project/index.html

## How to use

- Copy the beats and parameters; replace only the copy, the accent color and the product screenshots.
- `PROMPT.md` has two prompts: one to reproduce this video exactly, one to learn only the technique.
- Build with HyperFrames (`/hyperframes`); the project in the ZIP is a ready starting point.

## Files

| Path | Role | Size |
| :--- | :--- | ---: |
| PROMPT.md | doc | 2.7 KB |
| SPEC.md | doc | 5.7 KB |

### PROMPT.md

```md
# PROMPT：motion-text-weight-wave

## 照抄复刻
用 `/hyperframes` 做一个 1920×1080、30 fps、4 秒的标题动效，只有一行字，底色 `#F6F5F2`，字色 `#121212`，字号 160、行高 1.3，单行居中不换行，行的垂直中心在画面 45% 高度。西文用 Hanken Grotesk，中文用 Noto Sans SC（都是可变字体，`@font-face` 指向 `assets/fonts/`，`font-weight: 100 900`，不要联网取字体）。文案「每个细节，都有分量」，「分量」用强调色 `#D4412A`，颜色全程不变。

做法：
1. 把整句拆成单个字，每个字一个 `inline-block` 的格子，格子宽度固定：汉字和全角标点 = 字号，西文字母量出静止字重下的宽度。字形怎么变粗，格子都不动，所以位置不会抖。
2. 全句一开始就是 `font-variation-settings: "wght" 200`。
3. 波 0.3–1.5 秒：每个字依次先涨后落，只动 `font-variation-settings` 的 `wght`。
   - 全句 9 个字，波宽 3 个字，扫过全句 1.2 秒，字与字间隔 `1.2 ÷ (9 − 1 + 3)` = 0.1091 秒。
   - 每个字：涨 0.1309 秒，200 → 800；落 0.1964 秒，800 → 400；缓动 `sine.inOut`。第 i 个字（从 0 数）在 `0.3 + 0.1091 × i` 秒开始。
   - 用 GSAP 直接补间 `fontVariationSettings` 字符串（`'"wght" 200'` 到 `'"wght" 800'`），落段和后面的强调段都加 `immediateRender: false`，否则第 0 帧会显示成最粗。不要用回调函数改样式，跳帧时回调不会触发。
4. 强调 1.8–2.4 秒：「分」「量」一起 400 → 800，0.6 秒，`power3.out`。
5. 2.4–4.0 秒完全静止，其余字停在 400。
6. 不做缩放、位移、字距变化、颜色变化、淡入淡出。

需要替换的地方：
- 文案（变量 `headline`）：中文 `每个细节，都有分量`，英文 `Every detail carries weight`（英文 27 个字符，字号会自动缩到整行 1536px 宽）。
- 强调词（`accentWord`，必须是文案里的连续子串）：中文 `分量`，英文 `weight`。
- 颜色：强调色 `accentColor`、底色 `bg`、字色 `ink`；字号上限 `fontSize`。
- 字重：`weightFrom` 200、`weightPeak` 800、`weightRest` 400、`weightAccent` 800。
- 时间：`startAt` 0.3、`sweepDuration` 1.2、`waveWidth` 3、`waveEase` sine.inOut、`accentStart` 1.8、`accentDuration` 0.6、`accentEase` power3.out。

## 只学手法
可变字体的字重轴也能做动效：给每个字一个固定宽度的格子，再让一道约 3 个字宽的波扫过全句（1.2 秒，每字先涨 200 → 800 用 0.13 秒，再落 400 用 0.2 秒，`sine.inOut`），字只变粗细，不变大小和位置，波过后整句停在 400，最后只让强调词用 0.6 秒 `power3.out` 涨到 800。
```

### SPEC.md

```md
# SPEC：motion-text-weight-wave

一句话：一句标题全部从最细的 200 开始，一道变粗的波从左往右扫过每个字，波过去后字落回常规粗细 400，最后只剩强调词「分量」涨到 800。字号、字距、位置全程不变。

## LOOK
- 画布：1920×1080，30 fps，总长 4 秒。
- 色值（中性色 4 个，强调色 1 个）：
  - 底色 `#F6F5F2`
  - 字色 `#121212`
  - 次要字 `#6B6966`、分隔线 `#E2DFD8`：本条目画面里没有次要信息，只留在配色表里，不上屏
  - 强调色 `#D4412A`：只染「分量」两个字，面积远小于 10%；颜色从头到尾不变，不随波变化
- 字体（2 个族，本地 `@font-face`，字重范围 100 到 900，门禁按用到的字生成子集并保留字重轴）：
  - 西文：Hanken Grotesk，`assets/fonts/hanken-grotesk.woff2`
  - 中文：Noto Sans SC（思源黑体），`assets/fonts/noto-sans-sc.woff2`
  - 字体栈 `"Hanken Grotesk", "Noto Sans SC", sans-serif`
- 字号：只有 1 档，160px，行高 1.3，单行不换行。英文整行超过 1536px（画面宽的 80%）时，字号按比例缩小到刚好 1536px 宽，缩一次定死，不参与动画。中文默认文案总宽 9×160 = 1440px，不缩。
- 排版：单行水平居中，行的垂直中心在画面 45% 高度（486px）。每个字放进一个固定宽度的格子（`inline-block`，文字在格子里居中）：汉字和全角标点的格宽 = 字号；西文字母和空格的格宽 = 该字母在静止字重下量到的宽度（「分量」这类强调词在 800 下量，其余在 400 下量）。波经过时字形变宽变窄，但格子不动，所以左右邻居的位置全程不变。
- 圆角、阴影、渐变、装饰线：全部没有。画面上只有这一行字。

## MOTION
全片只有一个主动作：字重波，加一个收尾动作：强调词加粗。只动 `font-variation-settings` 的 `wght`。

**波**（每个字两段，字与字之间错开一个固定间隔）
- 全句字数 n = 9（「每个细节，都有分量」含逗号）。
- 波宽 3 个字，扫过全句 1.2 秒，从第 1 个字开始变粗算起，到最后 1 个字回到 400 为止。
- 每字间隔 step = 扫过时长 ÷ (n − 1 + 波宽) = 1.2 ÷ 11 = 0.1091 秒。
- 每字涨 = 波宽 × step × 0.4 = 0.1309 秒，200 → 800；每字落 = 波宽 × step × 0.6 = 0.1964 秒，800 → 400；缓动都是 `sine.inOut`（波峰处速度为零，不出尖角）。
- 第 i 个字（i 从 0 数）：开始涨 = 0.3 + 0.1091 × i；涨到 800 = 开始 + 0.1309；落回 400 = 开始 + 0.3273。第 1 个字 0.300 / 0.431 / 0.627 秒，最后 1 个字（i = 8）1.173 / 1.304 / 1.500 秒。

**强调**
- 1.8 秒开始，「分」「量」一起从 400 涨到 800，0.6 秒，`power3.out`，2.4 秒落定。
- 间隔：波在 1.5 秒结束，停 0.3 秒再强调，让「波过去」和「只留强调词」读成两件事。

**静止**：0 到 0.3 秒全句静止在 200；2.4 到 4.0 秒完全静止（1.6 秒），不呼吸、不漂移。

没有淡入淡出、位移、缩放、模糊、转场，运动模糊开关不用。

## 逐拍节拍表
| 拍 | 起止秒 | 画面 | 镜头 | 转场 | 屏幕文案原文 |
| --- | --- | --- | --- | --- | --- |
| thin | 0 - 0.3 | 整句最细（200），强调词是强调色 | 固定 | 无 | 每个细节，都有分量 |
| wave | 0.3 - 1.5 | 一道约 3 个字宽的加粗波从左扫到右，波过之处回到 400 | 固定 | 无 | 同上 |
| accent | 1.8 - 2.4 | 「分量」涨到 800，其余不动 | 固定 | 无 | 同上 |
| hold | 2.4 - 4.0 | 完全静止 | 固定 | 无 | 同上 |

英文版文案：`Every detail carries weight`，强调词 `weight`。代码按子串找强调词，按字符数（含空格）算波速，已用英文跑过门禁看过帧：英文 27 个字符，step = 1.2 ÷ 29 = 0.0414 秒，字号自动缩到整行 1536px 宽。

## 参数接线
全部是 `compositions/wave.html` 根元素上的 `data-composition-variables`，用 Studio 变量面板或宿主的 `data-variable-values` 改。

| 变量 id | 默认值 | 作用 |
| --- | --- | --- |
| `headline` | 每个细节，都有分量 | 整句文案 |
| `accentWord` | 分量 | 要涨到最粗并染强调色的子串，必须是文案里的连续一段 |
| `accentColor` | #D4412A | 强调色 |
| `bg` | #F6F5F2 | 底色 |
| `ink` | #121212 | 字色 |
| `fontSize` | 160 | 字号上限，px；整句超过 1536px 宽会自动缩小 |
| `weightFrom` | 200 | 起始字重 |
| `weightPeak` | 800 | 波峰字重 |
| `weightRest` | 400 | 波过后的常规字重 |
| `weightAccent` | 800 | 强调词最终字重 |
| `startAt` | 0.3 | 第 1 个字开始变粗的秒数 |
| `sweepDuration` | 1.2 | 波扫过全句的总时长，秒 |
| `waveWidth` | 3 | 波宽，按字数算 |
| `waveEase` | sine.inOut | 波的缓动（涨和落共用） |
| `accentStart` | 1.8 | 强调词开始加粗的秒数 |
| `accentDuration` | 0.6 | 强调词加粗时长 |
| `accentEase` | power3.out | 强调缓动 |

`index.html` 里的底色写死 `#F6F5F2`，换底色要同时改变量 `bg` 和 `index.html` 的 `html, body, #root` 三处背景。总时长 4 秒写在 `index.html` 根元素和场景宿主的 `data-duration`，变量改不了它。

## 禁用项
- 字放大缩小、位移、字距变化
- 颜色随波变化；整句一起变粗
- 逐字淡入、辉光、渐变字
- 落定后的呼吸、漂浮
- 画面上任何说明文字、字重数值、标签
- 阴影、圆角、装饰线

## 已知取舍
- 强调词从第 0 帧就是强调色，用来在「全句最细」时就埋下终点；颜色全程不变，符合「颜色不随波变化」。
- 汉字格宽取字号，逗号占满一格，逗号前后因此显得松，这是中文排版的正常样子，不为它改格宽。
```
