@algorisys/tinyfly 0.92.0 → 0.94.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.
- package/README.md +7 -6
- package/bin/tinyfly.mjs +34 -1
- package/docs/2d-animation-roadmap.md +191 -0
- package/docs/3d-rotations.md +164 -0
- package/docs/3d-support-plan.md +628 -0
- package/docs/DEPLOYMENT.md +414 -0
- package/docs/acting.md +529 -0
- package/docs/api-reference.md +2353 -0
- package/docs/camera.md +94 -0
- package/docs/cartoon-hands.md +96 -0
- package/docs/character-system-m1.md +218 -0
- package/docs/character-system-plan.md +384 -0
- package/docs/dance.md +315 -0
- package/docs/editor-guide.md +1249 -0
- package/docs/examples.md +765 -0
- package/docs/extending.md +168 -0
- package/docs/file-format.md +690 -0
- package/docs/getting-started.md +314 -0
- package/docs/grid-and-snapping.md +64 -0
- package/docs/gsap-compat.md +1241 -0
- package/docs/llm-guide.md +131 -0
- package/docs/maps.md +116 -0
- package/docs/onion-skinning.md +41 -0
- package/docs/pen-tool.md +65 -0
- package/docs/polygon-star.md +44 -0
- package/docs/scene-3d.md +299 -0
- package/docs/scroll-animation.md +314 -0
- package/docs/shape-morph.md +61 -0
- package/docs/sprite-sheet-export.md +54 -0
- package/docs/symbols-and-library.md +137 -0
- package/docs/teaching.md +348 -0
- package/docs/video-rendering.md +728 -0
- package/lib/addons/adapters.js +22 -18
- package/lib/addons/characters.js +3045 -2024
- package/lib/addons/target-properties-BtN9skb-.js +142 -0
- package/lib/browser/tinyfly.iife.js +9 -4
- package/lib/browser/tinyfly.js +6968 -5817
- package/lib/browser/tinyfly.umd.js +9 -4
- package/lib/engine/tinyfly-engine.js +286 -258
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/types/adapters/canvas/canvas-adapter.d.ts +6 -0
- package/lib/types/adapters/canvas/index.d.ts +1 -0
- package/lib/types/adapters/canvas/target-properties.d.ts +68 -0
- package/lib/types/characters/acting/beat-check.d.ts +102 -0
- package/lib/types/characters/acting/custom.d.ts +66 -0
- package/lib/types/characters/acting/gags.d.ts +10 -0
- package/lib/types/characters/acting/hand-path.d.ts +35 -0
- package/lib/types/characters/acting/index.d.ts +4 -0
- package/lib/types/characters/acting/persona.d.ts +93 -0
- package/lib/types/characters/acting/script.d.ts +75 -11
- package/lib/types/characters/capabilities.d.ts +61 -0
- package/lib/types/characters/code-panel.d.ts +201 -0
- package/lib/types/characters/figure-actions.d.ts +12 -0
- package/lib/types/characters/figure-props.d.ts +87 -0
- package/lib/types/characters/gaits.d.ts +8 -0
- package/lib/types/characters/index.d.ts +3 -0
- package/lib/types/characters/stick-figure.d.ts +9 -2
- package/lib/types/engine/authoring/did-you-mean.d.ts +14 -0
- package/lib/types/engine/authoring/index.d.ts +1 -0
- package/llms-full.txt +12631 -0
- package/llms.txt +57 -0
- package/package.json +6 -2
- package/skills/tinyfly/SKILL.md +67 -0
- package/lib/addons/camera-C7bZOWMB.js +0 -33
package/llms.txt
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# tinyfly
|
|
2
|
+
|
|
3
|
+
> tinyfly is a lightweight, framework-agnostic animation engine with an optional visual editor. Animations are plain JSON (timelines, tracks, keyframes) and play deterministically in browsers, Web Workers and Node. A GSAP-style API (`live.to`, `live.timeline`) drives real DOM and SVG elements.
|
|
4
|
+
|
|
5
|
+
Key facts:
|
|
6
|
+
|
|
7
|
+
- Package: `@algorisys/tinyfly` on npm (`npm install @algorisys/tinyfly`). Entry points: `@algorisys/tinyfly` (engine), `/player`, `/export` (CSS, Lottie, GIF, video exporters), `/adapters` (DOM, Canvas, SVG, WebGL), `/gsap-compat` (GSAP-style API), `/drivers` (scroll, visibility, smooth scroll), `/interaction` (Observer, Draggable), `/teach` (lesson steps and diagram primitives), `/embed` (teaching embeds), `/characters` (poseable stick figure with facial expressions), `/headless` (render scenes to MP4 and PNG stills in Node), `/react`, `/vue`, `/svelte`, `/solid` (framework wrappers), and `/browser` (the GSAP-style runtime plus engine, player, drivers, interaction and the stick figure — no exporters — for script tags). A CLI: `npx @algorisys/tinyfly capabilities`, `check`, `validate`, `render` and `video`.
|
|
8
|
+
- Script tag: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v{version}/cdn/tinyfly.iife.js` defines a global `tinyfly`, e.g. `tinyfly.to('.box', { x: 200, duration: 1 })`. Replace `{version}` with a release tag.
|
|
9
|
+
- The GSAP-style `live` API covers `scrollTrigger` (scrub, pin, toggleActions), `splitText` (chars, words, lines, masks), `drawSVG`, `spring`, `morphSVG`, `motionPath`, text/scramble, inertia and Draggable, Flip (including shared elements by `data-flip-id`), plain-object targets and `live.ticker`.
|
|
10
|
+
- Times in JSON timelines are milliseconds; durations in the GSAP-style API are seconds, as in GSAP.
|
|
11
|
+
- The GSAP-style API is familiar, not compatible: GSAP code does not run unchanged. `docs/gsap-compat.md` lists every supported option and each difference.
|
|
12
|
+
- Track kinds: keyframe tracks, spring (`kind: 'spring'`), inertia (`kind: 'inertia'`), motion path (`property: 'motionPath'`) and text (`property: 'text'`). All serialize to JSON; `docs/file-format.md` defines them.
|
|
13
|
+
- For language models: read the capability catalog first (`npx @algorisys/tinyfly capabilities`, or the end of llms-full.txt). It is generated from the library, so every name in it (poses, expressions, gags, gaits, beat actions, canvas properties, code-panel edits) is accepted, and names not in it are rejected with the name probably meant. Check beat scripts with `npx @algorisys/tinyfly check beats.json`, tracks with `checkTracks(tracks, targets)`, and ask any target what it animates with `describeTarget(target)`. The npm package ships `docs/`, `llms.txt`, `llms-full.txt` and an agent skill (`skills/tinyfly/SKILL.md`); `docs/llm-guide.md` describes the workflow.
|
|
14
|
+
- Source: https://github.com/algorisys-oss/tinyfly. License: MIT.
|
|
15
|
+
|
|
16
|
+
All documentation and the interactive course in a single file: [llms-full.txt](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/llms-full.txt)
|
|
17
|
+
|
|
18
|
+
## Start here
|
|
19
|
+
|
|
20
|
+
- [Getting Started](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/getting-started.md): What tinyfly is, making a first animation in the editor, and using it from code, a script tag or the CDN.
|
|
21
|
+
- [GSAP Compatibility](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/gsap-compat.md): The GSAP-style API (`live.to`, `tf.timeline`): supported vars, motion paths, morphSVG, text, inertia, Draggable, Flip, and where it differs from GSAP.
|
|
22
|
+
- [Code Examples](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/examples.md): Recipes with the engine API: fades, loops, colour and bezier easing, loading JSON, canvas and SVG rendering, multi-scene sequences, motion paths and script-tag embeds.
|
|
23
|
+
- [Building Animations with an LLM](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/llm-guide.md): For assistants and the people setting them up: read the capability catalog (`tinyfly capabilities`), ask targets what they animate (`describeTarget`), check beats and tracks with did-you-mean errors (`tinyfly check`, `checkTracks`), render stills to look at, and the agent skill shipped in the package.
|
|
24
|
+
|
|
25
|
+
## Reference
|
|
26
|
+
|
|
27
|
+
- [API Reference](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/api-reference.md): Every public engine, player and adapter API: Timeline, tracks, keyframes, easing, drivers, serialization and exports.
|
|
28
|
+
- [File Format](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/file-format.md): The JSON animation format: timelines, every track kind, keyframes, easing and the project file — for generating or consuming animations.
|
|
29
|
+
|
|
30
|
+
## Editor features
|
|
31
|
+
|
|
32
|
+
- [Editor Guide](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/editor-guide.md): Every panel and feature of the visual editor, from elements and keyframes to text and inertia tracks, preview and export.
|
|
33
|
+
- [Shape Morphing](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/shape-morph.md): Tweening one path into another, including shapes with different point counts and several subpaths.
|
|
34
|
+
- [Pen Tool](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/pen-tool.md): Drawing custom paths point by point with straight segments and bezier curves.
|
|
35
|
+
- [Polygons & Stars](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/polygon-star.md): Parametric polygon and star shapes that stay editable while animating like any path.
|
|
36
|
+
- [Grid & Snapping](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/grid-and-snapping.md): The grid overlay, snapping to grid, elements and artboard centre, and alignment guides.
|
|
37
|
+
- [Onion Skinning](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/onion-skinning.md): Ghost frames before and after the playhead for judging arcs and easing.
|
|
38
|
+
- [Sprite-sheet Export](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/sprite-sheet-export.md): Exporting frames as a PNG grid plus JSON metadata for game engines and canvas players.
|
|
39
|
+
|
|
40
|
+
## Guides
|
|
41
|
+
|
|
42
|
+
- [Scroll Animation](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/scroll-animation.md): Scroll-driven and play-when-visible animation with ScrollDriver and VisibilityDriver.
|
|
43
|
+
- [Teaching Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/teaching.md): Step-through explanatory figures: markers, captions in several languages, the teaching player, step controls, one-script declarative embeds, tinyfly/teach diagram primitives, and validate / render for build pipelines.
|
|
44
|
+
- [Rendering Video from Code](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/video-rendering.md): Rendering a scene to MP4 without a browser: `tinyfly video`, custom canvas targets drawn by code, timing from narration and recorded voice-over, the stick-figure character, SRT/WebVTT captions, stills, porting Cairo scripts, and a benchmark against pycairo.
|
|
45
|
+
- [Animated Maps](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/maps.md): Maps that animate: a camera that flies in to a city, pins that drop in, routes that draw themselves while a marker travels them, on OpenStreetMap tiles or an offline world outline (also in pencil), in the browser and in headless video.
|
|
46
|
+
- [Cartoon Hands](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/cartoon-hands.md): A hand you can pose: a palm and five fingers in 3D, posed by numbers (curls, thumb, spread, wrist turn), ready-made shapes from a fist to a pencil grip, left and right, four or five fingers, in clean, pencil and silhouette looks; the animator's hand and character gloves are built on it.
|
|
47
|
+
- [Cartoon Acting](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/acting.md): actTracks(): the same key poses, acted: anticipation, overshoot and settle, overlapping joints, eyes that lead and blink, moving holds and jump squash, in full, snappy or limited styles; gags as data (take, double take, wind-up); a line of action (bend); gaits with personality; lip-sync from text (Latin and Devanagari); beat scripts compiled to acted tracks; your own actions (defineAction), gaits (defineGait) and personas (persona()); acting on code (codePanel lines and words as anchors: leap onto a line, point at it, swipe it away wiped, knocked off or blurred; grab, throw, kick, carry and drop words, push them along their line, write new text in by hand; ride a line as gaps close); camera shots (push in, cut, shake, follow); the cartoon zip; speed lines, dust puffs and impact stars; drawing on twos (a timeline setting); acting, gags, walks and lines in the editor.
|
|
48
|
+
- [Dance and Flips](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/dance.md): The stick figure dances disco, hip hop, breaking, jazz, K-pop, Bollywood, Bhangra, Bharatanatyam (with mudras), the Charleston, tap (with tap sounds) and popping (side glide, moonwalk), and does front, back, layout and scissor flips, cartwheels, handsprings, split leaps and full splits: wrists, ankles, turn-out, spin and rise as pose fields; moves keyed in beats; styles, grooves and routines as plain data.
|
|
49
|
+
- [3D Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/scene-3d.md): @algorisys/tinyfly/scene-3d: cameras, lights and meshes as JSON, in metres, animated by tracks at <scene>/<object> (cuts with activeCamera), drawn on a 2D canvas with flat, smooth or toon shading, ink outlines and fog, in browsers, Workers and Node (MP4 with tinyfly video); v2 characters in scenes, dancing, in their pen looks or as solid figures, seen by any camera.
|
|
50
|
+
- [3D Transforms and Rotations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/3d-rotations.md): CSS-style 3D for flat elements in every renderer (rotateX, rotateY, z, perspective, backface visibility; true perspective on Canvas and WebGL, matching CSS within a pixel), one documented transform order, the editor's 3D fields; smooth quaternion rotations with interpolation: "slerp"; the vec3, quat and mat4 helpers; format version 2.
|
|
51
|
+
- [Extending tinyfly](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/extending.md): Writing a render adapter, animating any object with live and the ticker, custom and parametric eases, stagger offsets, adding a track kind, and contributing gallery examples.
|
|
52
|
+
- [Deployment](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/docs/DEPLOYMENT.md): Building and hosting the editor, and serving the player bundles.
|
|
53
|
+
|
|
54
|
+
## Optional
|
|
55
|
+
|
|
56
|
+
- [README](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/README.md): Feature overview, project layout and development setup.
|
|
57
|
+
- [Release notes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.94.0/release-notes/README.md): What changed in each version.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algorisys/tinyfly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lightweight, API-driven animation engine and editor. The engine is framework-agnostic and runs in browsers, Web Workers, and Node.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -129,7 +129,11 @@
|
|
|
129
129
|
"lib/cli",
|
|
130
130
|
"lib/headless",
|
|
131
131
|
"bin",
|
|
132
|
-
"lib/types"
|
|
132
|
+
"lib/types",
|
|
133
|
+
"docs/*.md",
|
|
134
|
+
"llms.txt",
|
|
135
|
+
"llms-full.txt",
|
|
136
|
+
"skills"
|
|
133
137
|
],
|
|
134
138
|
"publishConfig": {
|
|
135
139
|
"access": "public"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tinyfly
|
|
3
|
+
description: Write animations with tinyfly (@algorisys/tinyfly), the JSON-first animation engine — timelines and tracks, canvas shapes, stick-figure characters acting from beat scripts, code panels figures act on, teaching figures and headless video. Use when asked to create, edit or fix a tinyfly animation, a stick-figure scene, an animated code walkthrough or a tinyfly timeline.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Writing tinyfly animations
|
|
7
|
+
|
|
8
|
+
Work in this loop: **read the catalog, write, check, look.** Do not guess
|
|
9
|
+
names: tinyfly rejects names it does not have, and its errors say which name
|
|
10
|
+
was probably meant.
|
|
11
|
+
|
|
12
|
+
## 1. Read what exists
|
|
13
|
+
|
|
14
|
+
Run `npx @algorisys/tinyfly capabilities` (add `--json` for data) and read it
|
|
15
|
+
before writing anything. It is generated from the installed library: easings,
|
|
16
|
+
track kinds, every canvas property with units and ranges, the stick figure's
|
|
17
|
+
joints, poses, expressions (moods), gags, gaits, beat actions (and the fields
|
|
18
|
+
each needs), dances, flips, hand shapes, the code panel's languages, anchors
|
|
19
|
+
and edits, camera shots, teaching helpers.
|
|
20
|
+
|
|
21
|
+
For the how-to, read the docs shipped with the package, at the installed
|
|
22
|
+
version: `node_modules/@algorisys/tinyfly/llms.txt` (index), `docs/*.md`, or
|
|
23
|
+
`llms-full.txt` (everything). For characters acting on code, read
|
|
24
|
+
`docs/acting.md` ("Beat scripts" and "Acting on code").
|
|
25
|
+
|
|
26
|
+
At runtime, `describeTarget(target)` says what any target animates (with its
|
|
27
|
+
current values) and what it can do; `animatableProperties(target)` gives the
|
|
28
|
+
names.
|
|
29
|
+
|
|
30
|
+
## 2. Write
|
|
31
|
+
|
|
32
|
+
- Prefer the high-level builders: `scriptTracks()` beats for characters,
|
|
33
|
+
`codePanel()` for code, `lesson()` and the diagram primitives for teaching
|
|
34
|
+
figures, `cameraTracks()` for camera moves. They produce plain JSON tracks.
|
|
35
|
+
- Aim beats at anchors, never guessed coordinates: `code.line(n)`,
|
|
36
|
+
`code.token(n, 'word')`, `code.spot(n, column, width)`, `piece.home`,
|
|
37
|
+
`code.landing(piece, n, column)`.
|
|
38
|
+
- Key reactions to the contact times beats report:
|
|
39
|
+
`script.beats[i].contact` / `.release` (wipe a line, fling a word, type text).
|
|
40
|
+
- Units: JSON times are milliseconds; the GSAP-style `live` API takes seconds.
|
|
41
|
+
Canvas `x`/`y` tracks are offsets from where a target was placed. Scene y
|
|
42
|
+
grows downward. Angles are degrees.
|
|
43
|
+
- Record code-panel edits before `code.ride(tracks, figureId, { ground })`.
|
|
44
|
+
- For recurring characters, make a `persona()` (look, acting, gait, mood,
|
|
45
|
+
stance) and use `persona.script()`; for a move the catalog lacks, write it
|
|
46
|
+
with `defineAction()` rather than hand-keying joints in many places.
|
|
47
|
+
|
|
48
|
+
## 3. Check
|
|
49
|
+
|
|
50
|
+
- Beat scripts: `npx @algorisys/tinyfly check beats.json` (or `checkBeats()`;
|
|
51
|
+
`scriptTracks()` throws on the same errors).
|
|
52
|
+
- Tracks: `checkTracks(tracks, targets)` — unknown targets and properties,
|
|
53
|
+
key order, value kinds and ranges.
|
|
54
|
+
- Teaching timelines: `npx @algorisys/tinyfly validate timeline.json --markup figure.svg`.
|
|
55
|
+
|
|
56
|
+
Fix every error; read every warning.
|
|
57
|
+
|
|
58
|
+
## 4. Look
|
|
59
|
+
|
|
60
|
+
Render stills and look at them before saying it works:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npx @algorisys/tinyfly video scene.mjs --stills frames --times 0,800,1600
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Check that hands meet what they touch, figures stand on their floors, text
|
|
67
|
+
lands where it should and nothing leaves the frame. Fix and render again.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const r = { x: 0, y: 0, scale: 1, rotate: 0, shakeX: 0, shakeY: 0, shakeRotate: 0 };
|
|
2
|
-
function k(t) {
|
|
3
|
-
const a = (s) => {
|
|
4
|
-
const h = t?.get(s);
|
|
5
|
-
return typeof h == "number" ? h : r[s];
|
|
6
|
-
};
|
|
7
|
-
return {
|
|
8
|
-
x: a("x"),
|
|
9
|
-
y: a("y"),
|
|
10
|
-
scale: a("scale"),
|
|
11
|
-
rotate: a("rotate"),
|
|
12
|
-
shakeX: a("shakeX"),
|
|
13
|
-
shakeY: a("shakeY"),
|
|
14
|
-
shakeRotate: a("shakeRotate")
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
function l(t, a, s) {
|
|
18
|
-
const h = s.width / 2, e = s.height / 2, c = 1 + 2 * Math.max(Math.abs(a.shakeX), Math.abs(a.shakeY)) / Math.max(1, Math.min(s.width, s.height));
|
|
19
|
-
t.translate(h + a.x + a.shakeX, e + a.y + a.shakeY), t.rotate((a.rotate + a.shakeRotate) * Math.PI / 180), t.scale(a.scale * c, a.scale * c), t.translate(-h, -e);
|
|
20
|
-
}
|
|
21
|
-
function M(t, a, s) {
|
|
22
|
-
const h = a.width / 2, e = a.height / 2, o = (t.rotate + t.shakeRotate) * Math.PI / 180, c = (s.x - h) * t.scale, n = (s.y - e) * t.scale;
|
|
23
|
-
return {
|
|
24
|
-
x: h + t.x + t.shakeX + c * Math.cos(o) - n * Math.sin(o),
|
|
25
|
-
y: e + t.y + t.shakeY + c * Math.sin(o) + n * Math.cos(o)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
r as I,
|
|
30
|
-
l as a,
|
|
31
|
-
M as b,
|
|
32
|
-
k as c
|
|
33
|
-
};
|