# Shrink to Corner Window (全屏画面缩成小窗让位)

A full-screen picture holds 1.2 s, shrinks into a bottom-right window, two lines slide in on the freed left side, then everything settles; for moving from showing the picture to explaining it.

- Ref: `video/motion-camera-shrink-to-window` (code video · motion · tutorial, feature, any · any · 5s at 30fps)
- Page: https://uifino.com/en/videos/motion-camera-shrink-to-window
- Markdown: https://uifino.com/md/videos/motion-camera-shrink-to-window.md
- Preview image: https://uifino.com/videos/motion-camera-shrink-to-window/poster.jpg

## Install

- ZIP: https://uifino.com/videos/motion-camera-shrink-to-window/source.zip

A full-screen picture holds 1.2 s, shrinks into a bottom-right window, two lines slide in on the freed left side, then everything settles; for moving from showing the picture to explaining it.

Rendered video: https://uifino.com/videos/motion-camera-shrink-to-window/preview.mp4

## Beats

- 0-1.2s Let the picture be seen: Picture full screen, image eases 1.00 to 1.02, no text Camera: slow push-in.
- 1.2-2s Make room for text: The whole picture shrinks to 640x360 in the bottom-right corner (64 px from the edges), radius 0 to 20 px, power3.inOut; two lines slide in from the left from 1.52 s, 0.15 s apart Camera: static. On-screen text: "Now let's take it apart / Script, shots, render, one step at a time".
- 2-2.5s Text lands: Window in place, both lines finish on expo.out by 2.47 s Camera: static.
- 2.5-5s Still end: Text left, window right, dead still Camera: static.

## Parameters

- `hold` Hold before shrinking: default 1.2s, range 0.6 to 2s
- `shrinkDuration` Shrink duration: default 0.8s, range 0.5 to 1.4s
- `shrinkEase` Shrink ease: default power3.inOut
- `pushTo` Push-in scale: default 1.02, range 1 to 1.06
- `windowWidth` Final window width: default 640px, range 480 to 800px
- `margin` Window edge distance: default 64px, range 32 to 96px
- `radius` Final window radius: default 20px, range 8 to 24px
- `textAt` Text start (share of the shrink): default 0.4, range 0.2 to 0.7
- `textGap` Delay between lines: default 0.15s, range 0.1 to 0.3s
- `textDuration` Text entrance duration: default 0.8s, range 0.5 to 1.2s
- `textEase` Text ease: default expo.out
- `textShift` Text slide distance: default 60px, range 24 to 120px

## Good for

- Moving from a demo picture into a text explanation
- Making room for text while keeping the picture on screen
- Works with two-line Chinese or English copy

## Not for

- Pieces where the picture must stay full screen
- Explanations with more than two lines or a list

## Source files (plain text)

- https://uifino.com/videos/motion-camera-shrink-to-window/source/SPEC.md
- https://uifino.com/videos/motion-camera-shrink-to-window/source/PROMPT.md
- https://uifino.com/videos/motion-camera-shrink-to-window/source/NOTICE.md
- https://uifino.com/videos/motion-camera-shrink-to-window/source/project/assets/fonts/OFL.txt
- https://uifino.com/videos/motion-camera-shrink-to-window/source/project/compositions/shrink.html
- https://uifino.com/videos/motion-camera-shrink-to-window/source/project/hyperframes.json
- https://uifino.com/videos/motion-camera-shrink-to-window/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 | 3.1 KB |
| SPEC.md | doc | 7.0 KB |

### PROMPT.md

```md
# PROMPT：motion-camera-shrink-to-window

## 照抄复刻
用 `/hyperframes` 做一个 1920×1080、30 fps、5 秒的「全屏画面缩成小窗让位」动效，底色 `#0F1712`，只有一张主画面和两行字，没有任何其他元素。

做法：
1. 主画面是一张 1920×1080 的图（本条用 `assets/images/chart-story.jpg`），放进一个 1920×1080 的容器 `#shrink-window`（`overflow: hidden`，`transform-origin: 0 0`），图在容器里铺满四边，没有阴影、描边、发光。容器层级高于文字块（`z-index` 2 对 1），这样文字进入时先被缩小中的窗口盖住，不会叠在图上。
2. 文字块：左边 120px、下边 64px、宽 1000px，左对齐。标题 120px / 字重 700 / 行高 136px / 字距 -0.02em，色 `#ECF2EE`，其中「拆开」染 `#7FD99A`；次要句 64px / 字重 500 / 行高 80px，色 `#8FA096`，和标题间距 24px。中文用 Noto Sans SC，西文用 Hanken Grotesk，本地 `@font-face` 指向 `assets/fonts/`。
3. 0.0–1.2 秒：容器全屏，圆角 0；容器里的图 `scale` 1.00 → 1.02，`power1.inOut`，1.2 秒。文字还不可见。
4. 1.2–2.0 秒：容器一个 tween 缩小：`scale` 1 → 1/3、`x` 0 → 1216、`y` 0 → 656、`borderRadius` 0 → 60px（缩小后看到 20px），`power3.inOut`，0.8 秒。最终小窗 640×360，距右边和下边各 64px。全程 16:9，不拉伸，不换画面，不加阴影。
5. 1.52 秒（缩小进行到 40%）：标题开始进入；1.67 秒次要句进入（间隔 0.15 秒）。每句 `x` -60 → 0、`opacity` 0 → 1，`expo.out`，0.8 秒，整句一起，不逐字。
6. 2.47–5.0 秒：小窗和文字完全静止，共 2.53 秒，不呼吸、不漂浮、不再缩放。

需要替换的地方：
- 文案 `title`、`subtitle`、标题里要染色的词 `accentWord`（必须出现在标题里）。英文：`Now let's take it apart` / `Script, shots, render, one step at a time`，强调词 `apart`；英文会在 1000px 宽里自动折行，文字块底边仍对齐小窗底边。
- 主画面 `picture`（1920×1080 图片路径）。它通过 `<img>` 上的 `data-var-src="picture"` 生效，只改 `src` 不行，要改变量。
- 颜色：`bg`、`ink`、`muted`、`accent`。
- 数字：`hold`（1.2）、`shrinkDuration`（0.8）、`shrinkEase`（power3.inOut）、`pushTo`（1.02）、`windowWidth`（640）、`margin`（64）、`radius`（20）、`textAt`（0.4）、`textGap`（0.15）、`textDuration`（0.8）、`textEase`（expo.out）、`textShift`（60）。小窗位置和缩放倍率由代码按这些数字重算；文字块的 `bottom: 64px` 写在样式里，改了 `margin` 要一起改。
- 字体用本地 `@font-face`，不要联网取字体。

## 只学手法
主画面先全屏停 1.2 秒（图缓推到 1.02），再用 0.8 秒（power3.inOut）整块缩成 640×360 的右下角小窗（距右下各 64px，全程 16:9，圆角 0 → 20px）；缩小进行到 40% 时，左侧两行字从左 60px 处依次进入（间隔 0.15 秒，expo.out，0.8 秒）；最后小窗和文字一起静止 2.5 秒。小窗不加阴影，缩小中不换画面。
```

### SPEC.md

```md
# SPEC：motion-camera-shrink-to-window

## LOOK
- 色值（中性色 4 个，强调色 1 个）：底 `#0F1712`，一级字 `#ECF2EE`，次要字 `#8FA096`，线 `#1F2B24`（变量里不留，本条画面不画线、不描边），强调色 `#7FD99A`（只染标题里的「拆开」两个字，面积远小于 1%）。主画面是已发布条目 motion-data-chart-story 的封面（浅灰底、深字、蓝柱），是真实素材，放在深绿底上形成明暗反差，不另做调色。
- 字体：标题和次要句的西文用 Hanken Grotesk（`assets/fonts/hanken-grotesk.woff2`），中文用 Noto Sans SC（`assets/fonts/noto-sans-sc.woff2`）。两个族，子集由门禁生成。
- 字号：两档。标题 120px（字重 700，字距 -0.02em，行高 136px，`text-wrap: balance`）；次要句 64px（字重 500，行高 80px，`text-wrap: balance`）。
- 圆角：只有小窗一处，最终 20px（BRIEF 指定，不在 0/8/16/24 一把尺里，见「已知取舍」）。全屏时是 0。
- 阴影、描边、玻璃、渐变、辉光：全部没有。
- 层叠：小窗 `z-index: 2`，文字块 `z-index: 1`（文字在窗下面，缩小时被窗盖住再露出）。
- 位置：
  - 文字块左边 120px，下边 64px（块底边落在 y = 1016），宽 1000px；左对齐。中文版标题单行 136px + 间距 24px + 次要句单行 80px = 240px，占 y 776–1016。英文版每句在 1000px 宽里折成两行，块向上长，最高到 y = 560，不会碰到小窗。
  - 小窗最终宽 640px、高 360px（16:9），距右边 64px、距下边 64px，占 x 1216–1856、y 656–1016。文字块右边（x = 1120）离小窗左边（x = 1216）96px。
- 主画面：1920×1080 的图 `assets/images/chart-story.jpg`，全屏时铺满四边。

## MOTION
- 0.0–1.2 秒：主画面全屏，里面的图 `scale` 1.00 → 1.02（`power1.inOut`，1.2 秒），缓推。以画面中心为原点，放大后仍铺满四边。其余全部静止，文字还没出现。
- 1.2–2.0 秒：小窗整体缩小，一个 tween：`scale` 1 → 1/3（640 / 1920）、`x` 0 → 1216、`y` 0 → 656、`borderRadius` 0 → 60px（窗口自身坐标，缩小后看到的是 20px），`power3.inOut`，0.8 秒。变换原点在左上角，全程 16:9 不拉伸，图不换。图内的推近停在 1.02，不回弹。
- 文字：缩小进行到 40% 时（1.2 + 0.8 × 0.4 = 1.52 秒）开始进入。标题 1.52 秒，次要句 1.67 秒（间隔 0.15 秒）。每句 `x` -60 → 0、`opacity` 0 → 1，`expo.out`，0.8 秒；整句一起出现，不逐字。标题 2.32 秒落定，次要句 2.47 秒落定。
- 2.47–5.0 秒：小窗和文字完全静止，共 2.53 秒，不呼吸、不漂浮、不再推近。
- 不加运动模糊：缩放 0.8 秒，速度不快，也没有高速横移。
- 不退场，最后一帧就是静止画面。

## 逐拍节拍表
| 拍 | 起止秒 | 画面 | 镜头 | 转场 | 屏幕文案原文 |
| --- | --- | --- | --- | --- | --- |
| hold | 0.0 - 1.2 | 主画面全屏，图 1.00 → 1.02 缓推 | 缓推 | 无 | 无（主画面不放字） |
| shrink | 1.2 - 2.0 | 主画面缩到右下角 640×360，圆角 0 → 20px；1.52 秒起文字从左进入 | 固定 | 无 | 接下来拆开讲 / 剧本、分镜、渲染，一步一步来 |
| settle | 2.0 - 2.5 | 小窗到位，两行文字 expo.out 收尾 | 固定 | 无 | 同上 |
| end | 2.5 - 5.0 | 左文右窗，完全静止 | 固定 | 无 | 同上 |

英文版（已临时切到英文跑过 `--at=3.5`）：标题「Now let's take it apart」，次要句「Script, shots, render, one step at a time」，`accentWord` 填 `apart`。英文在 1000px 宽里自动折行，文字块底边仍对齐小窗底边（y = 1016）。变量声明里的单引号要写成 `&#39;`，否则属性 JSON 会断。

## 参数接线
全部是 `project/compositions/shrink.html` 根元素上的 `data-composition-variables`；用户的 AI 在 `index.html` 的挂载处用 `data-variable-values` 覆盖。

| 变量 | 默认 | 范围 | 改了哪里变 |
| --- | --- | --- | --- |
| title | 接下来拆开讲 | 文本 | 标题文字 |
| subtitle | 剧本、分镜、渲染，一步一步来 | 文本 | 次要句文字 |
| accentWord | 拆开 | 必须是标题里出现的一段文字 | 标题里染强调色的词，找不到就不染 |
| picture | assets/images/chart-story.jpg | 1920×1080 图片路径 | 主画面 |
| bg / ink / muted / accent | #0F1712 / #ECF2EE / #8FA096 / #7FD99A | 颜色 | 底色、标题色、次要句色、强调词色 |
| hold | 1.2 | 0.6–2 秒 | 主画面先停多久（同时是推近用时），缩小和文字的起点跟着移 |
| shrinkDuration | 0.8 | 0.5–1.4 秒 | 缩小用时 |
| shrinkEase | power3.inOut | GSAP 缓动名 | 缩小的缓动 |
| pushTo | 1.02 | 1–1.06 | 停留阶段图的推近终点倍率 |
| windowWidth | 640 | px | 小窗最终宽度，高度按 16:9 自动算，缩放倍率 = 宽 / 1920 |
| margin | 64 | px | 小窗距右边和下边的距离 |
| radius | 20 | px | 小窗最终圆角（缩小后实际看到的值） |
| textAt | 0.4 | 0.2–0.7 | 文字在缩小进度的几分之几进入 |
| textGap | 0.15 | 0.1–0.3 秒 | 两行进入的间隔 |
| textDuration | 0.8 | 0.5–1.2 秒 | 每行进入用时 |
| textEase | expo.out | GSAP 缓动名 | 文字缓动 |
| textShift | 60 | px | 文字从左边多远处进入 |

文字块的位置（左 120px、下 64px、宽 1000px）写在 `shrink.html` 的样式里，不是变量；它的底边和小窗底边对齐，改了 `margin` 要同步改文字块的 `bottom`。总时长 5 秒由 `index.html` 和 `shrink.html` 的 `data-duration` 决定，不是变量。

## 禁用项
小窗加阴影、描边、发光或玻璃；缩小过程中换画面；小窗缩到正中或左侧；画面上写手法说明、编号、时间码；文字逐字出现；落定后任何缩放、漂移、呼吸；点击光圈；浏览器外壳。

## 已知取舍
- 小窗圆角 20px：BRIEF 明确要求，不在 0/8/16/24 里。全片只有这一个非圆形圆角，加上全屏时的 0，不超过 3 档。小窗上用 `data-lint-ignore` 标注。
- 全屏阶段 1.00 → 1.02 缓推：BRIEF 明确要求，手册说「慢推」有生成感，这里只有 1.2 秒、2%，缩小一开始就停，不属于落定后继续漂。
- 主画面里的图自带文字和蓝色柱子，这是已发布条目的真实封面，所在容器标了 `data-product-ui`；蓝色不属于本条的强调色，本条自己的强调色只有 `#7FD99A`。
- 入场动效第一帧文字为空会触发 `first_frame_empty`；`poster` 取 3.5 秒，此时画面完整。
- 1.52–2.0 秒文字和还没缩完的主画面在同一块区域：BRIEF 定死「缩小进行到 40% 时进入」。做法是文字块 `z-index: 1`、小窗 `z-index: 2`，文字先被窗盖住，窗往右下缩开后才露出来，不再有半透明字叠在图上的情况。1.7 秒起窗口左缘已过 x≈1020，次要句右端约 x=1016，两者不挤。
- 图放大到 1.02 倍会超出容器边缘（被 `overflow: hidden` 裁掉），图片元素上写了 `data-layout-allow-overflow`，否则 hf-check 报 container_overflow。
```
