deconstruct
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDeconstruct
Deconstruct
This skill takes an animation or interaction apart. It names every state and event, splits each transition into one track per property and puts both on a page the user can scrub.
该 skill 会拆解动画或交互。它为每个 state 和 event 命名,将每次 transition 按属性拆分为一条独立 track,并把 state machine 与各条 track 放在一个可供用户拖动浏览的页面上。
Every frame accounted for
每一帧都有据可查
Nothing is described by feel. Every state has a name, every transition has an event and every animated property has its from, to, delay, duration and easing. A value that could not be read is marked , never estimated.
Not verifiedReading computed values and the side-by-side proof belong to . Forcing component states open belongs to . Opening the result runs in . Whether the motion's values are right belongs to .
matchlabverifymotion不凭感觉描述任何内容。每个 state 都有名称,每次 transition 都有 event,每个动画属性都记录其 from、to、delay、duration 和 easing。无法读取的值标为 ,绝不估算。
Not verified读取 computed values 以及并排对照验证属于 。强制打开 component states 属于 。打开结果这一步在 中执行。motion 的数值是否正确属于 。
matchlabverifymotion1. Capture the real motion
1. 捕获真实 motion
Open the source: the code, the live page or a recording. Read keyframes, transitions and spring configs, or step through frames at reduced playback speed. A breakdown from one viewing is .
deconstruct-capture-the-source打开 source:可以是代码、实时页面或录制内容。读取 keyframes、transitions 和 spring 配置,或以降低的播放速度逐帧查看。仅观看一次就做出的拆解属于 。
deconstruct-capture-the-source2. Name the states and events
2. 命名 states 和 events
List the states the element can rest in and the events that move it between them, such as press, release, resolve and timeout. Write them as a table of state, entered on and left on. A sentence like "it shrinks, then spins" is .
deconstruct-name-the-states列出 element 可以停留的所有 state,以及在 state 之间触发切换的 event,例如 press、release、resolve 和 timeout。将它们写成一张包含 state、entered on 和 left on 的表格。像“它先缩小,然后旋转”这样的描述属于 。
deconstruct-name-the-states3. Split each transition into tracks
3. 将每次 transition 拆分为 tracks
Give every animated property its own track: scale, opacity, blur, width, colour, icon and label. Each track lists from, to, delay, duration and easing. "About 300ms" is .
deconstruct-every-propertyKeep the curve as written. A spring stays a spring with its stiffness, damping and mass, or its bounce and duration. A spring flattened into a guessed bezier is .
deconstruct-keep-the-curve为每个动画属性设置一条独立 track:scale、opacity、blur、width、colour、icon 和 label。每条 track 列出 from、to、delay、duration 和 easing。“About 300ms”这样的描述属于 。
deconstruct-every-property保持 curve 的原有写法。spring 仍然是 spring,并保留其 stiffness、damping 和 mass,或 bounce 和 duration。将 spring 压平成猜测的 bezier 属于 。
deconstruct-keep-the-curve4. Drive it from one clock
4. 使用同一个 clock 驱动
Render the element as a pure function of one time value. Scrubbing, pausing and looping then show the same frame for the same time. A viewer that replays CSS and cannot stop mid-transition is .
deconstruct-one-clock将 element 渲染为单个时间值的 pure function。进行 scrub、pause 和 loop 时,相同时间应显示相同 frame。只能重放 CSS、无法在 transition 中途停止的 viewer 属于 。
deconstruct-one-clock5. Build the viewer
5. 构建 viewer
Copy viewer.html beside the rebuild as a development-only page, write next to it in the shape its header comment shows and open it. It shows the element, the state machine and one lane per track with its live value.
timeline.jsThe viewer ships with the skill, so write data only. A page with its own markup or styles is . It highlights the active state, and clicking a state seeks to it. Its scrubber, play, pause and 0.25× stay in. A timeline with no scrubber is .
deconstruct-shipped-viewerdeconstruct-scrub-the-timeline将 viewer.html 复制到 rebuild 旁边,作为仅用于开发的页面;按照其 header comment 指定的结构,在旁边编写 ,然后打开。它会显示 element、state machine,以及每条 track 对应的一条 lane,并显示其实时值。
timeline.jsviewer 随 skill 一同提供,因此只需编写 data。自带 markup 或 styles 的页面属于 。它会高亮当前 state,点击某个 state 即可跳转到该状态。它的 scrubber、play、pause 和 0.25× 倍速功能都会保留。没有 scrubber 的 timeline 属于 。
deconstruct-shipped-viewerdeconstruct-scrub-the-timeline6. Compare at slow speed
6. 以慢速进行对比
Play the original and the rebuild side by side at 0.25×. Set to a capture of the original, and the viewer plays it beside the preview on the same clock. Name every frame that drifts. A breakdown checked only at full speed is .
recordingdeconstruct-compare-slowed以 0.25× 倍速并排播放 original 和 rebuild。将 设置为 original 的 capture,viewer 会在同一个 clock 下与 preview 一同播放。指出每一个出现 drift 的 frame。仅按 full speed 检查的拆解属于 。
recordingdeconstruct-compare-slowed7. Hand back the data
7. 交回数据
timeline.jsdeconstruct-timeline-as-datatimeline.jstimeline.jsdeconstruct-timeline-as-datatimeline.jsThe pair
成对呈现
Every check is a pair. The broken line sits beside the line that replaces it.
| Rule | Broken | Replacement |
|---|---|---|
| A breakdown from watching it once | The code read and frames stepped at 0.1× |
| "It shrinks, then spins" | Idle, Pressed, Copying and Copied with their events |
| "About 300ms" | Scale |
| A spring approximated as | |
| A CSS replay button | Every frame computed from one |
| A looping preview only | A scrubber, play, pause and 0.25× |
| A viewer page written from scratch | |
| Checked once at full speed | Original and rebuild side by side at 0.25× |
| A timeline described in the reply | |
每次检查都由两项组成:有问题的一行紧挨着其替代方案。
| 规则 | 有问题的方式 | 替代方案 |
|---|---|---|
| 仅观看一次便得出拆解 | 读取代码,并以 0.1× 倍速逐帧查看 |
| “它先缩小,然后旋转” | Idle、Pressed、Copying 和 Copied,以及各自的 events |
| “About 300ms” | Scale 从 |
| 将 spring 近似为 | 按原样保留 |
| 通过 CSS 重播的按钮 | 每一帧均由同一个 |
| 只有循环播放的 preview | 提供 scrubber、play、pause 和 0.25× 倍速 |
| 从零编写 viewer 页面 | 复制 |
| 仅按 full speed 检查一次 | 将 original 和 rebuild 以 0.25× 倍速并排对比 |
| 在回复中描述 timeline | 使用 |
Reporting
报告
Severity. is a breakdown made without opening the source, or a missing state. is an estimated timing, a flattened curve, a viewer that cannot scrub or a hand-written viewer. is drift found and named at slow speed.
HIGHMEDIUMLOWFormat. One finding per root cause:
file:line - [rule-id] what is wrongThen a summary. when any remains, otherwise. Mark every value you could not read from the source as .
Rule | Count | SeverityBlockHIGHApproveNot verified严重程度。 未打开 source 就完成拆解,或缺少 state,属于 。使用估算的 timing、将 curve 压平、viewer 无法 scrub,或手写 viewer,属于 。在慢速下发现并指出 drift,属于 。
HIGHMEDIUMLOW格式。 每个 root cause 输出一条 finding:
file:line - [rule-id] what is wrong随后提供 汇总。如果仍有任何 ,则判定为 ;否则判定为 。将所有无法从 source 读取的值标为 。
Rule | Count | SeverityHIGHBlockApproveNot verified