# Spec Caption on a Sample (样片角落的制作说明)

A sample drifts in slowly while a thin rule grows in the lower left and two spec lines mask-reveal beside it, hold, then retract; for noting the tool and specs on a sample clip.

- Ref: `video/motion-caption-spec-overlay` (code video · motion · feature, brand, any · website, youtube, bilibili, any · 5s at 30fps)
- Page: https://uifino.com/en/videos/motion-caption-spec-overlay
- Markdown: https://uifino.com/md/videos/motion-caption-spec-overlay.md
- Preview image: https://uifino.com/videos/motion-caption-spec-overlay/poster.jpg

## Install

- ZIP: https://uifino.com/videos/motion-caption-spec-overlay/source.zip

A sample drifts in slowly while a thin rule grows in the lower left and two spec lines mask-reveal beside it, hold, then retract; for noting the tool and specs on a sample clip.

Rendered video: https://uifino.com/videos/motion-caption-spec-overlay/preview.mp4

## Beats

- 0.6-0.9s A rule marks the spot: Thin rule in the lower left grows to 96px in the accent color, expo.out, 0.3 s Camera: push-in.
- 0.9-1.62s The lines reveal in turn: Two lines mask-reveal from the left, 0.12 s apart, 0.6 s each, expo.out Camera: push-in. On-screen text: "Rendered with the UIFino library / 1920×1080 · 30 fps".
- 1.62-4.02s Let the viewer read: Caption stays still; only the sample keeps drifting Camera: push-in. On-screen text: "Rendered with the UIFino library / 1920×1080 · 30 fps".
- 4.02-4.42s Retract the same way: Second line, first line, rule retract in turn, power3.in, 0.28 s each, starts 0.06 s apart Camera: push-in. On-screen text: "Rendered with the UIFino library / 1920×1080 · 30 fps".
- 4.42-5s Sample only: Only the sample remains, finishing its push to 1.03 Camera: push-in.

## Parameters

- `startAt` Rule start: default 0.6s, range 0 to 1.5s
- `ruleDuration` Rule grow duration: default 0.3s, range 0.2 to 0.6s
- `ruleLength` Rule length: default 96px, range 48 to 160px
- `revealDuration` Reveal duration per line: default 0.6s, range 0.4 to 0.9s
- `textStagger` Gap between line reveals: default 0.12s, range 0.08 to 0.25s
- `holdDuration` Hold duration: default 2.4s, range 1.5 to 3s
- `retractDuration` Retract duration: default 0.4s, range 0.3 to 0.6s
- `retractStagger` Gap between retract starts: default 0.06s, range 0.04 to 0.12s
- `zoomEnd` Sample scale at the end: default 1.03, range 1 to 1.08
- `marginLeft` Distance from left: default 96px, range 64 to 160px
- `marginBottom` Distance from bottom: default 88px, range 64 to 160px
- `accentColor` Rule color: default #F2B544
- `ink` Line 1 color: default #F4F4F2
- `muted` Line 2 color: default #8A8A8E
- `line1` Line 1: default 用 UIFino 参考库渲染
- `line2` Line 2: default 1920×1080 · 30 fps

## Good for

- A credit or spec note in the corner of a sample or showreel
- Two lines only: what it was made with and its specs
- Works in Chinese and English; the whole line is revealed, not split by character

## Not for

- Long text explanations
- A headline that must be the focus
- Captions over bright or busy footage, where contrast falls short

## Source files (plain text)

- https://uifino.com/videos/motion-caption-spec-overlay/source/SPEC.md
- https://uifino.com/videos/motion-caption-spec-overlay/source/PROMPT.md
- https://uifino.com/videos/motion-caption-spec-overlay/source/NOTICE.md
- https://uifino.com/videos/motion-caption-spec-overlay/source/project/assets/fonts/OFL-jetbrains-mono.txt
- https://uifino.com/videos/motion-caption-spec-overlay/source/project/assets/fonts/OFL.txt
- https://uifino.com/videos/motion-caption-spec-overlay/source/project/compositions/caption.html
- https://uifino.com/videos/motion-caption-spec-overlay/source/project/hyperframes.json
- https://uifino.com/videos/motion-caption-spec-overlay/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.2 KB |
| SPEC.md | doc | 6.7 KB |

### PROMPT.md

```md
# PROMPT：motion-caption-spec-overlay

## 照抄复刻
用 `/hyperframes` 复刻一段 5 秒、1920×1080、30 fps 的「样片角落说明」：一张样片铺满画布，缓慢推近，左下角先长出一根细线，再用遮罩依次显出两行说明，停留后原路收回。样片全程不动手脚，只做缓推。

数字照抄：
- 样片：全出血，`scale` 从 1 到 1.03，整段 5 秒，`power2.inOut`，中心缩放。
- 说明块：左边距 96px，底边距 88px，竖排：细线、间距 24px、第一行、间距 8px、第二行，左对齐。无底框、无标签、无毛玻璃，文字下面不加压暗。
- 细线：2px 高，强调色 `#F2B544`，0.60 秒起从左端 `scaleX` 0 到 1，宽度 0 到 96px，0.3 秒，`expo.out`。
- 第一行：28px，字重 500，`#F4F4F2`；0.90 秒起，`clip-path: inset(0 100% 0 0)` 到 `inset(0 0% 0 0)`，同时从左偏 20px 滑到位，0.6 秒，`expo.out`。整行显出，不逐字。
- 第二行：22px，字重 400，等宽字体（JetBrains Mono），`#8A8A8E`；动作和第一行一样，晚 0.12 秒（1.02 秒起）。
- 停留：1.62 到 4.02 秒共 2.4 秒，说明不动。
- 收回：顺序相反，`clip-path` 从右向左收，同时滑回左偏 20px，`power3.in`，每项 0.28 秒：第二行 4.02 秒起、第一行 4.08 秒起、细线 4.14 秒起（`scaleX` 1 到 0），4.42 秒收完，整段 0.4 秒。
- 字体：第一行 IBM Plex Sans 加 Noto Sans SC，第二行 JetBrains Mono，都是本地 `@font-face`，不联网取字体。底色 `#0E0E10`，说明字压在样片的暗色区域上，对比度不低于 4.5:1。

需要替换的地方：
- 第一行文字、第二行文字（英文例：Rendered with the UIFino library / 1920×1080 · 30 fps）。
- 样片图（1920×1080，选构图完整、左下角留空的一帧）。
- 强调色（细线）、两行字色。
- 左边距、下边距、细线长度。
- 停留时长、收回时长、样片最终缩放倍数。

## 只学手法
角标说明要轻：左下角细线 0.3 秒从 0 长到 96px，两行字从左遮罩显出、间隔 0.12 秒；停留 2.4 秒，再用 0.4 秒顺序相反地收回；样片全程 1.00 到 1.03 缓推，让静帧像在动。
```

### SPEC.md

```md
# SPEC：motion-caption-spec-overlay

## LOOK
- 色值：中性色 3 个，强调色 1 个。底 `#0E0E10`（只在样片没加载时露出，平时被样片盖住）；说明第一行 `#F4F4F2`；说明第二行 `#8A8A8E`；细线用强调色 `#F2B544`（面积 96×2px，远小于 10%）。BRIEF 里的线色 `#26262A` 压在样片的深绿底上看不见，所以细线改用强调色，这是有意的取舍。
- 样片：`project/assets/media/sample.jpg`，1920×1080，取自本库已发布条目 `motion-data-count-up` 的 `public/videos/motion-data-count-up/preview.mp4` 第 3.2 秒（数字「12,480」和「次部署 · 本周」都完整、没被裁断，左下角是空的）。铺满整个画布（`object-fit: cover`，0,0 起，1920×1080），四边都到头。
- 字体：第一行 IBM Plex Sans（西文）加 Noto Sans SC（中文），文件 `assets/fonts/ibm-plex-sans.woff2`、`assets/fonts/noto-sans-sc.woff2`，由门禁按用到的字生成子集；第二行用等宽字体 JetBrains Mono 400（OFL-1.1，取自 hyperframes 的 code-editorial 预设，未做子集），文件 `assets/fonts/JetBrainsMono-400.woff2`，许可文本 `assets/fonts/OFL-jetbrains-mono.txt`。全部本地 `@font-face`，两个正文字体族加一个等宽字体，符合手册规则 6。
- 字号两档：第一行 28px（字重 500，行高 40px，颜色 `#F4F4F2`）；第二行 22px（JetBrains Mono，字重 400，行高 32px，颜色 `#8A8A8E`，不加字距）。
- 对比度：说明字压在样片的深绿底（约 `#101A14`）上，第一行约 17:1，第二行约 5:1，都不低于 4.5:1。所以文字下面不加任何压暗层，也就没有色带风险。
- 圆角：无。阴影：无。没有底框、标签、毛玻璃。
- 位置：说明块左边距画布左边 96px，块底边距画布下边 88px，竖着排：细线（高 2px，下面空 24px）、第一行、空 8px、第二行，左对齐。

## MOTION
- 样片缓推：整段 5 秒，`scale` 从 1 到 1.03，`power2.inOut`，缩放中心在画面正中。静帧靠它显得在动。
- 细线：0.60 秒起，`scaleX` 从 0 长到 1，对应宽度从 0 到 96px，起点在左端，`expo.out`，0.3 秒，到 0.90 秒长完。
- 两行字：用 `clip-path` 从左向右遮罩显出（`inset(0 100% 0 0)` 到 `inset(0 0% 0 0)`），同时从左偏 20px 滑到位，`expo.out`，每行 0.6 秒。第一行 0.90 秒起，第二行晚 0.12 秒，1.02 秒起，1.62 秒全部落定。文字整行一起被遮罩带出，不逐字。
- 停留：1.62 到 4.02 秒共 2.4 秒，说明块完全不动（只有样片在缓推）。
- 收回：顺序相反，`clip-path` 从右向左收（反向），同时滑回左偏 20px，`power3.in`，每项 0.28 秒，三项起点相隔 0.06 秒：第二行 4.02 秒起、第一行 4.08 秒起、细线 4.14 秒起（`scaleX` 1 到 0）。到 4.42 秒收完，整个收回用时 0.4 秒。
- 4.42 到 5.0 秒只剩样片继续缓推。
- 缓动只用三种：`expo.out`（到达）、`power3.in`（退场）、`power2.inOut`（样片缓推）。

## 逐拍节拍表
| 拍 | 起止秒 | 画面 | 镜头 | 转场 | 屏幕文案原文 |
| --- | --- | --- | --- | --- | --- |
| rule | 0.60 - 0.90 | 左下角一根细线从左长到 96px | 样片缓推 | 无 | 无 |
| lines | 0.90 - 1.62 | 两行说明依次从左遮罩显出，间隔 0.12 秒 | 样片缓推 | 无 | 用 UIFino 参考库渲染 / 1920×1080 · 30 fps |
| hold | 1.62 - 4.02 | 说明完全不动 | 样片缓推 | 无 | 同上 |
| retract | 4.02 - 4.42 | 第二行、第一行、细线依次收回 | 样片缓推 | 无 | 同上 |
| tail | 4.42 - 5.00 | 只剩样片 | 样片缓推到 1.03 | 无 | 无 |

英文版：「Rendered with the UIFino library / 1920×1080 · 30 fps」，改变量 `line1`、`line2` 即可。文字是整行遮罩，不按字拆，所以中英文计时完全一样。英文第一行在 28px 下约 420px 宽，放得下。

## 参数接线
全部参数都是 `project/compositions/caption.html` 根元素 `data-composition-variables` 里的变量，默认值与脚本里常量表 `D` 一致；用户的 AI 在 `index.html` 挂载处用 `data-variable-values` 覆盖。
- 内容：`line1`「用 UIFino 参考库渲染」、`line2`「1920×1080 · 30 fps」、`sample`（样片路径，1920×1080 图片，默认 `assets/media/sample.jpg`）。
- 外观：`accentColor` #F2B544（细线）、`ink` #F4F4F2、`muted` #8A8A8E、`marginLeft` 96、`marginBottom` 88、`ruleLength` 96。
- 时间与动作：`startAt` 0.6、`ruleDuration` 0.3、`revealDuration` 0.6、`textStagger` 0.12、`holdDuration` 2.4、`retractDuration` 0.4、`retractStagger` 0.06、`zoomEnd` 1.03。每项收回的时长不是变量，等于 `retractDuration − 2 × retractStagger`（默认 0.28 秒）。
- 不是变量的常量（在 `caption.html` 里改）：左滑 20px（脚本里的 `slideX`）、缓动名称、字号 28 和 22、行高 40 和 32、细线高 2px、细线与文字间距 24px、两行间距 8px、样片缓推总时长 5 秒。
- 范围：默认值下 `startAt + ruleDuration + textStagger + revealDuration + holdDuration + retractDuration` 必须不超过 5 秒，改大停留或起点时要同步想想会不会超出片长；各变量取值范围见 entry.json。

## 禁用项
实色底框、圆角标签、毛玻璃、文字逐字打出、取景框、REC 红点这类假录像界面、说明文字下面的压暗渐变、细线之外的装饰、点击光圈、弹跳、呼吸或漂浮循环、说明块淡入加上滑。

## 已知取舍
- 门禁规则 F7（字号底线 28px）：第二行按 BRIEF 定死 22px，已在元素上写 `data-lint-ignore="F7:..."`；HyperFrames 的 `text_below_floor` 警告同源，保留不修。主说明在第一行 28px，第二行是规格附注。
- 第二行等宽字体 JetBrains Mono 不在门禁的精选字体里，所以文件是从 hyperframes 预设里直接拷来的完整拉丁字形（约 21 KB），不走门禁的子集生成；文件名用大小写混合，门禁不会把它当成精选字体去查。西文和 × · 符号都在这个字体里，中文不会出现在第二行。
- BRIEF 线色 `#26262A` 在样片上不可见，改用强调色 `#F2B544`（见 LOOK）。
- 样片最大放大到 1.03 倍，源图正好是 1920×1080，推近后会比原图多放大 3%，缓推中肉眼看不出发虚；要更锐就换更大的样片图。
- 样片本身含「12,480」数字，是被引用条目里的画面内容，不是本条的屏幕文案。画面中央的大字比左下角的说明抢眼，这是样片的内容决定的：库里已发布的动效成片都是居中大字，没有一帧是留白的。本条只示范说明块的做法，换成自己的样片图时这个问题不存在。
- 入场第一帧只有样片，说明块是空的（`first_frame_empty` 类提示不用修）；`poster` 取 3.0 秒，说明块完整的一帧。
```
