@algorisys/tinyfly 0.97.0 → 0.98.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 -7
- package/docs/character-appearance.md +281 -0
- package/docs/editor-guide.md +14 -6
- package/docs/examples.md +1 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +21 -1
- package/docs/maps.md +2 -2
- package/docs/props.md +8 -6
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +5720 -4476
- package/lib/browser/tinyfly.iife.js +15 -15
- package/lib/browser/tinyfly.js +7928 -6684
- package/lib/browser/tinyfly.umd.js +15 -15
- package/lib/types/characters/capabilities.d.ts +15 -0
- package/lib/types/characters/cast.d.ts +284 -0
- package/lib/types/characters/character.d.ts +22 -4
- package/lib/types/characters/hands/held-items.d.ts +88 -0
- package/lib/types/characters/hands/index.d.ts +1 -0
- package/lib/types/characters/head/ears.d.ts +10 -0
- package/lib/types/characters/head/facial-hair.d.ts +118 -0
- package/lib/types/characters/head/glasses.d.ts +24 -0
- package/lib/types/characters/head/hair.d.ts +560 -0
- package/lib/types/characters/head/hats.d.ts +58 -0
- package/lib/types/characters/head/head-look.d.ts +53 -0
- package/lib/types/characters/head/index.d.ts +5 -0
- package/lib/types/characters/head/shell.d.ts +64 -0
- package/lib/types/characters/index.d.ts +4 -1
- package/lib/types/characters/interactions.d.ts +69 -0
- package/lib/types/characters/props/families/animals.d.ts +6 -0
- package/lib/types/characters/species/human-motion.d.ts +5 -2
- package/lib/types/characters/species/human.d.ts +111 -4
- package/lib/types/characters/wardrobe/basic-outfit.d.ts +19 -5
- package/llms-full.txt +355 -27
- package/llms.txt +29 -28
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +10 -1
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
|
|
|
54
54
|
- **Code-drawn targets** - A `custom` canvas target draws with code (characters, charts, props) while the timeline animates its position, opacity and its own `props`, so drawing stays code and timing stays JSON
|
|
55
55
|
- **Immediate mode too** - A scene's `background` and `draw(ctx, { time })` functions paint each frame directly, Cairo/Processing-style, and mix freely with timeline targets
|
|
56
56
|
- **Timing from narration** - `planNarration()` lays spoken lines out from their clip lengths (lead, gap, tail) into cues, scene spans and markers; `voiceNarration()` measures recorded clips with ffmpeg and writes the sample-aligned narration WAV
|
|
57
|
-
- **Characters** - A poseable stick figure (`@algorisys/tinyfly/characters`): named poses, facial expressions (brows, eyes that widen, close and look around, mouth shapes), squash and stretch, rubber-hose limbs, blending, walk cycles and talking, all driven by timeline tracks. **Characters v2**: one skeleton in 3D drawn flat, turning front to side to back, resting on whatever touches the ground, reaching for points, in clean, pencil or silhouette looks, and a 🧍 Character element in the editor you pose and keyframe
|
|
57
|
+
- **Characters** - A poseable stick figure (`@algorisys/tinyfly/characters`): named poses, facial expressions (brows, eyes that widen, close and look around, mouth shapes), squash and stretch, rubber-hose limbs, blending, walk cycles and talking, all driven by timeline tracks. **Characters v2**: one skeleton in 3D drawn flat, turning front to side to back, resting on whatever touches the ground, reaching for points, in clean, pencil or silhouette looks, and a 🧍 Character element in the editor you pose and keyframe. **Character appearance**: 34 hairstyles, 20 facial-hair styles, glasses, hats and ears as plain data on the head (they turn with it through all eight views), builds from toddler to tall, a recurring cast (`castMember`), and 30 expressions with blush, tears and sweat ([guide](docs/character-appearance.md))
|
|
58
58
|
- **Dance and flips** - The stick figure dances disco, hip hop, breaking toprock, jazz, K-pop, Bollywood, Bhangra, Bharatanatyam (with mudras), the Charleston, tap (foot strikes as data, for tap sounds) and popping (side glide, moonwalk, forward glide, which travel with the planted foot staying put), and does front, back, layout, scissor and side flips, cartwheels, back handsprings, split leaps, toe touches and full splits. Wrists, ankles, foot turn-out, whole-body `spin` and `rise` are pose fields; moves are keyed in beats, so any tempo plays them; styles, grooves and routines are plain JSON (`danceFrame()`, `danceTracks()`, `flipPose()`, `flipTracks()`). In the editor a 🧍 Character dances from the playhead, in time with the music: an Audio element's tempo is detected (`detectTempo()`) or tapped, the timeline shows its beats and bars, and keyframes snap to them. See [docs/dance.md](docs/dance.md)
|
|
59
59
|
- **Maps** - Animated maps on OpenStreetMap tiles or an offline world outline (also in pencil): the camera flies in, pins drop, routes draw themselves while a marker travels them; a 🗺 Map element in the editor with a one-click trip
|
|
60
60
|
- **Pencil sketch style** - Hand-drawn strokes with line boil (`sketch` style, `sketchPen`) for a pencil-test, Pencilmation-like look, on the stick figure and on canvas rect / circle / line / path shapes (also from the editor's Properties panel); a `drawOn` track draws any of those shapes on; the wobble is seeded by time, so renders stay deterministic
|
|
@@ -153,7 +153,7 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
|
|
|
153
153
|
- [Deployment](docs/DEPLOYMENT.md) — Hosting, Docker, and CDN configuration
|
|
154
154
|
- [2D Animation Roadmap](docs/2d-animation-roadmap.md) — Adobe Animate gap analysis and phased plan (symbols/library, camera, onion skinning, …)
|
|
155
155
|
|
|
156
|
-
**Feature guides:** [Symbols & Library](docs/symbols-and-library.md) · [Camera](docs/camera.md) · [Polygon & Star](docs/polygon-star.md) · [Pen tool](docs/pen-tool.md) · [Shape morph](docs/shape-morph.md) · [Grid & snapping](docs/grid-and-snapping.md) · [Onion skinning](docs/onion-skinning.md) · [Sprite-sheet export](docs/sprite-sheet-export.md)
|
|
156
|
+
**Feature guides:** [Character appearance](docs/character-appearance.md) · [Symbols & Library](docs/symbols-and-library.md) · [Camera](docs/camera.md) · [Polygon & Star](docs/polygon-star.md) · [Pen tool](docs/pen-tool.md) · [Shape morph](docs/shape-morph.md) · [Grid & snapping](docs/grid-and-snapping.md) · [Onion skinning](docs/onion-skinning.md) · [Sprite-sheet export](docs/sprite-sheet-export.md)
|
|
157
157
|
|
|
158
158
|
**Docs for LLMs:** the repo root has [`llms.txt`](llms.txt), an [llmstxt.org](https://llmstxt.org) index of these docs, and [`llms-full.txt`](llms-full.txt): every doc, the course, and the capability catalog in one file. Both ship in the npm package with the docs and an agent skill (`skills/tinyfly/SKILL.md`), so an assistant finds them in `node_modules` at the installed version. `npx @algorisys/tinyfly capabilities` prints the catalog: every pose, expression, gag, gait, beat action, canvas property and code-panel edit, read from the library, so a name in it is accepted and a name not in it is rejected with the name probably meant (`tinyfly check beats.json`, `checkTracks`). The built editor also serves `/llms.txt`, `/llms-full.txt` and each page as raw markdown at `/docs/<page>.md`.
|
|
159
159
|
|
|
@@ -189,7 +189,7 @@ for what you import:
|
|
|
189
189
|
| `@algorisys/tinyfly/teach` | `lesson()` step builder and diagram primitives (cells, pointer, stack, queue, table, pipeline) | Anywhere |
|
|
190
190
|
| `@algorisys/tinyfly/react`, `@algorisys/tinyfly/vue`, `@algorisys/tinyfly/svelte`, `@algorisys/tinyfly/solid` | `useTinyfly` hooks, a Svelte action and a Solid primitive: `live` animations scoped to a component and reverted on unmount | Browser (frameworks are optional peer dependencies) |
|
|
191
191
|
| `@algorisys/tinyfly/maps` | Animated maps: OpenStreetMap tiles or an offline world outline, places, routes that draw on, a camera that flies (`mapTarget`, `mapFlyTracks`, `fitView`, `WORLD_CITIES`) | Anywhere with a Canvas 2D context (tiles need a network) |
|
|
192
|
-
| `@algorisys/tinyfly/characters` | Poseable stick figure: `stickFigureTarget`, `poseTracks`, `POSES`, `blendPose`, `walkPose`, `drawStickFigure`; `stickFigureJoints` and `layers` for costumes, hair and props; `turn`, `sit` and ground contact; an organic look by default (`classic` keeps the old one); **characters v2**: `character()` / `characterTarget()`, turnarounds front to back, contact, reaching, clean / pencil / silhouette looks | Anywhere with a Canvas 2D context |
|
|
192
|
+
| `@algorisys/tinyfly/characters` | Poseable stick figure: `stickFigureTarget`, `poseTracks`, `POSES`, `blendPose`, `walkPose`, `drawStickFigure`; `stickFigureJoints` and `layers` for costumes, hair and props; `turn`, `sit` and ground contact; an organic look by default (`classic` keeps the old one); **characters v2**: `character()` / `characterTarget()`, turnarounds front to back, contact, reaching, clean / pencil / silhouette looks; `hair`, `facialHair`, `glasses`, `hat`, `ears`, `build`, `outfit` as data, `castMember()`, `HUMAN_EXPRESSIONS` with face marks | Anywhere with a Canvas 2D context |
|
|
193
193
|
| `@algorisys/tinyfly/headless` | `renderVideo`, `renderStills`, `FrameRenderer`: render a scene to MP4 or PNGs (see [Rendering Video from Code](docs/video-rendering.md)) | Node (`@napi-rs/canvas` optional peer, ffmpeg) |
|
|
194
194
|
| `@algorisys/tinyfly/browser` | One script-tag bundle (`tinyfly.iife.js`): the engine, player, drivers, interaction, the GSAP-style `live` / `tf` facades, teaching-embed controls and mounting, and the `characters` stick figure. Not included: `export`, `adapters`, `teach`, the framework hooks, `headless` | Browser |
|
|
195
195
|
|
|
@@ -237,7 +237,7 @@ GSAP-shaped functions at the top level. Teaching embeds are included: add
|
|
|
237
237
|
itself.
|
|
238
238
|
|
|
239
239
|
```html
|
|
240
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
240
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
|
|
241
241
|
<script>
|
|
242
242
|
tinyfly.to('.box', { x: 200, rotate: 90, duration: 1, ease: 'power2.out' })
|
|
243
243
|
|
|
@@ -273,7 +273,7 @@ A teaching figure needs no code at all:
|
|
|
273
273
|
<script type="application/json" data-tinyfly-timeline>{ …timeline JSON with markers… }</script>
|
|
274
274
|
<figcaption>Appending to a full slice</figcaption>
|
|
275
275
|
</figure>
|
|
276
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
276
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js" data-tinyfly-auto></script>
|
|
277
277
|
```
|
|
278
278
|
|
|
279
279
|
See [Teaching Animations](docs/teaching.md).
|
|
@@ -372,7 +372,7 @@ Without a build step, the player bundle puts the same functions on a `tinyfly` g
|
|
|
372
372
|
<div data-tinyfly="box" style="width: 60px; height: 60px; background: #4a9eff;"></div>
|
|
373
373
|
</div>
|
|
374
374
|
|
|
375
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
375
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-player.iife.js"></script>
|
|
376
376
|
<script>
|
|
377
377
|
tinyfly.play('#animation', './animation.json', { loop: -1 })
|
|
378
378
|
</script>
|
|
@@ -481,7 +481,7 @@ Or skip the code entirely with declarative embeds (see [Teaching Animations](doc
|
|
|
481
481
|
<svg viewBox="0 0 720 200">…</svg>
|
|
482
482
|
<script type="application/json" data-tinyfly-timeline>{ …timeline JSON… }</script>
|
|
483
483
|
</figure>
|
|
484
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
484
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
485
485
|
```
|
|
486
486
|
|
|
487
487
|
### Audio / Video Sync
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# Character Appearance
|
|
2
|
+
|
|
3
|
+
Hair, facial hair, glasses, hats, ears, builds, a ready-made cast, held items
|
|
4
|
+
and meeting hands for the v2 character (`character()` in `@algorisys/tinyfly/characters`). Every choice
|
|
5
|
+
is plain data, so a character can be saved, synced, generated by a language
|
|
6
|
+
model and changed one field at a time.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
The sheet is drawn by `examples/headless-video/appearance-sheet.mjs`
|
|
11
|
+
(`npx tinyfly video examples/headless-video/appearance-sheet.mjs --stills stills/`).
|
|
12
|
+
|
|
13
|
+
## Quick start
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import { character, characterTarget, drawCharacter, humanPose, castMember, HUMAN_EXPRESSIONS } from '@algorisys/tinyfly/characters'
|
|
17
|
+
|
|
18
|
+
// Pick everything by name…
|
|
19
|
+
const maya = character({
|
|
20
|
+
height: 300,
|
|
21
|
+
build: 'slim',
|
|
22
|
+
hair: { style: 'highPonytail', color: '#9a4426' },
|
|
23
|
+
glasses: 'round',
|
|
24
|
+
ears: true,
|
|
25
|
+
outfit: { shirt: '#f0b43c', trousers: '#36507a' },
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
// …or start from the cast and change what you like.
|
|
29
|
+
const grandpa = character(castMember('grandpa', 300, { look: 'pencil' }))
|
|
30
|
+
|
|
31
|
+
// Faces are pose fields, so any expression goes with any action and view.
|
|
32
|
+
drawCharacter(ctx, maya, humanPose({ ...HUMAN_EXPRESSIONS.embarrassed, turn: 0.5 }))
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
A plain figure (no `hair`, `facialHair`, `glasses`, `hat` or `ears`) draws
|
|
36
|
+
exactly as it did before these options existed.
|
|
37
|
+
|
|
38
|
+
## How it turns
|
|
39
|
+
|
|
40
|
+
Hair, beards and hats are not flat drawings pasted on the face. Each is a
|
|
41
|
+
region on the head's surface (where the hairline runs, how far the hair stands
|
|
42
|
+
off the head, how far it hangs), drawn wherever the head's `turn`, `head.turn`,
|
|
43
|
+
`head.nod` and `head.tilt` put it:
|
|
44
|
+
|
|
45
|
+
- the part facing away is drawn before the body, so long hair hangs behind the
|
|
46
|
+
shoulders seen from the front, and a bob shows beside the face;
|
|
47
|
+
- the part facing the viewer is drawn over the head, so a fringe crosses the
|
|
48
|
+
forehead and, from behind, the hair covers the whole head;
|
|
49
|
+
- turned away (past about `turn` 1.2), the hair is drawn after the whole body,
|
|
50
|
+
over an arm at the side;
|
|
51
|
+
- a parting, a side ponytail or a braid stays on the character's own side
|
|
52
|
+
through a turn: left and right are the character's, never mirrored.
|
|
53
|
+
|
|
54
|
+
Glasses, moustaches and the face marks sit on the face itself, placed like the
|
|
55
|
+
eyes and mouth, so they slide round with the face and hide with it.
|
|
56
|
+
|
|
57
|
+
**Which part wins where two overlap** is fixed: eyes and brows draw over a
|
|
58
|
+
fringe; the mouth draws over a beard, which leaves an opening for it (so every
|
|
59
|
+
lip-sync shape stays readable); a moustache draws over the top of the mouth;
|
|
60
|
+
glasses over the eyes; a hat over the hair. Ears are hidden by hair that
|
|
61
|
+
`coversEars`.
|
|
62
|
+
|
|
63
|
+
## Views
|
|
64
|
+
|
|
65
|
+
`turn` runs 0 → 4. The eight reference views:
|
|
66
|
+
|
|
67
|
+
| View | `turn` |
|
|
68
|
+
|---|---|
|
|
69
|
+
| Front | 0 |
|
|
70
|
+
| Front 3/4 right (nose toward screen right) | 0.5 |
|
|
71
|
+
| Right profile | 1 |
|
|
72
|
+
| Back 3/4 right | 1.5 |
|
|
73
|
+
| Back | 2 |
|
|
74
|
+
| Back 3/4 left | 2.5 |
|
|
75
|
+
| Left profile | 3 |
|
|
76
|
+
| Front 3/4 left | 3.5 |
|
|
77
|
+
|
|
78
|
+
The view names describe the screen; limb and side names (`arm.left`,
|
|
79
|
+
`at: 'left'`) are always the character's own.
|
|
80
|
+
|
|
81
|
+
## Hair
|
|
82
|
+
|
|
83
|
+
`hair` takes a style name, a style with changes, or `null`:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
character({ hair: 'bob' })
|
|
87
|
+
character({ hair: { style: 'bob', color: HAIR_COLORS.auburn, length: 1.4 } })
|
|
88
|
+
character({ hair: { volume: 0.2, hairline: { front: 0.3 }, ties: [{ kind: 'bun', at: 'top' }] } })
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Short cuts and hairlines: `bald`, `buzzCut`, `crewCut`, `short`, `sidePart`,
|
|
92
|
+
`sideSwept`, `slickBack`, `quiff`, `spiky`, `undercut`, `curlyCrop`, `afro`,
|
|
93
|
+
`wavyCrop`, `shortLocs`, `flatTop`, `receding`, `thinning`.
|
|
94
|
+
|
|
95
|
+
Medium and long hair: `pixie`, `bob`, `longBob`, `wavyBob`, `shoulderStraight`,
|
|
96
|
+
`shoulderWaves`, `longStraight`, `longWaves`, `longCurls`, `longLocs`,
|
|
97
|
+
`lowPonytail`, `highPonytail`, `ponytail`, `sidePonytail`, `topBun`, `lowBun`,
|
|
98
|
+
`singleBraid`, `twinBraids`, `braids`.
|
|
99
|
+
|
|
100
|
+
Every style is the same few fields (`resolveHair(spec)` fills them all in):
|
|
101
|
+
|
|
102
|
+
| Field | Meaning |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `color` | Fill colour. `HAIR_COLORS` has `black`, `brown`, `chestnut`, `auburn`, `blond`, `ginger`, `gray`, `white` |
|
|
105
|
+
| `volume` | How far the hair stands off the head (head radii) |
|
|
106
|
+
| `hairline` | `{ front, side, back }`: its height at the forehead, temples and nape (head radii, +up from the head's centre) |
|
|
107
|
+
| `sweep` | A side fringe: the hairline drops toward the character's left (+) or right (−) |
|
|
108
|
+
| `recede` | Temples pushed back |
|
|
109
|
+
| `length` | Long hair: where it ends, head radii below the head's centre (`0` short; about 1.75 is the shoulders) |
|
|
110
|
+
| `opening` | Long hair: half the opening left for the face, degrees |
|
|
111
|
+
| `texture`, `textureAmount` | `smooth`, `spiky`, `curly`, `wavy` or `locs`, and how strong |
|
|
112
|
+
| `quiff`, `flat` | Volume swept up over the forehead; a flat top's height |
|
|
113
|
+
| `part`, `strands` | A parting (degrees round from the middle of the face) and the detail lines: `none`, `part`, `sweep`, `combed`, `hanging`, `thin` |
|
|
114
|
+
| `fill` | `solid`, or `stipple` (close-cropped: dots on the scalp) |
|
|
115
|
+
| `ties` | Ponytails, buns and braids: `{ kind: 'ponytail' \| 'bun' \| 'braid', at: 'top' \| 'high' \| 'low' \| 'left' \| 'right', length?, size? }` |
|
|
116
|
+
| `coversEars` | The hair hides the ears |
|
|
117
|
+
|
|
118
|
+
A style stays a starting point: any style suits anyone.
|
|
119
|
+
|
|
120
|
+
## Facial hair
|
|
121
|
+
|
|
122
|
+
`facialHair` takes a style name or `{ moustache, beard, color }` (the colour
|
|
123
|
+
defaults to the hair's):
|
|
124
|
+
|
|
125
|
+
`cleanShaven`, `stubble`, `pencilMoustache`, `shortMoustache`, `chevron`,
|
|
126
|
+
`handlebar`, `walrus`, `goatee`, `vanDyke`, `circleBeard`, `shortBoxed`,
|
|
127
|
+
`fullBeard`, `longBeard`, `roundedBeard`, `pointedBeard`, `chinStrap`,
|
|
128
|
+
`soulPatch`, `sideburns`, `muttonChops`, `moustacheStubble`.
|
|
129
|
+
|
|
130
|
+
Moustaches: `none`, `pencil`, `short`, `chevron`, `handlebar`, `walrus`.
|
|
131
|
+
Beards: `none`, `stubble`, `goatee`, `soulPatch`, `chinStrap`, `circle`,
|
|
132
|
+
`boxed`, `full`, `rounded`, `pointed`, `long`, `sideburns`, `muttonChops`.
|
|
133
|
+
|
|
134
|
+
## Glasses, hats and ears
|
|
135
|
+
|
|
136
|
+
- `glasses`: `round`, `square`, `sunglasses` (drawn in the ink; the near arm
|
|
137
|
+
runs back to the ear in profile).
|
|
138
|
+
- `hat`: `cap`, `beanie`, `hardHat`, `sunHat`, `bowler`, or `{ style, color }`.
|
|
139
|
+
The crown sits over the hair; hair below the brim still shows.
|
|
140
|
+
- `ears: true` adds ears: they stick out past the head from the front and
|
|
141
|
+
behind, and sit on the head with a curl when turned toward the viewer.
|
|
142
|
+
|
|
143
|
+
## Builds
|
|
144
|
+
|
|
145
|
+
`build` sets proportions; `height` sets how tall the character stands. Any
|
|
146
|
+
field can still be set on its own (`headSize`, `shoulderWidth`, `hipWidth`,
|
|
147
|
+
`legLength`, `armLength`).
|
|
148
|
+
|
|
149
|
+
| Build | What changes |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `standard` | Nothing |
|
|
152
|
+
| `slim` | Smaller head, narrower |
|
|
153
|
+
| `tall` | Smaller head, longer legs and arms |
|
|
154
|
+
| `short` | Larger head, shorter legs, a little wider |
|
|
155
|
+
| `broad`, `curvy`, `stocky` | Shoulder and hip widths (stocky: a larger head) |
|
|
156
|
+
| `kid`, `child`, `toddler` | Larger head, shorter limbs |
|
|
157
|
+
|
|
158
|
+
Age, posture and accessories are separate choices: a child build is only
|
|
159
|
+
proportions, and an older character is shown by hair and glasses, never by a
|
|
160
|
+
stoop unless one is posed. The same poses, gaits and actions work on every
|
|
161
|
+
build; `humanGaitStrideLength(gait, height, stride, legLength)` gives a build's
|
|
162
|
+
stride so its feet stay planted.
|
|
163
|
+
|
|
164
|
+
## Clothes
|
|
165
|
+
|
|
166
|
+
`outfit` dresses the character as data (any `layers` are drawn over it):
|
|
167
|
+
|
|
168
|
+
```js
|
|
169
|
+
character({ outfit: { shirt: '#7a8fa6', trousers: '#3b3f46', sleeves: 'long', collar: true, tie: '#2b4f8c' } })
|
|
170
|
+
character({ outfit: { bottom: 'skirt' } })
|
|
171
|
+
character({ outfit: { over: 'labCoat' } })
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
| Field | Choices |
|
|
175
|
+
|---|---|
|
|
176
|
+
| `shirt`, `trousers` | Colours (the trousers' colour also colours shorts and a skirt) |
|
|
177
|
+
| `sleeves` | `short` (default), `long`, `none` |
|
|
178
|
+
| `bottom` | `trousers` (default), `shorts`, `skirt` |
|
|
179
|
+
| `collar` | `true` for a shirt collar |
|
|
180
|
+
| `tie` | A colour, for a tie down the front |
|
|
181
|
+
| `over`, `overColor` | `apron` or `labCoat`, and its colour |
|
|
182
|
+
|
|
183
|
+
The front details (collar, tie, apron, the coat's opening) show from the
|
|
184
|
+
front and turn away with the body; from behind an apron shows its ties.
|
|
185
|
+
`basicOutfit(options)` gives the same clothes as layers.
|
|
186
|
+
|
|
187
|
+
## The cast
|
|
188
|
+
|
|
189
|
+
`castMember(name, height, changes?)` returns character options for a recurring
|
|
190
|
+
cast member at an adult `height` (each stands at their own scale of it). The
|
|
191
|
+
family: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`,
|
|
192
|
+
`grandma`; at work (from the occupations sheet): `doctor`, `cook`, `builder`,
|
|
193
|
+
`courier`, `teacher`, `farmer`. `CHARACTER_CAST` has each one's `label`,
|
|
194
|
+
`group` (`family` or `work`), `scale` and `options`.
|
|
195
|
+
|
|
196
|
+
```js
|
|
197
|
+
const family = ['man', 'woman', 'girl', 'grandma'].map((name) => character(castMember(name, 280)))
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Expressions and face marks
|
|
201
|
+
|
|
202
|
+
`HUMAN_EXPRESSIONS` sets every face field, so applying one replaces the whole
|
|
203
|
+
face, and any two blend. Besides the stick figure's faces (`neutral`, `happy`,
|
|
204
|
+
`joyful`, `sad`, `crying`, `surprised`, `shocked`, `angry`, `furious`,
|
|
205
|
+
`worried`, `scared`, `confused`, `skeptical`, `thinking`, `sleepy`,
|
|
206
|
+
`disgusted`, `smug`, `wink`) there are `laughing`, `afraid`, `bored`, `tired`,
|
|
207
|
+
`embarrassed`, `proud`, `determined`, `affectionate`, `hurt`, `suspicious`,
|
|
208
|
+
`relieved` and `excited`.
|
|
209
|
+
|
|
210
|
+
Three face marks fade in from 0 to 1 and are pose fields like any other (so
|
|
211
|
+
tracks animate them): `blush` (rosy cheeks, with hatch lines past 0.5),
|
|
212
|
+
`tears` (a drop under each eye, running down past 0.6) and `sweat` (a bead at
|
|
213
|
+
the temple).
|
|
214
|
+
|
|
215
|
+
## Everyday actions, held items and meeting hands
|
|
216
|
+
|
|
217
|
+
The motion and everyday-life sheets add poses to `HUMAN_POSES`: `sleep`,
|
|
218
|
+
`stretch`, `sitFloor` (cross-legged), `carry`, `lift`, `push`, `pull`,
|
|
219
|
+
`drink`, `phone`, `read` and `type` (seated, for a desk). Like every pose they
|
|
220
|
+
blend, turn and take any face.
|
|
221
|
+
|
|
222
|
+
**Holding things.** `holding` puts an item in a hand, as data:
|
|
223
|
+
|
|
224
|
+
```js
|
|
225
|
+
character({ holding: { right: 'mug' } }) // drink
|
|
226
|
+
character({ holding: { left: 'bag', right: 'bag' } }) // carry
|
|
227
|
+
character({ holding: { both: { item: 'parcel', color: '#c9a06a' } } })
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Items: `mug`, `phone`, `briefcase`, `bag`, `umbrella` and `broom` (one hand,
|
|
231
|
+
`left` or `right`), `book` (one hand or `both`) and `parcel` (`both`). Each is
|
|
232
|
+
drawn at the hand's grip, so it follows the hand through any pose, gait or
|
|
233
|
+
turn, and sorts with that arm (a mug goes behind the body with the far arm).
|
|
234
|
+
An umbrella's canopy sits just over the head. `handGrip(joints, side)` gives
|
|
235
|
+
the grip point and the forearm's direction for drawing anything else in a
|
|
236
|
+
hand.
|
|
237
|
+
|
|
238
|
+
Whether an item shows is a pose field, `held.left`, `held.right` or
|
|
239
|
+
`held.both` (1 by default; below 0.5 it has been let go), so a track lets go
|
|
240
|
+
of it at a moment: a parcel handed over is the giver's `held.both` going to 0
|
|
241
|
+
as the taker's goes to 1.
|
|
242
|
+
|
|
243
|
+
**Meeting hands.** `meetHands(kind, a, b, options?)` poses two characters so
|
|
244
|
+
their hands meet at one point, rather than playing two clips and hoping they
|
|
245
|
+
line up: `handshake`, `highFive`, `fistBump` and `handOver` (four hands round
|
|
246
|
+
one parcel). Each partner is `{ character, x, pose? }` on the same ground
|
|
247
|
+
line; the one on the left turns to face right and the other left,
|
|
248
|
+
three-quarters on (`view: 'side'` for profiles). Stand them
|
|
249
|
+
`meetingSpacing(kind, a, b)` apart; the result's `reached` says whether both
|
|
250
|
+
got there.
|
|
251
|
+
|
|
252
|
+
```js
|
|
253
|
+
const gap = meetingSpacing('handOver', courier, neighbour)
|
|
254
|
+
const give = meetHands('handOver', { character: courier, x: 300 }, { character: neighbour, x: 300 + gap })
|
|
255
|
+
// give.a and give.b are poses to key; give.point is where the parcel is.
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## In the editor
|
|
259
|
+
|
|
260
|
+
Select a 🧍 Character and open **Head** in the properties: **Cast** dresses it
|
|
261
|
+
as a cast member (build, hair, facial hair, glasses and clothes in one step),
|
|
262
|
+
then **Hair**, **Hair colour**, **Facial hair**, **Glasses**, **Hat** and
|
|
263
|
+
**Ears** change one thing at a time; **Right hand**, **Left hand** and **Both
|
|
264
|
+
hands** put an item in them. **Build** lists the builds, with **Legs** and
|
|
265
|
+
**Arms** sliders. The new expressions and everyday poses are in the **Face**
|
|
266
|
+
and **Body** lists. All of it is saved as plain fields on the element and
|
|
267
|
+
exported to video and GIF.
|
|
268
|
+
|
|
269
|
+
## In the gallery
|
|
270
|
+
|
|
271
|
+
- **Cast Turnaround**: the whole cast turning through all eight views together.
|
|
272
|
+
- **Hair, Beards & Hats**: pick a style, colour, facial hair, glasses, hat and
|
|
273
|
+
face, and see the character turning and in all eight views at once.
|
|
274
|
+
- **Hand Over**: a courier walks up and hands a parcel over (`meetHands`,
|
|
275
|
+
`holding`, `held.both`).
|
|
276
|
+
|
|
277
|
+
## Determinism
|
|
278
|
+
|
|
279
|
+
Outlines are traced from the same numbers every time (no randomness, no state
|
|
280
|
+
between frames), so a frame at a given time always draws the same, and the
|
|
281
|
+
pencil look's boil stays seeded as before.
|
package/docs/editor-guide.md
CHANGED
|
@@ -137,12 +137,19 @@ its box; resize the box to change its height. In the property panel:
|
|
|
137
137
|
traditional stick figure).
|
|
138
138
|
- **Look**: *Clean*, *Pencil* (hand-drawn strokes that boil, with faint
|
|
139
139
|
construction lines) or *Silhouette*.
|
|
140
|
-
- **Build**: *Standard*, *Slim*, *Kid* (big head), *
|
|
141
|
-
*Stocky*, or set **Head**, **Shoulders
|
|
142
|
-
|
|
143
|
-
every build.
|
|
140
|
+
- **Build**: *Standard*, *Slim*, *Kid* (big head), *Child*, *Toddler*, *Tall*,
|
|
141
|
+
*Short*, *Broad*, *Curvy* or *Stocky*, or set **Head**, **Shoulders**,
|
|
142
|
+
**Hips**, **Legs** and **Arms** with the sliders (the Stick figure has no
|
|
143
|
+
shoulders or hips). Clothes, gags, walks and dances fit every build.
|
|
144
144
|
- **Line**, **Skin**, and **Clothes** (a T-shirt and trousers, with their
|
|
145
145
|
colours, or none).
|
|
146
|
+
- **Head**: **Cast** dresses the character as one of the ready-made cast
|
|
147
|
+
(boy, girl, young man, young woman, man, woman, grandpa, grandma: build,
|
|
148
|
+
hair, facial hair, glasses and clothes in one step); then **Hair** (34
|
|
149
|
+
styles, from buzz cut to twin braids) and its **Hair colour**, **Facial
|
|
150
|
+
hair** (20 styles), **Glasses**, **Hat** and **Ears** change one thing at a
|
|
151
|
+
time. Hair and hats turn with the head in every view (see
|
|
152
|
+
[Character Appearance](character-appearance.md)).
|
|
146
153
|
- **Hands**: *Round*, *Cartoon gloves* (a thumb and three plump fingers), or
|
|
147
154
|
*Natural* (five fingers, best for mudras). Gloves and natural hands take hand
|
|
148
155
|
shapes: dances key them (jazz hands, mudras), and each finger is a track
|
|
@@ -154,7 +161,8 @@ its box; resize the box to change its height. In the property panel:
|
|
|
154
161
|
- **Body**: a pose (standing, waving, pointing, cheering, hands on hips,
|
|
155
162
|
thinking, shrugging, sitting, kneeling, crouching, crawling, lying down).
|
|
156
163
|
Poses that rest on a knee, the hands or the back are set down on the ground.
|
|
157
|
-
- **Face**: an expression (happy, sad, surprised, angry
|
|
164
|
+
- **Face**: an expression (happy, sad, surprised, angry, embarrassed with a
|
|
165
|
+
blush, crying with tears, afraid with a bead of sweat…), or the pose's own.
|
|
158
166
|
|
|
159
167
|
To animate a character, pick a view, a pose and a face, and click
|
|
160
168
|
**◆ Keyframe pose at playhead**. Move the playhead, pick the next pose, and
|
|
@@ -1058,7 +1066,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
1058
1066
|
**Steps to embed:**
|
|
1059
1067
|
1. Build the player: `npm run build:player`
|
|
1060
1068
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
1061
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
1069
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-player.iife.js`
|
|
1062
1070
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
1063
1071
|
3. Copy the generated code into your HTML
|
|
1064
1072
|
4. Adjust the script `src` path if needed
|
package/docs/examples.md
CHANGED
|
@@ -694,7 +694,7 @@ For simple website embedding without a build system.
|
|
|
694
694
|
</html>
|
|
695
695
|
```
|
|
696
696
|
|
|
697
|
-
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
697
|
+
Build the player with `npm run build:player` to generate `lib/player/tinyfly-player.iife.js`, or load it from the CDN: `https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-player.iife.js`.
|
|
698
698
|
|
|
699
699
|
---
|
|
700
700
|
|
package/docs/getting-started.md
CHANGED
|
@@ -185,7 +185,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
185
185
|
```html
|
|
186
186
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
187
187
|
|
|
188
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
188
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
|
|
189
189
|
<script>
|
|
190
190
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
191
191
|
</script>
|
package/docs/gsap-compat.md
CHANGED
|
@@ -74,7 +74,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
74
74
|
global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
75
75
|
|
|
76
76
|
```html
|
|
77
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
77
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
|
|
78
78
|
<script>
|
|
79
79
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
80
80
|
</script>
|
package/docs/llm-guide.md
CHANGED
|
@@ -18,7 +18,8 @@ npx @algorisys/tinyfly capabilities --json # the same as data
|
|
|
18
18
|
It lists the easings, track kinds, every property each canvas shape can
|
|
19
19
|
animate (with units and ranges), the stick figure's joints, poses,
|
|
20
20
|
expressions, gags, gaits, beat actions, dances, flips and hand shapes, the v2
|
|
21
|
-
character's poses,
|
|
21
|
+
character's poses, expressions, builds, hairstyles, facial hair, glasses,
|
|
22
|
+
hats and cast, the code panel's languages, every surface's anchors and
|
|
22
23
|
edits (code panel, whiteboard, chart), camera shots and the teaching
|
|
23
24
|
helpers. It is generated from the code, so it can't
|
|
24
25
|
fall behind: **a name in it is accepted, and a name not in it is rejected.**
|
|
@@ -44,6 +45,21 @@ Characters in a 3D scene walk the same way with `characterScript3D`
|
|
|
44
45
|
(`{ do: 'walk', to: [x, z] }`, `pose`, `gag`, `face`, `place`); a rider is
|
|
45
46
|
seated with `propRide3D` and spliced into its script with `spliceTracks`. See `docs/props.md`.
|
|
46
47
|
|
|
48
|
+
## Characters with a look
|
|
49
|
+
|
|
50
|
+
A v2 character's appearance is plain options to `character()`, never drawing
|
|
51
|
+
code: `build` (`child`, `tall`, `short`…), `hair` (a style name, or
|
|
52
|
+
`{ style, color, length, … }`), `facialHair`, `glasses`, `hat`, `ears: true`
|
|
53
|
+
and `outfit: { shirt, trousers }`. `castMember('grandpa', 300)` gives a whole
|
|
54
|
+
ready-made character to start from. Expressions come from `HUMAN_EXPRESSIONS`
|
|
55
|
+
and are pose fields, as are the face marks `blush`, `tears` and `sweat` (0–1),
|
|
56
|
+
so any face goes with any action or view. Hair and hats turn with the head:
|
|
57
|
+
don't draw a different hairstyle per view. Put things in hands with `holding`
|
|
58
|
+
(`{ right: 'mug' }`, `{ both: 'parcel' }`; the pose field `held.both` lets go),
|
|
59
|
+
and for two characters touching use `meetHands('handshake', a, b)` with the
|
|
60
|
+
two standing `meetingSpacing(…)` apart, never two separate clips. See
|
|
61
|
+
`docs/character-appearance.md`.
|
|
62
|
+
|
|
47
63
|
## Surfaces
|
|
48
64
|
|
|
49
65
|
Code panels (`codePanel()`), whiteboards (`whiteboard()`), charts
|
|
@@ -128,6 +144,10 @@ Fix, render again.
|
|
|
128
144
|
figure's `ground` (a house's `anchor:doorstep`).
|
|
129
145
|
- **Angles are degrees.** Stick-figure arms: 0 hangs down, 90 straight out,
|
|
130
146
|
180 straight up; in profile the left arm's forward is negative.
|
|
147
|
+
- **A character's look is data, and names are checked.** `hair: 'bob'`, not
|
|
148
|
+
a drawing in `layers`; a style name not in the catalog throws (`hair:
|
|
149
|
+
unknown style`). Side names (`at: 'left'`, `arm.left`) are the character's
|
|
150
|
+
own: from the front its left is on screen right.
|
|
131
151
|
- **Aim beats at anchors, not guessed numbers**: `code.line(7)`,
|
|
132
152
|
`code.token(3, 'var')`, `code.spot(2, 8, 4)`, `piece.home`.
|
|
133
153
|
- **Key reactions to contact times.** Beats that touch something report
|
package/docs/maps.md
CHANGED
|
@@ -14,8 +14,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
14
14
|
adds to the same `tinyfly` global:
|
|
15
15
|
|
|
16
16
|
```html
|
|
17
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
18
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
17
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-maps.iife.js"></script>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
It is a separate script because the offline world map it carries adds about
|
package/docs/props.md
CHANGED
|
@@ -109,11 +109,11 @@ one probably meant, and `propScript` throws on them.
|
|
|
109
109
|
| `house()` | `door` (`open`), `lights` (`on`), `smoke` (`for`, runs in the background), `shake` |
|
|
110
110
|
| `helicopter()` | `takeOff` (`height`), `fly` (`to`, `height`), `hover`, `land` |
|
|
111
111
|
| `airplane()` | `takeOff` (`to`, `height`), `fly` (`to`, `height`), `loop`, `land` (`to`) |
|
|
112
|
-
| `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `jump`, `nod`, `swish` |
|
|
113
|
-
| `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `jump`, `nod`, `swish` |
|
|
114
|
-
| `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `jump`, `nod`, `swish` |
|
|
115
|
-
| `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `jump`, `nod`, `swish` |
|
|
116
|
-
| `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
|
|
112
|
+
| `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
113
|
+
| `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
114
|
+
| `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
115
|
+
| `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
|
|
116
|
+
| `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `glide` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
|
|
117
117
|
| `chicken()` | `walk` (`to`), `peck`, `flap`, `flutter`, `cluck` (it cannot fly) |
|
|
118
118
|
|
|
119
119
|
**Line art.** `propTarget({ …, style: 'stick' })` (or `drawSolvedProp(…, { style: 'stick' })`)
|
|
@@ -138,7 +138,9 @@ and while `flapping` is on, the rig's `derive` beats them from a phase,
|
|
|
138
138
|
a second, a crow four). Its head pecks from a neck joint (`peck`; a chicken's
|
|
139
139
|
neck stretches down to reach), and it walks with its head bobbing or hops.
|
|
140
140
|
`fly` takes off with a crouch and a leap (no crouch if it is already in the
|
|
141
|
-
air) and flies to `height` metres; `
|
|
141
|
+
air) and flies to `height` metres; `glide` holds the wings out still and sinks
|
|
142
|
+
gently toward `height` on the way to `to` (from the ground it flies the first
|
|
143
|
+
stretch); `land` comes down to the ground or to a
|
|
142
144
|
perch (`height`). Perch it with anchors:
|
|
143
145
|
|
|
144
146
|
```js
|
package/docs/teaching.md
CHANGED
|
@@ -25,7 +25,7 @@ path for all of that:
|
|
|
25
25
|
</figure>
|
|
26
26
|
|
|
27
27
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
28
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|