feat: reusable registry galleries and individual HTML examples [verified]

This commit is contained in:
jarvis-at-skic committed 2026-10-25 09:19:23 +00:00
1 parent 55e559dcd1
commit 3bb9555e6a
67 files changed
+1229 -77

No files matched your search

+7 -1
View File
@@ -9,10 +9,16 @@ Two bounded multi-part explanations. [Editable configurations](../assets/animejs
## 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.
Build through `terminal` with `python3 scripts/build-gallery.py`, then open `dist/animejs-gallery-0.5.0/index.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.
## Direct runnable pages
- [Registry gallery](../dist/animejs-gallery-0.5.0/compositions/index.html) · [Editable registry gallery](../assets/animejs/compositions/index.html)
- [Explain a dependency](../dist/animejs-gallery-0.5.0/examples/dependency-flow.html) · [Editable example](../assets/animejs/examples/dependency-flow.html)
- [Separate, inspect, reassemble](../dist/animejs-gallery-0.5.0/examples/assemble-explode.html) · [Editable example](../assets/animejs/examples/assemble-explode.html)
+9 -2
View File
@@ -21,9 +21,9 @@ python3 scripts/build-gallery.py
CHROMIUM_EXECUTABLE=/path/to/chrome node scripts/test-gallery.mjs
```
The dependency-free Python builder embeds the shared pinned Anime **4.5.0** UMD, CSS, configuration, runtime and Anime license into `dist/animejs-gallery-0.4.0.html`. It emits `dist/animejs-gallery-manifest.json` with artifact and input SHA-256 hashes. No CDN, external fonts, runtime fetches, bundler or Reveal dependency. Tests use the repository's existing Playwright dependency.
The dependency-free Python builder embeds the shared pinned Anime **4.5.0** UMD, CSS, configuration, runtime and Anime license into each `dist/animejs-gallery-0.5.0/examples/<id>.html` individual page. The overall and registry galleries reuse those exact pages via relative iframe sources and open-example links; galleries do not run their own animation renderer. It emits `dist/animejs-gallery-manifest.json` with artifact and input SHA-256 hashes. No CDN, external fonts, runtime fetches, bundler or Reveal dependency. Tests use the repository's existing Playwright dependency.
For reuse, load vendor → configurations → runtime with a `<main>` present, or extract `mount(host, config)` and the relevant recipe branch into your owner. The published `animeGallery.mount` returns `play()`, `replay()`, `seek(milliseconds)`, `settle()`, `state()`, `destroy()`. Keep recipe IDs unchanged when tuning configuration. `kind` is catalog metadata, not a renderer selector. Timing is in milliseconds; use positive finite durations, valid SVG paths inside the 400×220 viewBox, and short labels. This is an editable reference, not an untrusted-config validator.
For reuse, load vendor → configurations → runtime with a `<main>` present and `data-example="<registered-id>"` on the body (unknown IDs throw; query strings do not select examples), or extract `mount(host, config)` and the relevant recipe branch into your owner. The published `animeGallery.mount` returns `play()`, `replay()`, `seek(milliseconds)`, `settle()`, `state()`, `destroy()`. Keep recipe IDs unchanged when tuning configuration. `kind` is catalog metadata, not a renderer selector. Timing is in milliseconds; use positive finite durations, valid SVG paths inside the 400×220 viewBox, and short labels. This is an editable reference, not an untrusted-config validator.
## Lifecycle and accessibility contract
@@ -36,3 +36,10 @@ Reduced motion forces the readable final state for play, replay and seek. Native
All five recipes and gallery code are original examples written for this package, not copied from showcase or peer source. Anime.js itself remains the existing vendored dependency, with its license embedded by the builder; see [vendor license](../assets/vendor/anime-LICENSE.md). No third-party artwork or remote assets.
[Browser test](../scripts/test-gallery.mjs) exercises all five recipes in normal and reduced-motion offline Chromium contexts: positive finite durations; normal-motion deterministic backward/forward seeking and clamping; real Enter/Space play/replay, range-key seeking, pointer settle; actual intermediate playback; natural completion; final SVG node visibility/bounds; live reduced-motion and print settlement; destroy/remount; no network attempts or console/page errors. Reduced motion tests assert final-state seek suppression rather than animated intermediate frames. Outputs: `evidence/animejs-gallery-test-report.json` and full-page normal/reduced screenshots. The report binds results to the built HTML hash. This does not establish cross-browser, screen-reader, production-slide-navigation or PDF-export acceptance. Test changed configurations and inspect their intermediate frames before adopting them.
## Direct runnable pages
- [Registry gallery](../dist/animejs-gallery-0.5.0/elements/index.html) · [Editable registry gallery](../assets/animejs/elements/index.html)
- [Draw a connection](../dist/animejs-gallery-0.5.0/examples/svg-draw.html) · [Editable example](../assets/animejs/examples/svg-draw.html)
- [Follow a route](../dist/animejs-gallery-0.5.0/examples/motion-path.html) · [Editable example](../assets/animejs/examples/motion-path.html)
- [Propagate from the center](../dist/animejs-gallery-0.5.0/examples/spatial-stagger.html) · [Editable example](../assets/animejs/examples/spatial-stagger.html)