@algorisys/tinyfly 0.95.0 → 0.97.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 +5 -5
- package/docs/acting.md +165 -0
- package/docs/editor-guide.md +1 -1
- 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 +24 -2
- package/docs/maps.md +2 -2
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +4517 -3582
- package/lib/browser/tinyfly.iife.js +16 -14
- package/lib/browser/tinyfly.js +5788 -4853
- package/lib/browser/tinyfly.umd.js +16 -14
- package/lib/types/characters/acting/index.d.ts +1 -0
- package/lib/types/characters/acting/surface-script.d.ts +92 -0
- package/lib/types/characters/capabilities.d.ts +5 -0
- package/lib/types/characters/chart.d.ts +108 -0
- package/lib/types/characters/code-panel.d.ts +21 -46
- package/lib/types/characters/index.d.ts +3 -0
- package/lib/types/characters/props/index.d.ts +1 -0
- package/lib/types/characters/props/prop-surface.d.ts +63 -0
- package/lib/types/characters/surface/edit-log.d.ts +47 -0
- package/lib/types/characters/surface/index.d.ts +11 -0
- package/lib/types/characters/surface/pieces.d.ts +61 -0
- package/lib/types/characters/surface/ride.d.ts +31 -0
- package/lib/types/characters/surface/surface-box.d.ts +18 -0
- package/lib/types/characters/surface/surface.d.ts +79 -0
- package/lib/types/characters/whiteboard.d.ts +131 -0
- package/llms-full.txt +279 -10
- package/llms.txt +28 -28
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +29 -9
package/README.md
CHANGED
|
@@ -61,7 +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). A line of action (`bend`) curves the spine, and gaits have personality (bouncy, double bounce, sneak, strut, tired, run). Lip-sync works from text, Latin or Devanagari. `scriptTracks()` compiles a story written as beats (`{ do: 'walk', to: 640 }`, `{ do: 'take' }`, `{ do: 'say', say: '…' }`) into all of it. `cameraTracks()` films it with push-ins, cuts, shakes and follows. The cartoon zip (`{ do: 'zip' }`) has the legs wheel in place before it is gone. Figures can act on code, Animator vs Animation style: `codePanel()` lays a listing out so every line and word is a place in the scene, and beats leap onto lines, point at them and swipe them away (`{ do: 'swipe', target: code.line(7) }`), with the line wiped, knocked off the panel or blurred out of focus on the frames the hand crosses it. Words come loose too: a figure grabs `var` and throws it, kicks another out of a loop, carries a stray `;` to where it belongs, pushes a word along its line (the text closing up behind it), and writes `mut` into a line by hand. A figure standing on a line rides it when a gap above closes (`code.ride()`). Props give the story a world: cars, trucks, buses, tractors, carts, train carriages, bikes, motorbikes, trees, houses, a helicopter and a plane, a horse, dogs, cats, cows and birds are 3D rigs drawn with the figures' pens, so they turn toward the camera and boil in pencil, or as line art beside stick figures. They act from beats through the same principles (they rock back before they go, dip on the stop, skid, bump, sway, take off and loop; animals walk, trot and gallop with their feet keeping pace, sit and jump; birds hop, peck, flap and fly up to a perch), with an exaggeration dial, and figures can ride them. See [docs/props.md](docs/props.md). Your own behaviours are plain values: `defineAction()` (from beats or timed pose steps), `defineGait()`, and `persona()` for a recurring character's look, acting style, gait, usual face and stance. In the editor, a Character's **Acting** section acts its keyed poses in a style and adds gags, walks in a gait and lip-synced lines, with drawing on twos as a timeline setting. Characters come in builds (slim, kid, broad, curvy, stocky), and the v2 human has its own line of action, gaits and gags, posed in 3D so they read from every view. 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
|
+
- **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). A line of action (`bend`) curves the spine, and gaits have personality (bouncy, double bounce, sneak, strut, tired, run). Lip-sync works from text, Latin or Devanagari. `scriptTracks()` compiles a story written as beats (`{ do: 'walk', to: 640 }`, `{ do: 'take' }`, `{ do: 'say', say: '…' }`) into all of it. `cameraTracks()` films it with push-ins, cuts, shakes and follows. The cartoon zip (`{ do: 'zip' }`) has the legs wheel in place before it is gone. Figures can act on code, Animator vs Animation style: `codePanel()` lays a listing out so every line and word is a place in the scene, and beats leap onto lines, point at them and swipe them away (`{ do: 'swipe', target: code.line(7) }`), with the line wiped, knocked off the panel or blurred out of focus on the frames the hand crosses it. Words come loose too: a figure grabs `var` and throws it, kicks another out of a loop, carries a stray `;` to where it belongs, pushes a word along its line (the text closing up behind it), and writes `mut` into a line by hand. A figure standing on a line rides it when a gap above closes (`code.ride()`). Code is one *surface*; `whiteboard()` is another, a board or chalkboard of texts and hand-drawn circles, boxes, underlines and arrows, so a figure can work through a lesson that is not code, `chart()` a third, bar and line charts whose bars a figure points at, highlights and stands on as they grow, and `propSurface()` makes any prop one, so a figure opens a car's door or switches a house's lights on. Places on a surface have names (`line:7`, `token:4:Println`, `term:eq:+ 4`), and `surfaceScript()` takes a whole scene as JSON: beats aim at named places and say what the surface does in answer, at the moment the hand touches or lets go. Props give the story a world: cars, trucks, buses, tractors, carts, train carriages, bikes, motorbikes, trees, houses, a helicopter and a plane, a horse, dogs, cats, cows and birds are 3D rigs drawn with the figures' pens, so they turn toward the camera and boil in pencil, or as line art beside stick figures. They act from beats through the same principles (they rock back before they go, dip on the stop, skid, bump, sway, take off and loop; animals walk, trot and gallop with their feet keeping pace, sit and jump; birds hop, peck, flap and fly up to a perch), with an exaggeration dial, and figures can ride them. See [docs/props.md](docs/props.md). Your own behaviours are plain values: `defineAction()` (from beats or timed pose steps), `defineGait()`, and `persona()` for a recurring character's look, acting style, gait, usual face and stance. In the editor, a Character's **Acting** section acts its keyed poses in a style and adds gags, walks in a gait and lip-synced lines, with drawing on twos as a timeline setting. Characters come in builds (slim, kid, broad, curvy, stocky), and the v2 human has its own line of action, gaits and gags, posed in 3D so they read from every view. 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)
|
|
65
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
|
|
66
66
|
- **Captions** - `toSRT()` / `toWebVTT()` from narration cues or from a timeline's markers
|
|
67
67
|
|
|
@@ -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.97.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.97.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.97.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.97.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
485
485
|
```
|
|
486
486
|
|
|
487
487
|
### Audio / Video Sync
|
package/docs/acting.md
CHANGED
|
@@ -437,6 +437,171 @@ writes them out as one track per prop (`line.N.highlight`, `line.N.strike`,
|
|
|
437
437
|
keyword lists for Go, Rust, C#, JavaScript, TypeScript and Python (strings,
|
|
438
438
|
numbers and line comments too); `plain` leaves the text uncoloured.
|
|
439
439
|
|
|
440
|
+
### Places and edits by name
|
|
441
|
+
|
|
442
|
+
A code panel is a *surface*: every place on it has a name, so a scene can be
|
|
443
|
+
written as plain data. `anchor(name)` gives the box there, `piece(name)` the
|
|
444
|
+
word there, and `edit(name, anchor, options)` does the same as the methods
|
|
445
|
+
above:
|
|
446
|
+
|
|
447
|
+
```js
|
|
448
|
+
code.anchor('line:7') // = code.line(7)
|
|
449
|
+
code.anchor('token:4:Println') // = code.token(4, 'Println'); token:4#2:x is the second x
|
|
450
|
+
code.anchor('spot:3:4') // = code.spot(3, 4)
|
|
451
|
+
|
|
452
|
+
code.edit('highlight', ['line:2', 'line:3'], { at: 100 })
|
|
453
|
+
code.edit('fling', 'token:4:Println', { at: grab.release })
|
|
454
|
+
code.edit('drop', 'token:1:int', { at: 1600, into: 'spot:3:2' })
|
|
455
|
+
code.edit('move', 'token:4:fmt.', { at: 600, to: 'box' })
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
A wrong name says what it meant (`Unknown anchor "lin": did you mean "line"?`),
|
|
459
|
+
and an edit given the wrong kind of place says which kind it takes. The
|
|
460
|
+
anchors and edits are listed under "Surfaces" in `capabilities()`. Boards,
|
|
461
|
+
charts and props that change state are planned as surfaces that work the
|
|
462
|
+
same way.
|
|
463
|
+
|
|
464
|
+
### A whole scene as data
|
|
465
|
+
|
|
466
|
+
`surfaceScript()` takes beats that name places and say what the surface does
|
|
467
|
+
in answer, so the reactions above need no wiring by hand. A beat's `target`,
|
|
468
|
+
`to` and `onto` can be a place (`{ surface, anchor }`: its box, its centre x,
|
|
469
|
+
its top), and `then` holds the surface's cues, each at a moment of the beat:
|
|
470
|
+
|
|
471
|
+
```js
|
|
472
|
+
const result = surfaceScript('hero', { code }, [
|
|
473
|
+
{ do: 'leap', to: 300, onto: { surface: 'code', anchor: 'line:5' } },
|
|
474
|
+
{ do: 'grab', target: { surface: 'code', anchor: 'token:4:Println' },
|
|
475
|
+
then: { surface: 'code', edit: 'carry', anchor: 'token:4:Println', until: { beat: 2, at: 'release' } } },
|
|
476
|
+
{ do: 'throw', to: 700,
|
|
477
|
+
then: { surface: 'code', edit: 'fling', anchor: 'token:4:Println', at: 'release' } },
|
|
478
|
+
{ do: 'swipe', target: { surface: 'code', anchor: 'line:2' },
|
|
479
|
+
then: { surface: 'code', edit: 'remove', anchor: 'line:2', style: 'blur', duration: 600 } },
|
|
480
|
+
], { from: 600, ground: code.box.bottom, height: 100 })
|
|
481
|
+
|
|
482
|
+
const timeline = deserializeTimeline({ id: 'scene', tracks: result.tracks })
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
A cue's `at` is `start`, `contact`, `release` or `end` (default: the beat's
|
|
486
|
+
contact, or its start when it has none). `until` ends it at a moment of the
|
|
487
|
+
same beat or of a later one (`{ beat: 2, at: 'release' }`) and sets the
|
|
488
|
+
edit's duration. Every other field is the edit's own option (`text`, `into`,
|
|
489
|
+
`style`, `on`). `carry` is the one cue that is not a surface edit: the piece
|
|
490
|
+
follows the figure's hand (`handPath`) until `until`; pass `figureStyle` when
|
|
491
|
+
the figure is drawn with more than a `height`.
|
|
492
|
+
|
|
493
|
+
It does what the hand-wired version does, in the same order: the beats go to
|
|
494
|
+
`scriptTracks` with places swapped for their boxes as laid out, each cue runs
|
|
495
|
+
`surface.edit()` in beat order, and the figure rides the surfaces it stands
|
|
496
|
+
on (`ride: false` turns that off). The Code Tidy demo written this way gives
|
|
497
|
+
the same tracks, key for key. `result.tracks` holds the figure's tracks and
|
|
498
|
+
every surface's (named by its key in `{ code }`); `checkSurfaceBeats(beats, surfaces)`
|
|
499
|
+
lists the problems without compiling.
|
|
500
|
+
|
|
501
|
+
### Whiteboards
|
|
502
|
+
|
|
503
|
+
`whiteboard()` is a second surface, for lessons that are not code: a board
|
|
504
|
+
(or `theme: 'chalkboard'`) whose texts and hand-drawn marks are declared as
|
|
505
|
+
data, each with an id, and named as places like a code panel's lines:
|
|
506
|
+
|
|
507
|
+
```js
|
|
508
|
+
const board = whiteboard({
|
|
509
|
+
x: 20, y: 20, width: 470, height: 300, theme: 'chalkboard', fontSize: 30,
|
|
510
|
+
items: [
|
|
511
|
+
{ id: 'eq', text: '2x + 4 = 12', at: [40, 30] },
|
|
512
|
+
{ id: 'move', text: '2x = 12 - 4', at: [40, 100], hidden: true },
|
|
513
|
+
{ id: 'ring', mark: 'circle', around: 'term:eq:+ 4', hidden: true },
|
|
514
|
+
{ id: 'across', mark: 'arrow', from: 'mark:ring', to: 'term:move:- 4', color: 'orange', hidden: true },
|
|
515
|
+
],
|
|
516
|
+
})
|
|
517
|
+
|
|
518
|
+
surfaceScript('teacher', { board }, [
|
|
519
|
+
{ do: 'point', target: { surface: 'board', anchor: 'term:eq:+ 4' },
|
|
520
|
+
then: { surface: 'board', edit: 'draw', anchor: 'mark:ring', until: 'end' } },
|
|
521
|
+
{ do: 'write', target: { surface: 'board', anchor: 'text:move' },
|
|
522
|
+
then: { surface: 'board', edit: 'write', anchor: 'text:move', until: 'release' } },
|
|
523
|
+
], { from: 640, ground: 400, height: 190, facing: -1 })
|
|
524
|
+
```
|
|
525
|
+
|
|
526
|
+
Its places are `box`, `text:ID`, `term:ID:TEXT` (part of a text; `term:ID#K:TEXT`
|
|
527
|
+
for the Kth) and `mark:ID`. Marks are `circle`, `box`, `underline` (each
|
|
528
|
+
`around` a place) and `arrow` (`from` one place `to` another), and can only
|
|
529
|
+
name items declared before them. Its edits: `write` (a hidden text, by hand;
|
|
530
|
+
or new `text` into a term's place), `draw` (a hidden mark), `erase`, `strike`,
|
|
531
|
+
and `move` and `fling` for a term, which comes loose as a piece (`carry` works
|
|
532
|
+
too). Text is laid out in fixed-width cells, never measured, and each mark's
|
|
533
|
+
wobble comes from a seed made of its id, so a board is drawn the same
|
|
534
|
+
everywhere. Colours are theme names (`red`, `blue`, `green`, `orange`, and
|
|
535
|
+
`yellow` on chalk) or any CSS colour. The Board Lesson demo solves an
|
|
536
|
+
equation this way.
|
|
537
|
+
|
|
538
|
+
### Charts
|
|
539
|
+
|
|
540
|
+
`chart()` is a surface for talking through data: a bar or line chart whose
|
|
541
|
+
values are declared as data, scaled once when it is made (`max`, or a round
|
|
542
|
+
number above the largest value).
|
|
543
|
+
|
|
544
|
+
```js
|
|
545
|
+
const sales = chart({
|
|
546
|
+
x: 20, y: 20, width: 480, height: 340, kind: 'bar', theme: 'dark', title: 'Sales', max: 100, suffix: 'k',
|
|
547
|
+
data: [
|
|
548
|
+
{ id: 'q3', label: 'Q3', value: 30 },
|
|
549
|
+
{ id: 'q4', label: 'Q4', value: 20 },
|
|
550
|
+
],
|
|
551
|
+
})
|
|
552
|
+
|
|
553
|
+
surfaceScript('hero', { sales }, [
|
|
554
|
+
{ do: 'point', target: { surface: 'sales', anchor: 'bar:q3' },
|
|
555
|
+
then: { surface: 'sales', edit: 'highlight', anchor: 'bar:q3' } },
|
|
556
|
+
{ do: 'leap', to: { surface: 'sales', anchor: 'bar:q4' }, onto: { surface: 'sales', anchor: 'bar:q4' } },
|
|
557
|
+
{ do: 'cheer', for: 1600,
|
|
558
|
+
then: { surface: 'sales', edit: 'set', anchor: 'bar:q4', value: 85, at: 'start', until: 'end' } },
|
|
559
|
+
], { from: 640, ground: 400, height: 90, facing: -1 })
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
Its places are `bar:ID` (on a bar chart) or `point:ID` (on a line chart),
|
|
563
|
+
`label:ID`, `value:ID` and `box`, and they follow the values:
|
|
564
|
+
`sales.anchor('bar:q4', time)` is the bar as it stands then. Its edits:
|
|
565
|
+
`set` (a new `value`; the value label counts along), `show` (grow a
|
|
566
|
+
`hidden` bar in from the axis, or draw the line out to a point; `on: false`
|
|
567
|
+
takes it back) and `highlight`. A bar's top is a floor: a figure standing on
|
|
568
|
+
it is carried up and down as it grows and shrinks, as in the Chart Talk demo.
|
|
569
|
+
|
|
570
|
+
### Props as surfaces
|
|
571
|
+
|
|
572
|
+
A prop's controls are state a figure can change: `propSurface(propTarget(…))`
|
|
573
|
+
makes a car, a house or a tree a surface. Its places are `anchor:NAME` (the
|
|
574
|
+
rig's anchors: `door`, `doorstep`, `seat`, `branch`…), `part:ID` (one part as
|
|
575
|
+
seen: `window-1`, `wheel-0-left`), `control:NAME` (where the parts a control
|
|
576
|
+
moves or lights are) and `box`. Its edits are `set` (a control to a `value`)
|
|
577
|
+
and `switch` (a control to its full value, open or on, or back to rest with
|
|
578
|
+
`on: false`).
|
|
579
|
+
|
|
580
|
+
```js
|
|
581
|
+
const home = propTarget({ x: 430, y: 320, prop: house(), values: { turn: 0.25 } })
|
|
582
|
+
const homeSurface = propSurface(home)
|
|
583
|
+
const floor = homeSurface.anchor('anchor:doorstep').y
|
|
584
|
+
|
|
585
|
+
surfaceScript('hero', { home: homeSurface }, [
|
|
586
|
+
{ do: 'walk', to: homeSurface.anchor('anchor:door').x - 70 },
|
|
587
|
+
{ do: 'grab', target: { surface: 'home', anchor: 'anchor:door' },
|
|
588
|
+
then: { surface: 'home', edit: 'switch', anchor: 'control:door', until: 'end' } },
|
|
589
|
+
{ do: 'point', target: { surface: 'home', anchor: 'part:window-1' },
|
|
590
|
+
then: { surface: 'home', edit: 'switch', anchor: 'control:lights' } },
|
|
591
|
+
], { from: 40, ground: floor, height: 100 })
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
A prop stands on its middle, and seen from a little above its front comes
|
|
595
|
+
forward of that line. A figure that walks on the prop's own `y` is inside
|
|
596
|
+
its footprint and seems to walk through the wall; walk it on the prop's
|
|
597
|
+
front line instead (a house's `doorstep`, as above). Places are worked out
|
|
598
|
+
from the prop's values at a time, so they follow a door as it swings; pass
|
|
599
|
+
the prop's own script as `propSurface(target, { tracks })` and they follow
|
|
600
|
+
it as it drives off. Do not key a control both in its own script and here.
|
|
601
|
+
A part turned away from the viewer has no place on screen (a car's
|
|
602
|
+
headlights in profile); the error names the anchors to aim at instead. The
|
|
603
|
+
Home Time demo is this scene.
|
|
604
|
+
|
|
440
605
|
## Camera
|
|
441
606
|
|
|
442
607
|
Video scenes can be seen through a camera: `camera: true` reads the tracks of
|
package/docs/editor-guide.md
CHANGED
|
@@ -1058,7 +1058,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
1058
1058
|
**Steps to embed:**
|
|
1059
1059
|
1. Build the player: `npm run build:player`
|
|
1060
1060
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
1061
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
1061
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.97.0/cdn/tinyfly-player.iife.js`
|
|
1062
1062
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
1063
1063
|
3. Copy the generated code into your HTML
|
|
1064
1064
|
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.97.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.97.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.97.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,8 +18,9 @@ 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, the code panel's languages, anchors and
|
|
22
|
-
|
|
21
|
+
character's poses, the code panel's languages, every surface's anchors and
|
|
22
|
+
edits (code panel, whiteboard, chart), camera shots and the teaching
|
|
23
|
+
helpers. It is generated from the code, so it can't
|
|
23
24
|
fall behind: **a name in it is accepted, and a name not in it is rejected.**
|
|
24
25
|
It is also the last part of `llms-full.txt`.
|
|
25
26
|
|
|
@@ -43,6 +44,19 @@ Characters in a 3D scene walk the same way with `characterScript3D`
|
|
|
43
44
|
(`{ do: 'walk', to: [x, z] }`, `pose`, `gag`, `face`, `place`); a rider is
|
|
44
45
|
seated with `propRide3D` and spliced into its script with `spliceTracks`. See `docs/props.md`.
|
|
45
46
|
|
|
47
|
+
## Surfaces
|
|
48
|
+
|
|
49
|
+
Code panels (`codePanel()`), whiteboards (`whiteboard()`), charts
|
|
50
|
+
(`chart()`) and props (`propSurface(propTarget(…))`) are surfaces: their places have names (`line:7`,
|
|
51
|
+
`token:4:Println`, `text:eq`, `term:eq:+ 4`, `bar:q4`) and their edits are
|
|
52
|
+
called by name (`surface.edit('highlight', 'line:4', { at })`). Write a scene
|
|
53
|
+
on one with `surfaceScript()`: beats aim at `{ surface, anchor }` and say what
|
|
54
|
+
the surface does in answer with `then`, at a moment of the beat (`at:
|
|
55
|
+
'contact'`, `'release'`…). A whiteboard's texts and marks and a chart's data
|
|
56
|
+
are declared up front, each with an id the places use. The catalog lists each
|
|
57
|
+
surface's places and edits. See "A whole scene as data", "Whiteboards" and
|
|
58
|
+
"Charts" in `docs/acting.md`.
|
|
59
|
+
|
|
46
60
|
## Your own behaviours
|
|
47
61
|
|
|
48
62
|
Write new actions with `defineAction()` (from beats, or as timed pose steps),
|
|
@@ -109,6 +123,9 @@ Fix, render again.
|
|
|
109
123
|
positions. A beat script's `to` is a scene x, and its tracks are offsets
|
|
110
124
|
from `from` (and `ground` for y).
|
|
111
125
|
- **Scene y grows downward.** A floor higher up the screen has a smaller y.
|
|
126
|
+
- **Walk figures in front of props, not through them.** A prop stands on its
|
|
127
|
+
middle; its front comes forward of that. Use its front line as the
|
|
128
|
+
figure's `ground` (a house's `anchor:doorstep`).
|
|
112
129
|
- **Angles are degrees.** Stick-figure arms: 0 hangs down, 90 straight out,
|
|
113
130
|
180 straight up; in profile the left arm's forward is negative.
|
|
114
131
|
- **Aim beats at anchors, not guessed numbers**: `code.line(7)`,
|
|
@@ -117,6 +134,11 @@ Fix, render again.
|
|
|
117
134
|
`result.beats[i].contact` (and `release`): wipe the line, fling the word or
|
|
118
135
|
type the text at those times.
|
|
119
136
|
- **Record panel edits before `code.ride()`**, which reads the moves they make.
|
|
137
|
+
- **Or write it all as data with `surfaceScript`**: name places
|
|
138
|
+
(`target: { surface: 'code', anchor: 'token:3:var' }`) and put the surface's
|
|
139
|
+
answer on the beat (`then: { surface: 'code', edit: 'fling', anchor: 'token:3:var', at: 'release' }`).
|
|
140
|
+
A cue's `at` is a moment name (`start`, `contact`, `release`, `end`), never
|
|
141
|
+
ms. It records the edits and rides the lines for you, in beat order.
|
|
120
142
|
|
|
121
143
|
## Set up your assistant
|
|
122
144
|
|
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.97.0/cdn/tinyfly.iife.js"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.97.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/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.97.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
|