# Data Count-Up Settle (数字计数落定)

One big number counts from 0 to its target on a long ease-out, slows into the last digits, and only after it lands do the unit and caption rise in; for showing one key figure.

- Ref: `video/motion-data-count-up` (code video · motion · launch, changelog, brand, any · any · 3.5s at 30fps)
- Page: https://uifino.com/en/videos/motion-data-count-up
- Markdown: https://uifino.com/md/videos/motion-data-count-up.md
- Preview image: https://uifino.com/videos/motion-data-count-up/poster.jpg

## Install

- ZIP: https://uifino.com/videos/motion-data-count-up/source.zip

One big number counts from 0 to its target on a long ease-out, slows into the last digits, and only after it lands do the unit and caption rise in; for showing one key figure.

Rendered video: https://uifino.com/videos/motion-data-count-up/preview.mp4

## Beats

- 0-1.5s The number counts from 0 to the target: From 0.1 s, 12,480 counts for 1.4 s on expo.out; every character has a fixed width so nothing shifts; the color goes from secondary to primary Camera: static. On-screen text: "12,480".
- 1.5-2.4s Unit and caption appear once the number stops: A hairline (#3A4A40) draws from the left; unit, dot and caption rise out of masks, expo.out 0.6 s, 0.08 s apart Camera: static. On-screen text: "deploys · this week".
- 2.4-3.5s Let the viewer read: Fully still: no scale, drift or breathing Camera: static.

## Parameters

- `target` Target number: default 12480, range 100 to 999999
- `unit` Unit text: default 次部署
- `caption` Caption: default 本周
- `numberSize` Number font size: default 320px, range 240 to 400px
- `countStart` Count start: default 0.1s, range 0 to 0.5s
- `countDuration` Count duration: default 1.4s, range 1 to 2s
- `countEase` Count ease: default expo.out
- `unitDelay` Delay from landing to unit: default 0.1s, range 0.05 to 0.4s
- `riseDuration` Unit rise duration: default 0.6s, range 0.4 to 0.9s
- `riseEase` Unit rise ease: default expo.out
- `stagger` Unit stagger: default 0.08s, range 0.05 to 0.12s
- `accentColor` Accent color: default #7FD99A
- `bg` Background: default #0F1712
- `ink` Text color: default #ECF2EE
- `muted` Secondary text color: default #8FA096
- `rule` Hairline color: default #3A4A40

## Good for

- A single key figure per screen, such as deploys, users or completions
- A unit and time range right after the number
- Works in Chinese and English, numbers of 3 to 6 digits

## Not for

- Comparison screens where several numbers count at once
- Data pages that need charts, progress rings or gauges

## Source files (plain text)

- https://uifino.com/videos/motion-data-count-up/source/SPEC.md
- https://uifino.com/videos/motion-data-count-up/source/PROMPT.md
- https://uifino.com/videos/motion-data-count-up/source/NOTICE.md
- https://uifino.com/videos/motion-data-count-up/source/project/assets/fonts/OFL.txt
- https://uifino.com/videos/motion-data-count-up/source/project/claims.json
- https://uifino.com/videos/motion-data-count-up/source/project/compositions/count.html
- https://uifino.com/videos/motion-data-count-up/source/project/hyperframes.json
- https://uifino.com/videos/motion-data-count-up/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-data-count-up

## 照抄复刻
用 `/hyperframes` 做一个 1920×1080、30 fps、3.5 秒的数字计数动效。底色 `#0F1712`，主字 `#ECF2EE`，次要字 `#8FA096`，细线 `#3A4A40`，强调色 `#7FD99A`。字体用本地 `@font-face`：数字和西文 IBM Plex Sans，中文思源黑体，不要联网取字体。

做法：
1. 画面只有三样：一个 320px、字重 600 的大数字，数字下面一条 2px 细线，细线下面一行 120px、字重 500、行高 156px 的「次部署 · 本周」，三项间距 32px。数字（字距 -0.02em，行高 320px）、细线、单位行竖着叠成一组，组内间距 40px，整组水平垂直居中；数字框宽度 = （数字个数 × 0.6 + 逗号个数 × 0.3）× 字号（12,480 为 1056px），细线宽度等于这一组的宽度，单位行在组内居中。
2. 数字要定宽：每个字符放进固定宽度的格子（数字 0.6em，逗号 0.3em），同时设 `font-variant-numeric: tabular-nums`。数字变化时只换内容，位置完全不动。
3. 0.1 秒起，一个计数器从 0 到 12480，`expo.out`，1.4 秒，每帧取整、加千分位逗号再显示。第 0 帧显示「0」。同一段时间里，数字颜色从 `#8FA096` 变到 `#ECF2EE`。不要匀速，不要缩放脉冲。
4. 1.5 秒数字落定后：细线从左向右画出（`scaleX` 0 到 1，`expo.out`，时长等于单位升起时长 + 0.1 秒，默认 0.7 秒）；1.6 秒起「次部署」「·」「本周」各套一层 `overflow: hidden` 遮罩，依次从下沿升起（`yPercent` 115 到 0，`expo.out`，0.6 秒，间隔 0.08 秒）。「·」用强调色，「次部署」用主字色，「本周」用次要字色。
5. 约 2.4 秒到 3.5 秒完全静止，没有退场。

需要替换的地方（都是场景根上的变量，在挂载处用 `data-variable-values` 传）：
- `target`（目标数字，默认 12480）、`unit`（单位，默认「次部署」，英文 `deploys`）、`caption`（说明，默认「本周」，英文 `this week`）。
- 颜色：`accentColor`、`bg`、`ink`、`muted`、`rule`。字号：`numberSize`（默认 320）。
- 时间与缓动：`countStart` 0.1、`countDuration` 1.4、`countEase` expo.out、`unitDelay` 0.1、`riseDuration` 0.6、`riseEase` expo.out、`stagger` 0.08。
- 数字块宽度和居中由脚本按位数和字号算出，不用手改。目标数字取 100 到 999999，字号取 240 到 400。

## 只学手法
数字用 `expo.out` 在约 1.4 秒里从 0 数到目标值，前 0.5 秒就走完 90%，最后 10% 慢慢停住；每个字符占固定宽度（数字 0.6em）加 `tabular-nums`，计数时位置一动不动；数字停住之后，单位和说明才依次从遮罩下沿升起（`expo.out` 0.6 秒，间隔 0.08 秒）。
```

### SPEC.md

```md
# SPEC：motion-data-count-up

## LOOK
- 色值（中性色 4 个，强调色 1 个）：底 `#0F1712`；主字 `#ECF2EE`；次要字 `#8FA096`；细线 `#3A4A40`（BRIEF 给的 #1F2B24 压在底色上对比度只有约 1.2:1，肉眼看不到画线动作，所以提亮；这是有意的取舍）；强调色 `#7FD99A`（只染中间那个「·」，面积远小于 10%）。
- 字体：数字和西文 IBM Plex Sans（`assets/fonts/ibm-plex-sans.woff2`），中文 Noto Sans SC（`assets/fonts/noto-sans-sc.woff2`），都是门禁按用到的字生成的本地子集，OFL。
- 字号只有两档：数字 320px（字重 600，字距 -0.02em，行高 320px）；单位和说明 120px（字重 500，行高 156px），约为数字宽度的三分之二。
- 数字用 `font-variant-numeric: tabular-nums`，并且每个字符放进固定宽度的格子：数字格 0.6em（192px），逗号格 0.3em（96px），格内居中。数字块宽度由脚本按目标数字的字符数算出：宽度 = （数字个数 × 0.6 + 逗号个数 × 0.3）× numberSize，12,480 是 5 个数字加 1 个逗号，共 1056px。数字框用这个宽度固定，计数过程中左边缘不动，不会抖。
- 圆角：无。阴影：无。没有进度环、仪表盘或任何装饰。
- 位置：数字框、细线、单位行竖着叠成一组，组内间距 40px，整组在画布里水平和垂直居中（flex 居中，不写死坐标）。数字框高 320px、宽度如上；细线高 2px、宽度等于这一组的宽度（取数字框和单位行里较宽的那个，默认 1056px）；单位行在组内水平居中，三项之间间距 32px。默认值下数字块左边缘落在 x=432px，数字框 top 约 261px，细线 top 约 621px，单位行 top 约 663px。因为是脚本算宽度加居中，目标数字 100 到 999999、字号 240 到 400 的任何组合都不会超出画布（最宽 999,999 在 400px 下是 1560px）。

## MOTION
- 数字：第 0.1 秒起，用 `expo.out` 从 0 数到 12480，时长 1.4 秒，到 1.5 秒落定。第 0 帧画面上已经是「0」，不是空画面。最后 10% 的量（约 1248）在 0.46 秒之后的约 0.94 秒里才走完，是最慢的一段，最后一位数字在 1.34 秒前后停住。取整显示（`Math.round`）。
- 数字颜色：同一段 1.4 秒、同一条缓动，从次要字色 `#8FA096` 变到主字色 `#ECF2EE`，落定时刚好是主字色。这是数字自己的变化，不是额外动作。
- 数字落定后：1.5 秒起细线从左向右画出（`scaleX` 0 到 1，`expo.out`，时长 = `riseDuration` + 0.1 秒，默认 0.7 秒，不是独立变量）；1.6 秒起（落定 + `unitDelay` 0.1 秒）「次部署」「·」「本周」三项依次从各自遮罩下沿升起（`yPercent` 115 到 0，`expo.out`，每项 0.6 秒，间隔 0.08 秒）：次部署 1.60 秒、「·」1.68 秒、本周 1.76 秒起，约 2.4 秒全部落定。
- 静止：约 2.4 秒到 3.5 秒完全不动，不缩放、不漂移、不呼吸。没有退场，片子结束在最后一帧。
- 缓动只用 `expo.out` 一种。

## 逐拍节拍表
| 拍 | 起止秒 | 画面 | 镜头 | 转场 | 屏幕文案原文 |
| --- | --- | --- | --- | --- | --- |
| count | 0.0 - 1.5 | 数字从 0 数到 12,480，先快后慢，位置不动 | 固定 | 无 | 12,480 |
| unit | 1.5 - 2.4 | 细线画出，次部署、·、本周依次升起 | 固定 | 无 | 次部署 · 本周 |
| hold | 2.4 - 3.5 | 完全静止 | 固定 | 无 | 12,480 次部署 · 本周 |

英文版：「12,480 deploys this week」，单位变量填 `deploys`，说明变量填 `this week`，数字、节拍、参数都不变（已临时用英文和另一个数字 9731 渲染 2.8 秒一帧确认）。

## 参数接线
所有参数都是 `project/compositions/count.html` 根元素 `data-composition-variables` 里的变量，用户的 AI 在 `index.html` 的挂载处用 `data-variable-values` 覆盖。默认值与代码里的常量表 `D` 一致：
- 内容：`target` 12480、`unit` 次部署、`caption` 本周。
- 外观：`numberSize` 320、`accentColor` #7FD99A、`bg` #0F1712、`ink` #ECF2EE、`muted` #8FA096、`rule` #1F2B24。
- 时间与动作：`countStart` 0.1、`countDuration` 1.4、`countEase` expo.out、`unitDelay` 0.1、`riseDuration` 0.6、`riseEase` expo.out、`stagger` 0.08。
- 不是变量的版面常量（在 `count.html` 的样式里改）：组内间距 40px、单位行字号 120px、行高 156px、三项间距 32px、细线高 2px。位置不用手改，换 `numberSize` 或位数后自动居中；`index.html` 与场景的 `data-duration` 3.5 也不是变量。
- 范围：`target` 100 到 999999（3 到 6 位），`numberSize` 240 到 400，超出范围版面可能放不下。

## 禁用项
匀速计数、数字滚动时整体位移、进度环和仪表盘、同时计数的多个数字、数字落定后的缩放脉冲、淡入加上滑、弹跳、辉光、渐变、标签和注释、画面上的数字指标说明。

## 已知取舍
- 门禁警告 `line_unread`：最后一句「次部署」「本周」在画面上只有约 1.7–1.86 秒，低于结尾句 2 秒的下限。原因是 BRIEF 把总时长定死 3.5 秒，计数 1.4 秒又必须先走完，说明才能出现。放进整片时把静止段拉长即可，计数和升起参数不变。
- 画面文字「次部署 · 本周」按「字数 × 0.25 秒」需要 1.25 秒，实际约 1.7 秒以上，够读。
- 数字格宽用固定 0.6em 和 0.3em，是为了在字体没有等宽数字特性时也不抖；`tabular-nums` 同时保留，满足 BRIEF。
- 细线颜色默认提亮到 `#3A4A40`，仍然很淡，是有意的：它只是分隔，不抢数字。想更醒目就调 `rule` 变量。
- 遮罩上写了 `data-layout-allow-overflow`：升起的字本来就从遮罩下沿外面进来，门禁不用再提示它「超出容器」。
```
