# Whip Pan (甩镜转场)

One camera sweeps a full frame across two views sitting edge to edge: accelerate, then decelerate with matched speed and continuous motion blur, no hard cut. For a clean move between two product views.

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

## Install

- ZIP: https://uifino.com/videos/motion-whip-pan/source.zip

One camera sweeps a full frame across two views sitting edge to edge: accelerate, then decelerate with matched speed and continuous motion blur, no hard cut. For a clean move between two product views.

Rendered video: https://uifino.com/videos/motion-whip-pan/preview.mp4

## Beats

- 0-0.8s Let the viewer read frame A: Kestrel home, full bleed, completely still Camera: static.
- 0.8-1.16s Camera accelerates along the strip, carrying A out: A and B sit edge to edge as one strip, moving left about 1126px with motion blur Camera: horizontal whip. Transition: power4.in, 0.36s, no hard cut.
- 1.16-1.6s Picks up at the same speed and decelerates so B settles: The strip travels another 794px; B slides in and stops, blur fading with speed Camera: horizontal whip. Transition: expo.out, 0.44s, continuous with the previous beat.
- 1.6-2.5s B rests sharp so it can be read: Kestrel three feature cards, completely still Camera: static.

## Parameters

- `moveStart` Whip start: default 0.8s, range 0.2 to 1.5s
- `moveDuration` Whip total duration: default 0.8s, range 0.6 to 0.9s
- `accelShare` Accelerating share of the move: default 0.45, range 0.3 to 0.6
- `aWidth` A image width in its pane: default 2560px
- `aLeft` A image left offset: default -320px
- `aTop` A image top offset: default -160px
- `bWidth` B image width in its pane: default 1920px
- `bLeft` B image left offset: default 0px
- `bTop` B image top offset: default -100px

## Good for

- Fast cut between two product views
- Jumping from one feature to the next in a launch film
- When you want energy without flashes or zoom-throughs

## Not for

- Slow, lyrical storytelling
- Using it at every seam of a film
- Before and after states of the same screen, where a focus pull fits better

## Source files (plain text)

- https://uifino.com/videos/motion-whip-pan/source/SPEC.md
- https://uifino.com/videos/motion-whip-pan/source/PROMPT.md
- https://uifino.com/videos/motion-whip-pan/source/NOTICE.md
- https://uifino.com/videos/motion-whip-pan/source/project/compositions/whip.html
- https://uifino.com/videos/motion-whip-pan/source/project/hyperframes.json
- https://uifino.com/videos/motion-whip-pan/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 | 1.8 KB |
| SPEC.md | doc | 3.5 KB |

### PROMPT.md

```md
# PROMPT：motion-whip-pan

## 照抄复刻
请用 `/hyperframes` 做一个 1920x1080、30fps、2.5 秒的甩镜转场。无文字、无边框、无圆角外壳，底色 #0a0a0a。

- 画面 A 和画面 B 各放进一个 1920x1080、overflow hidden 的窗格，B 紧挨在 A 右边，没有缝，同样的放大和裁切。图片应先裁成 16:9；需要在窗格里再裁就用 width / left / top 变量。
- 根上 `data-motion-blur="on"`，`data-motion-blur-shutter="240"`。
- 0–0.8 秒：A 完全静止。
- 0.8–1.6 秒：两个窗格用完全相同的补间一起向左平移整整 1920px（等于镜头在一条横带上扫过去）。前 45%（0.36 秒）用 `power4.in`，其余 0.44 秒用 `expo.out`。不要硬切，不要斜切，不要缩放。每一帧都必须被图片铺满。
- 两段的位移要让速度在中间接上：k1 = 4/t1，k2 = 10·ln2/(1-2^-10)/t2，前段位移 d1 = 1920·k2/(k1+k2)，后段位移 1920 - d1。默认约 1126 + 794，接缝速度约 12500 px/s。
- 不要把窗格合成一个 3840 宽的元素去 tween，那样运动模糊不会生效，要分别 tween 两个 1920 宽窗格。
- 1.6–2.5 秒：B 完全静止、清晰。
- 不要白闪、漏光、缩放穿透，不要加别的转场。

需要替换的地方：
- imageA、imageB：前后两张图。
- direction：left 或 right（right 时 B 在左、A 在右，向右走）。
- moveStart、moveDuration（0.6–0.9 秒）、accelShare（默认 0.45）。
- aWidth/aLeft/aTop、bWidth/bLeft/bTop：每张图在窗格里的放大和偏移。

## 只学手法
甩镜就是一个镜头在一条横带上平移一整个画面宽：前 45% 用 `power4.in` 加速，后 55% 用 `expo.out` 减速，两段位移按速度相等算出来，运动模糊跟着速度走，停稳后画面清晰。不要做成两张图分别滑过空底。
```

### SPEC.md

```md
# SPEC：motion-whip-pan

## LOOK
- 色值：只有一个中性底色 #0a0a0a（图片窗格的底，平时看不见）。其余全部来自产品截图本身。没有强调色。
- 字体、字号：无，画面上没有任何文字。
- 圆角：0。截图全出血，不加外框、不加圆角卡片。没有阴影。
- 画面 A：kestrel-home-dark-en.jpg，在 1920x1080 窗格里放大到 2560 宽，左移 320、上移 160，裁掉页面两侧蓝灰边。
- 画面 B：crop-kestrel-features-dark-en.jpg，窗格里 1920 宽，上移 100，三张功能卡完整入画。
- 放大和偏移都是变量（aWidth/aLeft/aTop、bWidth/bLeft/bTop）。换图时要么调这几个数，要么先把图裁成 16:9 再放入并把它们设成 1920 / 0 / 0。

## 世界与镜头
- 一个世界：A 和 B 左右紧挨成一条横带（B 就在 A 右边，没有缝，同尺寸），镜头在横带上平移整整一个画面宽 1920px。两个窗格用完全相同的补间一起走，等于一条刚性横带。每一帧画面里都是图片内容，没有空底，没有硬切，没有斜切。
- 不直接 tween 一个 3840 宽的整条带：实测超宽元素不会触发运动模糊，所以拆成两个 1920 宽窗格，补间一模一样。

## MOTION
- 总时长 0.8 秒，从 0.8 到 1.6 秒（moveStart、moveDuration）。
- 前段加速：占 45%（accelShare），即 0.36 秒，`power4.in`，位移 d1。
- 后段减速：其余 0.44 秒，`expo.out`，位移 d2 = 1920 - d1。
- 速度衔接：power4.in 末速 = 4·d1/t1；expo.out 初速 = 10·ln2/(1-2^-10)·d2/t2（要除归一化系数 1-2^-10）。令两者相等，解得 d1 = 1920·k2/(k1+k2)，k1 = 4/t1，k2 = 10·ln2/(1-2^-10)/t2。默认值下 d1 约 1126px，d2 约 794px，接缝速度约 12500 px/s。脚本里按变量自动算，不用手算。
- 运动模糊：index.html 根上 `data-motion-blur="on"`，`data-motion-blur-shutter="240"`。速度低时自然消失，停稳的画面清晰。快门要改，就改 index.html 根上这一个属性。
- direction：left 时横带向左走（A 左出、B 右入）；right 时 B 在左、A 在右，横带向右走。

## 逐拍节拍表
| 拍 | 起止秒 | 画面 | 镜头 | 转场 | 屏幕文案原文 |
| --- | --- | --- | --- | --- | --- |
| hold-a | 0 - 0.8 | A 静止 | 固定 | 无 | 无 |
| accelerate | 0.8 - 1.16 | 横带开始向左走，A 被带出 | 水平平移，`power4.in` | 无硬切，连续运动 | 无 |
| decelerate | 1.16 - 1.6 | B 被带入并落定 | 水平平移，`expo.out`，速度与前段末速相同 | 同上 | 无 |
| hold-b | 1.6 - 2.5 | B 完全静止 | 固定 | 无 | 无 |

## 禁用项
白闪、漏光、缩放穿透、斜切、硬切、假浏览器边框、圆角卡片外壳、任何文字、静止段的呼吸或漂浮。

## 参数在哪里改
都在 index.html 的 data-composition-variables：imageA、imageB、direction、moveStart、moveDuration、accelShare、aWidth/aLeft/aTop、bWidth/bLeft/bTop。快门在 index.html 根的 data-motion-blur-shutter。

## 已知取舍
- hf-check 的 first_frame_empty 警告：它把铺满画面的图片窗格当成「盖住别的内容的不透明元素」。这里窗格就是内容本身，没有别的片段被盖住，是误报。

## 代码说明（原写在注释里）
- direction 为 left 时 s = 1，横带向左走；right 时 s = -1。
- 两个窗格并排：先出现的在 0，后出现的紧贴在 1920 处，没有缝；两个窗格用同样的补间等于一条刚性横带，且每个窗格都不比画面宽，运动模糊才会生效。
- 速度衔接公式见上面 MOTION 一节。
```
