@algorisys/tinyfly 0.87.0 → 0.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +6 -4
  2. package/lib/addons/adapters.js +370 -310
  3. package/lib/addons/characters.js +1878 -1449
  4. package/lib/addons/load-scene-CQvcFWGJ.js +331 -0
  5. package/lib/addons/scene-3d.js +299 -215
  6. package/lib/browser/tinyfly-scene-3d.iife.js +2 -2
  7. package/lib/browser/tinyfly.iife.js +4 -4
  8. package/lib/browser/tinyfly.js +4395 -3858
  9. package/lib/browser/tinyfly.umd.js +4 -4
  10. package/lib/engine/tinyfly-engine.js +155 -106
  11. package/lib/engine/tinyfly-engine.umd.cjs +2 -2
  12. package/lib/headless/headless.js +8 -4
  13. package/lib/types/adapters/canvas/index.d.ts +1 -0
  14. package/lib/types/adapters/canvas/trail.d.ts +57 -0
  15. package/lib/types/browser/index.d.ts +2 -0
  16. package/lib/types/characters/acting/act-tracks.d.ts +28 -0
  17. package/lib/types/characters/acting/acting.d.ts +187 -0
  18. package/lib/types/characters/acting/effects.d.ts +65 -0
  19. package/lib/types/characters/acting/gags.d.ts +54 -0
  20. package/lib/types/characters/acting/index.d.ts +10 -0
  21. package/lib/types/characters/acting/rigs.d.ts +9 -0
  22. package/lib/types/characters/character.d.ts +7 -0
  23. package/lib/types/characters/index.d.ts +1 -0
  24. package/lib/types/characters/stick-figure.d.ts +7 -0
  25. package/lib/types/engine/core/clock.d.ts +7 -0
  26. package/lib/types/engine/path/index.d.ts +2 -0
  27. package/lib/types/engine/path/trail.d.ts +79 -0
  28. package/lib/types/headless/video-scene.d.ts +9 -0
  29. package/lib/types/scene-3d/resolve-scene.d.ts +6 -0
  30. package/lib/types/scene-3d/scene-3d-adapter.d.ts +9 -1
  31. package/lib/types/scene-3d/scene-types.d.ts +40 -1
  32. package/lib/types/scene-3d/strokes.d.ts +30 -0
  33. package/package.json +1 -1
  34. package/lib/addons/load-scene-vp14_Jj-.js +0 -324
package/README.md CHANGED
@@ -61,6 +61,7 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
61
61
  - **The drawing hand** - `drawnPathTarget()` draws a sketched stroke on from a `draw` track while a cartoon hand holds the pencil at its end in a writing grip; the same hand can hold the eraser. `handAt()` gives one hand for a whole scene: it follows each stroke, lifts and glides to the next, and enters and leaves the page
62
62
  - **Erasing** - An eraser rubs out part of a target (`erasable()`, animated by an `erase` track) or of anything drawn in code (`withErased()`); clip-based, so it works in the browser and headless alike
63
63
  - **Cartoon hands** - A hand rig in 3D, drawn flat: thumb and fingers posed by numbers (`index.curl`, `thumb.across`, `spread`, `turn`), ready-made shapes (fist, point, thumbs-up, peace, OK, pinch, wave, pencil grip…), left and right, four or five fingers, in every look; the animator's hand and (opt-in) character gloves are built on it. See [docs/cartoon-hands.md](docs/cartoon-hands.md)
64
+ - **Cartoon acting** - `actTracks()` turns the same key poses into acted motion: wind-ups, overshoot that settles or wobbles, joints that overlap (hips lead, wrists drag), eyes that dart ahead and blink on head turns, moving holds and jump squash, in `full`, `snappy` or `limited` styles. Gags come as data (`gag('take')`, double take, wind-up, tremble). It also adds speed lines from earlier frames (`drawStickSmear()`), dust puffs, impact stars, and drawing on twos for video (`drawingRate`). Output is plain keyframes. See [docs/acting.md](docs/acting.md)
64
65
  - **Pencil story example** - `examples/pencil-story-hindi/index.html` tells a short Hindi story (प्यासा राहगीर, the thirsty traveller) Pencilmation-style with the browser bundle alone: the hand draws the scene and writes the narration, then rubs out the pot
65
66
  - **Captions** - `toSRT()` / `toWebVTT()` from narration cues or from a timeline's markers
66
67
 
@@ -98,6 +99,7 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
98
99
  - **Pen tool** - ✒️ Draw custom bezier paths: click for corners, click-drag for curves (Alt for a cusp), drag existing anchors/handles to adjust, snap points to grid/guides, click the first point or Enter to finish
99
100
  - **Loop check** - `tinyfly video scene.mjs --loop-check` renders five frames and says whether a video loops: whether the frame at the duration matches the first, and whether the last → first seam looks like any other step (exit 1 when it does not). `--frames 0,79,88` renders stills at chosen frames. See [docs/video-rendering.md](docs/video-rendering.md#loops)
100
101
  - **Bloom** - `bloom: true` on a video scene adds a deterministic glow around bright things (bright pass, blur, add; no `ctx.filter`), and 3D materials take `emissive` light that shines in the dark and feeds it. `applyBloom(ctx)` works on any 2D canvas. See [docs/video-rendering.md](docs/video-rendering.md#bloom)
102
+ - **Light trails** - `trailSamples` + `drawTrail` draw comets and light streaks on any 2D canvas: a tapering, fading band with a round head, smooth at any speed, and deterministic (the trail is where the thing was, asked of the timeline, not a frame history). 3D scenes get `line` and `trail` objects whose segments sort by depth among the meshes. See [docs/video-rendering.md](docs/video-rendering.md#light-trails) and [docs/scene-3d.md](docs/scene-3d.md#lines-and-trails)
101
103
  - **3D scenes** - `@algorisys/tinyfly/scene-3d`: cameras, lights and meshes (box, sphere, cylinder, cone, torus, floor, any SVG path extruded) as JSON in metres, animated by ordinary tracks (`stage/box`), cut between cameras with one keyframe, drawn on a plain canvas with flat, smooth or toon shading, ink outlines and fog: in the browser, in Workers, and to MP4 in Node. Characters stand in scenes and dance, seen by any camera, in their pen looks (clean, pencil) or as solid figures (`characterObjects`). In the editor, a 🧊 3D Scene element builds them without code: add shapes, characters and lights, key them, dance from the playhead, cut between cameras. No WebGL needed (about 7 KB gzipped, its own entry and CDN script); for big or tangled scenes the optional WebGL2 renderer (`@algorisys/tinyfly/scene-3d/webgl`) adds a depth buffer and light per pixel. See [docs/scene-3d.md](docs/scene-3d.md)
102
104
  - **3D transforms** - Cards, images, text and shapes turn in 3D (`rotateX`, `rotateY`, `z`, `perspective`, `backfaceVisibility`) and land on the same pixels in DOM, SVG, Canvas (true perspective, also headless) and WebGL, checked against each browser's own CSS. One documented transform order everywhere; Tilt / Turn / Depth / Perspective fields in the editor; 3D Card Flip and Cover Flow samples. Quaternion tracks with `interpolation: "slerp"` turn without gimbal lock; the engine's `vec3`, `quat` and `mat4` helpers are plain arrays. The first steps of [3D support](docs/3d-support-plan.md). See [docs/3d-rotations.md](docs/3d-rotations.md)
103
105
  - **Shape morph** - 🌀 Tween one path into another over the timeline (engine-level path interpolation); plays in every renderer, export, and embed
@@ -234,7 +236,7 @@ GSAP-shaped functions at the top level. Teaching embeds are included: add
234
236
  itself.
235
237
 
236
238
  ```html
237
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.87.0/cdn/tinyfly.iife.js"></script>
239
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.89.0/cdn/tinyfly.iife.js"></script>
238
240
  <script>
239
241
  tinyfly.to('.box', { x: 200, rotate: 90, duration: 1, ease: 'power2.out' })
240
242
 
@@ -270,7 +272,7 @@ A teaching figure needs no code at all:
270
272
  <script type="application/json" data-tinyfly-timeline>{ …timeline JSON with markers… }</script>
271
273
  <figcaption>Appending to a full slice</figcaption>
272
274
  </figure>
273
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.87.0/cdn/tinyfly.iife.js" data-tinyfly-auto></script>
275
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.89.0/cdn/tinyfly.iife.js" data-tinyfly-auto></script>
274
276
  ```
275
277
 
276
278
  See [Teaching Animations](docs/teaching.md).
@@ -369,7 +371,7 @@ Without a build step, the player bundle puts the same functions on a `tinyfly` g
369
371
  <div data-tinyfly="box" style="width: 60px; height: 60px; background: #4a9eff;"></div>
370
372
  </div>
371
373
 
372
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.87.0/cdn/tinyfly-player.iife.js"></script>
374
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.89.0/cdn/tinyfly-player.iife.js"></script>
373
375
  <script>
374
376
  tinyfly.play('#animation', './animation.json', { loop: -1 })
375
377
  </script>
@@ -478,7 +480,7 @@ Or skip the code entirely with declarative embeds (see [Teaching Animations](doc
478
480
  <svg viewBox="0 0 720 200">…</svg>
479
481
  <script type="application/json" data-tinyfly-timeline>{ …timeline JSON… }</script>
480
482
  </figure>
481
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.87.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
483
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.89.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
482
484
  ```
483
485
 
484
486
  ### Audio / Video Sync