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 and edit.
这个 skill 会将动画或交互拆解开来。它会为每个状态和事件命名,将每次转换拆分为每个属性各一条轨道,并将两者放在用户可拖动定位和编辑的页面上。
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所有内容都基于实际读取,而非凭感觉描述。每个状态都有名称,每次转换都有对应事件,每个动画属性都有 from、to、delay、duration 和 easing。无法读取的值会标记为 ,绝不进行估算。
Not verified读取计算值和并排对照验证属于 。强制打开组件状态属于 。打开结果时会在 中运行。动效数值是否正确属于 。
matchlabverifymotion1. Capture the real motion
1. 捕获真实动效
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打开源:代码、实时页面或录屏。读取 keyframes、transitions 和 spring 配置,或以降低的播放速度逐帧查看。仅观看一次得出的拆解属于 。
deconstruct-capture-the-source2. Name the states and events
2. 命名状态和事件
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列出元素可以停留的状态,以及使元素在状态之间切换的事件,例如 press、release、resolve 和 timeout。将它们写成包含 state、entered on 和 left on 的表格。"它先缩小,然后旋转"这样的句子属于 。
deconstruct-name-the-states3. Split each transition into tracks
3. 将每次转换拆分为轨道
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为每个动画属性设置独立轨道:scale、opacity、blur、width、colour、icon 和 label。每条轨道都会列出 from、to、delay、duration 和 easing。"大约 300ms"属于 。
deconstruct-every-property保持曲线原样。spring 必须保持为 spring,并记录其 stiffness、damping 和 mass,或 bounce 和 duration。将 spring 压平成猜测的 bezier 属于 。
deconstruct-keep-the-curve4. Drive it from one clock
4. 使用同一个时钟驱动
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将元素渲染为单个时间值的纯函数。这样,拖动定位、暂停和循环播放时,相同时间点都会显示相同帧。只能重放 CSS 且无法在转换中途停止的 viewer 属于 。
deconstruct-one-clock5. Build the viewer
5. 构建查看器
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-timelineThe inspector writes from, to, delay, duration and easing, and the preview follows. Drag a segment to change its delay. Drag its right edge to change its duration. Drag an event mark to move that event on every track. A timing changed in the reply instead of on the segment is .
deconstruct-edit-the-segmentPinch or hold Cmd and scroll to zoom the timeline. Scroll sideways to pan, and Fit returns to the full duration. Drag a slider and the preview follows. Drag the bezier handles or pick a keyword from the easing menu.
Segments, layers and events snap to each other and to the playhead. Hold Alt to drag without snapping. Shift-click segments to move them together.
A spring's length follows from its curve. Change stiffness, damping and mass to change it, or drag the edge of a bounce and duration spring.
Opening a track draws its value over time under the lane, so an overshoot shows. Tracks on one element group under its selector, and dragging the group moves them all.
Cmd+Z undoes any edit. An edited field shows a dot and Revert. Original plays the timeline as it was loaded, so the edit is judged against the source.
将 viewer.html 复制到重建项目旁边,作为仅用于开发的页面;按照 timeline.js 头部注释所示的结构在旁边编写该文件,然后打开。它会显示元素、状态机,以及每条轨道各自的泳道和实时值。
viewer 随 skill 一同提供,因此只需编写数据。自行包含 markup 或 styles 的页面属于 。它会高亮当前状态,点击某个状态即可定位到该状态。必须保留 scrubber、play、pause 和 0.25×。没有 scrubber 的 timeline 属于 。
deconstruct-shipped-viewerdeconstruct-scrub-the-timelineinspector 会写入 from、to、delay、duration 和 easing,预览随之更新。拖动 segment 可更改其 delay,拖动其右边缘可更改 duration,拖动 event 标记可在每条轨道上移动该 event。只在回复中修改 timing 而未在 segment 上修改,属于 。
deconstruct-edit-the-segment双指捏合,或按住 Cmd 并滚动,即可缩放 timeline。横向滚动可平移视图,Fit 会回到完整时长。拖动 slider 时预览会同步变化。拖动 bezier handles,或从 easing 菜单中选择 keyword。
片段、图层和事件会相互吸附,并与播放头对齐。按住 Alt 拖动可取消吸附。Shift-click 片段可将其一起移动。
spring 的长度由其曲线决定。更改 stiffness、damping 和 mass 即可改变长度,也可以拖动 bounce-and-duration spring 的边缘。
展开一条轨道后,会在泳道下方绘制其随时间变化的数值,从而显示 overshoot。同一元素上的轨道会按 selector 分组,拖动该组会移动其中所有轨道。
Cmd+Z 可撤销任何编辑。编辑过的字段会显示圆点和 Revert。Original 会按加载时的样子播放 timeline,以便对照源文件评估这次编辑。
6. 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-slowedPress I and O to loop one range, such as press to release. Onion Skin ghosts the last frames over the preview. Wipe lays the recording over the preview with a divider. Crop the recording to the preview frame so the two line up.
以 0.25× 倍速并排播放 original 和 rebuild。将 设置为 original 的捕获画面,viewer 会在同一时间轴上将其与 preview 并排播放。指出每一帧存在偏差的地方。仅按全速检查的拆解属于 。
recordingdeconstruct-compare-slowed按 I 和 O 可循环播放某个区间,例如从 press 到 release。Onion Skin 会将最后几帧以残影形式叠加到 preview 上。Wipe 会用分隔线将 recording 覆盖到 preview 上。裁剪 recording,使其与 preview frame 对齐。
7. Hand back the data
7. 交付数据
timeline.jsdeconstruct-timeline-as-datatimeline.jsdeconstruct-copy-the-timelinetimeline.js交付物是 :将状态表和轨道放在同一个对象中。rebuild 应导入该文件,而不是复制一份,这样 viewer 和最终发布的 motion 会读取相同数值。只存在于回复中的 timeline 属于 。Copy Timeline 会将当前打开页面中的内容写回该对象。将它粘贴并覆盖 timeline.js。如果剪贴板被阻止,toast 会显示 Copy Failed。只在打开的页面中保留而未写回文件的编辑属于 。发布前,应将 viewer 限制为仅在开发环境中使用,或直接将其删除,并保留 timeline.js。
timeline.jsdeconstruct-timeline-as-datadeconstruct-copy-the-timelineThe 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 | |
| "Make the press 80ms" | Duration edited on the segment |
| The edit left in the open page | Pasted back over |
每个检查项都由问题方案与替代方案成对呈现。问题方案与替代方案并排显示。
| 规则 | 问题方案 | 替代方案 |
|---|---|---|
| 仅观看一次得出的拆解 | 读取代码,并以 0.1× 逐帧查看 |
| "它先缩小,然后旋转" | Idle、Pressed、Copying 和 Copied,并附上对应事件 |
| "大约 300ms" | Scale 从 |
| 将 spring 近似为 | 按原样写入 |
| CSS 重播按钮 | 根据单个 |
| 仅提供循环预览 | scrubber、play、pause 和 0.25× |
| 从头编写 viewer 页面 | 复制 |
| 仅按全速检查一次 | 以 0.25× 并排播放 original 和 rebuild |
| 仅在回复中描述 timeline | 由 rebuild 导入 |
| "将 press 设为 80ms" | 直接在 segment 上编辑 duration |
| 编辑仅留在打开的页面中 | 粘贴回并覆盖 |
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, a hand-written viewer or an edit left only in the page. 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严重程度。 未打开源文件就完成拆解,或缺少状态,属于 。估算的时序、被压平的曲线、无法拖动定位的 viewer、手写的 viewer,或仅留在页面中的编辑,属于 。在慢速播放中发现并指出的偏差,属于 。
HIGHMEDIUMLOW格式。 每个根本原因对应一项发现:
file:line - [rule-id] what is wrong然后提供 汇总。只要仍有任何 ,就标记为 ;否则标记为 。将所有无法从源文件读取的值标记为 。
Rule | Count | SeverityHIGHBlockApproveNot verified