19 lines
2.9 KiB
Markdown
19 lines
2.9 KiB
Markdown
# Anime.js composition registry
|
|
|
|
Two bounded multi-part explanations. [Editable configurations](../assets/animejs/examples.js) feed the [shared renderer](../assets/animejs/gallery.js). Existing `assets/mechanism.html` remains independent and unchanged.
|
|
|
|
| Recipe ID | Use / avoid | Configurable fields and sequence |
|
|
| --- | --- | --- |
|
|
| `dependency-flow` | Explain an input → check → output dependency. Avoid implying verified processing, timing or success from an illustrative sequence. | `duration` per edge, exactly three `labels`, `title`, `description`. Timeline labels `input` and `output` sequence two drawable connections; nodes and labels stay readable. Change renderer geometry for a different topology; adding labels alone does not add nodes. Final state shows both connections. |
|
|
| `assemble-explode` | Preserve part identity while separating and rejoining a conceptual assembly. Avoid decorative exploding dashboards or presenting this as physically accurate CAD. | `duration` per outward/return move, `distance`, exactly three `labels`, `title`, `description`. Three SVG wrappers separate horizontally, hold for 400 ms, then reassemble. Shipped distance is 105; larger values may clip. Seek into the hold to inspect separation. Edit renderer for hold/geometry changes. Final state is assembled. No part-selection controls; use the separate mechanism demo for selection. |
|
|
|
|
## Run, reuse and verify
|
|
|
|
Build through `terminal` with `python3 scripts/build-gallery.py`, then open `dist/animejs-gallery-0.4.0.html`. Each card provides Play, Replay, Settle and keyboard-operable seeking. The [source entry](../assets/animejs/index.html) also runs with its sibling files and shared vendor intact.
|
|
|
|
The [element registry](registry-animejs-elements.md#lifecycle-and-accessibility-contract) owns the shared lifecycle/accessibility contract and [source, provenance and test coverage](registry-animejs-elements.md#provenance-and-verified-coverage). Do not duplicate or weaken that contract for compositions: finite paused ownership, deterministic seeking, readable reduced-motion state, cleanup and offline operation all apply.
|
|
|
|
Each composition owns one timeline. The assembly's hold is an explicit constant-value tween, not an empty timeline gap: direct backward seeking from the final frame into that hold must reproduce the same separated positions as forward seeking. Keep this regression test when changing timing. Do not layer a second animation owner onto the same property. When embedding in a deck, wire its controller's `settle()` to slide departure and `destroy()` to teardown; gallery lifecycle does not automatically bind to Reveal.
|
|
|
|
The [browser test](../scripts/test-gallery.mjs) exercises both compositions alongside the three elements in normal and reduced motion, with artifact-hash-bound evidence. Retest changed geometry and labels, including intermediate frames. Cross-browser, screen-reader and exported-PDF acceptance are not established by these Chromium tests.
|