@algorisys/tinyfly 0.125.0 → 0.127.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 +12 -4
- package/docs/cosmic-explainer.md +129 -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 +11 -0
- package/docs/maps.md +2 -2
- package/docs/math.md +1 -1
- package/docs/props.md +5 -1
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +3145 -2893
- package/lib/browser/tinyfly.iife.js +15 -15
- package/lib/browser/tinyfly.js +7688 -7436
- package/lib/browser/tinyfly.umd.js +15 -15
- package/lib/headless/headless.js +172 -49
- package/lib/types/characters/capabilities.d.ts +9 -0
- package/lib/types/characters/cosmic/captions.d.ts +68 -0
- package/lib/types/characters/cosmic/cosmic-kit.d.ts +35 -0
- package/lib/types/characters/cosmic/cosmic-utils.d.ts +26 -0
- package/lib/types/characters/cosmic/index.d.ts +13 -0
- package/lib/types/characters/cosmic/shapes.d.ts +61 -0
- package/lib/types/characters/cosmic/sky.d.ts +78 -0
- package/lib/types/characters/cosmic/zoom.d.ts +66 -0
- package/lib/types/characters/index.d.ts +1 -0
- package/lib/types/characters/props/families/environment.d.ts +7 -1
- package/lib/types/headless/index.d.ts +1 -0
- package/lib/types/headless/node-audio.d.ts +5 -2
- package/lib/types/headless/sound-effects.d.ts +36 -0
- package/llms-full.txt +186 -11
- package/llms.txt +33 -32
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +10 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zooming through scale: the signature science-explainer move (a hand →
|
|
3
|
+
* skin → cells → molecules → one atom). The levels are drawings, each
|
|
4
|
+
* `factor` times smaller than the one before; one number, the depth, drives
|
|
5
|
+
* them all. Level k is drawn at scale `factor ** (depth - k)` inside a
|
|
6
|
+
* circular portal centred on the screen, so the next level opens as a window
|
|
7
|
+
* in the middle of the current one and grows until it fills the frame. A
|
|
8
|
+
* level whose portal covers the frame stops drawing the levels behind it.
|
|
9
|
+
*
|
|
10
|
+
* Every function is pure: give it the time, it gives the same picture.
|
|
11
|
+
*/
|
|
12
|
+
/** A key on a zoom or depth curve: a time (ms) and a value. */
|
|
13
|
+
export interface ZoomKey {
|
|
14
|
+
time: number;
|
|
15
|
+
value: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A zoom factor at `time`, interpolated in log space with an ease between
|
|
19
|
+
* keys (values must be > 0). Log space is what makes a dive feel steady: from
|
|
20
|
+
* 1x to 1000x, each tenfold step takes the same time.
|
|
21
|
+
*/
|
|
22
|
+
export declare function zoomAt(time: number, keys: ReadonlyArray<ZoomKey>): number;
|
|
23
|
+
/** A depth (any number, e.g. 0 = the first level, 4 = the fifth) at `time`, eased between keys. */
|
|
24
|
+
export declare function depthAt(time: number, keys: ReadonlyArray<ZoomKey>): number;
|
|
25
|
+
/** Draws one level at scale 1, centred on the zoom centre, in its own coordinates. */
|
|
26
|
+
export type ZoomLevel = (ctx: CanvasRenderingContext2D, time: number) => void;
|
|
27
|
+
export interface ZoomLevelsOptions {
|
|
28
|
+
/** The frame, px */
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
/** The current depth: 0 shows level 0 at scale 1; 1.35 shows level 1 filling the frame */
|
|
32
|
+
depth: number;
|
|
33
|
+
/** One drawing per level, outermost first */
|
|
34
|
+
levels: ReadonlyArray<ZoomLevel>;
|
|
35
|
+
/** How many times smaller each level is than the one before (default 14) */
|
|
36
|
+
factor?: number;
|
|
37
|
+
/** The zoom centre, px (default the middle of the frame) */
|
|
38
|
+
center?: {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
};
|
|
42
|
+
/** A level's portal radius at scale 1, px (default 520) */
|
|
43
|
+
portalRadius?: number;
|
|
44
|
+
/** Portal rim colour, or null for none (default white) */
|
|
45
|
+
rim?: string | null;
|
|
46
|
+
/** Rim width, px (default 5) */
|
|
47
|
+
rimWidth?: number;
|
|
48
|
+
}
|
|
49
|
+
/** Which levels are drawn at a depth and at what scale and portal radius (for tests and custom drawing). */
|
|
50
|
+
export declare function zoomLevelLayout(options: Omit<ZoomLevelsOptions, 'levels'> & {
|
|
51
|
+
levelCount: number;
|
|
52
|
+
}): Array<{
|
|
53
|
+
level: number;
|
|
54
|
+
scale: number;
|
|
55
|
+
portal: number;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* Draw the levels for a depth: the outermost visible one full-frame, the
|
|
59
|
+
* deeper ones in growing portals at the centre. Each level draws itself at
|
|
60
|
+
* scale 1 around `center`; the zoom is applied for it.
|
|
61
|
+
*/
|
|
62
|
+
export declare function drawZoomLevels(ctx: CanvasRenderingContext2D, time: number, options: ZoomLevelsOptions): void;
|
|
63
|
+
/** A glowing ring (a portal's rim, a lens edge): a wide faint stroke under a crisp one. */
|
|
64
|
+
export declare function drawPortalRim(ctx: CanvasRenderingContext2D, x: number, y: number, radius: number, color?: string, width?: number): void;
|
|
65
|
+
/** How much of a level's chip/label to show at a depth: 1 while it fills the frame, fading out as the next arrives. */
|
|
66
|
+
export declare function levelPresence(depth: number, level: number, settle?: number): number;
|
|
@@ -49,6 +49,7 @@ export { hairFollow, hairFollowTracks, hairMotionAt, type HairFollowSample, type
|
|
|
49
49
|
export * from './hands';
|
|
50
50
|
export * from './acting';
|
|
51
51
|
export * from './noir';
|
|
52
|
+
export * from './cosmic';
|
|
52
53
|
export * from './capabilities';
|
|
53
54
|
export { describeTarget, checkTracks, animatableProperties, CANVAS_PROPERTIES, type PropertyInfo, type TargetAbout, type TargetDescription, type TrackProblem } from '../adapters/canvas/target-properties';
|
|
54
55
|
export * from './props';
|
|
@@ -38,11 +38,17 @@ export interface HouseSpec {
|
|
|
38
38
|
wallHeight?: number;
|
|
39
39
|
roofHeight?: number;
|
|
40
40
|
overhang?: number;
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* The front door: across position of its middle, size, the edge it hangs on as seen from the front
|
|
43
|
+
* (default 'left') and which way it swings (default 'out'). Its handle is on the other edge, so hang it
|
|
44
|
+
* on the side away from where a figure stands to open it.
|
|
45
|
+
*/
|
|
42
46
|
door?: {
|
|
43
47
|
at?: number;
|
|
44
48
|
width?: number;
|
|
45
49
|
height?: number;
|
|
50
|
+
hinge?: 'left' | 'right';
|
|
51
|
+
opens?: 'out' | 'in';
|
|
46
52
|
};
|
|
47
53
|
/** Front windows: across position of the middle, height of the bottom, size */
|
|
48
54
|
windows?: Array<{
|
|
@@ -12,4 +12,5 @@ export * from './node-audio';
|
|
|
12
12
|
export * from './loop-check';
|
|
13
13
|
export * from './loop-audio';
|
|
14
14
|
export * from './audio-mix';
|
|
15
|
+
export * from './sound-effects';
|
|
15
16
|
export { toSRT, toWebVTT, captionCuesFromTimeline, type CaptionCue } from '../engine/export/captions';
|
|
@@ -60,10 +60,13 @@ export interface CutAudioToLoopOptions {
|
|
|
60
60
|
* shorter), and write the WAV to pass as the scene's `audio`.
|
|
61
61
|
*/
|
|
62
62
|
export declare function cutAudioToLoop(file: string, options: CutAudioToLoopOptions): Promise<string>;
|
|
63
|
-
export
|
|
63
|
+
export type MixFileLayer = Omit<MixLayer, 'samples'> & ({
|
|
64
64
|
/** The audio file, relative to `baseDir` (any format ffmpeg reads) */
|
|
65
65
|
file: string;
|
|
66
|
-
}
|
|
66
|
+
} | {
|
|
67
|
+
/** Samples already made at the mix's sample rate (e.g. soundPop(48000)) */
|
|
68
|
+
samples: Float32Array;
|
|
69
|
+
});
|
|
67
70
|
export interface RenderMixOptions extends Omit<MixOptions, 'sampleRate'> {
|
|
68
71
|
/** WAV file to write, relative to `baseDir` */
|
|
69
72
|
output: string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** A filtered-noise swell for zooms, cuts and things flying past; `rise` sweeps up (false: down). */
|
|
2
|
+
export declare function soundWhoosh(sampleRate: number, options?: {
|
|
3
|
+
duration?: number;
|
|
4
|
+
rise?: boolean;
|
|
5
|
+
seed?: number;
|
|
6
|
+
}): Float32Array;
|
|
7
|
+
/** A short pitched blip for things appearing (chips, labels). */
|
|
8
|
+
export declare function soundPop(sampleRate: number, options?: {
|
|
9
|
+
frequency?: number;
|
|
10
|
+
duration?: number;
|
|
11
|
+
}): Float32Array;
|
|
12
|
+
/** A low hit for impacts, landings and bonks. */
|
|
13
|
+
export declare function soundThud(sampleRate: number, options?: {
|
|
14
|
+
duration?: number;
|
|
15
|
+
seed?: number;
|
|
16
|
+
}): Float32Array;
|
|
17
|
+
/** A bright sparkle for reveals: a few bell partials on a pentatonic-ish set of pitches. */
|
|
18
|
+
export declare function soundShimmer(sampleRate: number, options?: {
|
|
19
|
+
duration?: number;
|
|
20
|
+
seed?: number;
|
|
21
|
+
}): Float32Array;
|
|
22
|
+
/** A tiny click for counters ticking up. */
|
|
23
|
+
export declare function soundTick(sampleRate: number): Float32Array;
|
|
24
|
+
/** A latch snapping shut (a padlock, a switch): two short metallic transients. */
|
|
25
|
+
export declare function soundClick(sampleRate: number, options?: {
|
|
26
|
+
seed?: number;
|
|
27
|
+
}): Float32Array;
|
|
28
|
+
/**
|
|
29
|
+
* A slow ambient drone for under narration (a music bed without music):
|
|
30
|
+
* a soft chord with drifting detune and a breathing level, faded in and out.
|
|
31
|
+
* Mix it low (gain about 0.05 of the voice).
|
|
32
|
+
*/
|
|
33
|
+
export declare function soundPad(sampleRate: number, options: {
|
|
34
|
+
duration: number;
|
|
35
|
+
seed?: number;
|
|
36
|
+
}): Float32Array;
|
package/llms-full.txt
CHANGED
|
@@ -591,7 +591,7 @@ with a GSAP-style call (durations are in seconds here):
|
|
|
591
591
|
```html
|
|
592
592
|
<div class="box" style="width:60px;height:60px;background:#4a9eff"></div>
|
|
593
593
|
|
|
594
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
594
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.127.0/cdn/tinyfly.iife.js"></script>
|
|
595
595
|
<script>
|
|
596
596
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
597
597
|
</script>
|
|
@@ -799,7 +799,7 @@ Without a build step, the all-in-one bundle exposes the same functions on a
|
|
|
799
799
|
global — `tinyfly.to()`, `tinyfly.timeline()` and so on:
|
|
800
800
|
|
|
801
801
|
```html
|
|
802
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
802
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.127.0/cdn/tinyfly.iife.js"></script>
|
|
803
803
|
<script>
|
|
804
804
|
tinyfly.to('.box', { x: 200, duration: 1 })
|
|
805
805
|
</script>
|
|
@@ -2725,7 +2725,7 @@ For simple website embedding without a build system.
|
|
|
2725
2725
|
</html>
|
|
2726
2726
|
```
|
|
2727
2727
|
|
|
2728
|
-
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.
|
|
2728
|
+
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.127.0/cdn/tinyfly-player.iife.js`.
|
|
2729
2729
|
|
|
2730
2730
|
---
|
|
2731
2731
|
|
|
@@ -7079,7 +7079,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
7079
7079
|
**Steps to embed:**
|
|
7080
7080
|
1. Build the player: `npm run build:player`
|
|
7081
7081
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
7082
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
7082
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.127.0/cdn/tinyfly-player.iife.js`
|
|
7083
7083
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
7084
7084
|
3. Copy the generated code into your HTML
|
|
7085
7085
|
4. Adjust the script `src` path if needed
|
|
@@ -8135,7 +8135,11 @@ Make your own from the family generators: `vehicle(spec)` takes:
|
|
|
8135
8135
|
- wheels (any radius; `side: 0` for a bike's middle line; `style: 'spoked'`)
|
|
8136
8136
|
- doors, lights, side windows, frame tubes, an antenna, a seat and extra parts
|
|
8137
8137
|
|
|
8138
|
-
`tree(spec)` and `house(spec)` take sizes and colours.
|
|
8138
|
+
`tree(spec)` and `house(spec)` take sizes and colours. A house's front door
|
|
8139
|
+
hangs on its left edge and swings out unless told otherwise
|
|
8140
|
+
(`house({ door: { hinge: 'right', opens: 'in' } })`); its `handle` anchor is on
|
|
8141
|
+
the free edge, so hang the door on the side away from the figure that opens it
|
|
8142
|
+
and aim the grab at `anchor:handle`.
|
|
8139
8143
|
|
|
8140
8144
|
**Furniture.** `chair()`, `desk()`, `bed()` and `door()` stand on the ground
|
|
8141
8145
|
facing the viewer, and their places are anchors a figure uses them at: a
|
|
@@ -8458,6 +8462,13 @@ lines (`bean: { limbs: 'tube' | 'line' }`), a shaped body (`bean.torso` fullness
|
|
|
8458
8462
|
Household clothes on a bean: `bean: { skirt: '#c2410c' }` (a sari to the ankle) or
|
|
8459
8463
|
`skirt: { color, length: 0.45 }` (a kurta hem; pair it with `trousers`), `drape` (a pallu or dupatta sash)
|
|
8460
8464
|
and `bangles`; preset `beanSari`. The skirt follows the legs (flared standing, along the thighs seated).
|
|
8465
|
+
For science explainers use the cosmic kit (docs/cosmic-explainer.md): `drawSkyGradient` (one sky per scene),
|
|
8466
|
+
`drawDust` and `drawBokeh` (always on; pass the camera `offset`), flat-shaded `drawShadedBall`, `drawIsoCube`,
|
|
8467
|
+
`drawHaze`; a dive through scale with `drawZoomLevels(ctx, time, { width, height, depth: depthAt(time, keys), levels })`
|
|
8468
|
+
(each level function draws itself at scale 1 around the centre; put each level's arrival on the word that names it);
|
|
8469
|
+
burned-in `drawShortCaption(ctx, time, { lines, x, y })` and `drawLabelChip`. Sound effects come from
|
|
8470
|
+
tinyfly/headless (`soundWhoosh`, `soundPop`, `soundThud`, `soundShimmer`, `soundTick`, `soundClick`, `soundPad`)
|
|
8471
|
+
as `renderMix` layers `{ samples, at, gain }`; no files needed.
|
|
8461
8472
|
For detective / noir scenes use the canvas kit (docs/noir-detective.md): `drawRain(ctx, time, box)`,
|
|
8462
8473
|
`drawBlinds`, `drawDarkness(ctx, { amount, cones: [{ x, y, angle /* degrees */, length, width }], holes })`,
|
|
8463
8474
|
`drawGlow`, `drawVignette`, `drawClueMarker(ctx, time, { x, y, at })`, `drawNameCard(ctx, time, { name, role, at, anchor })`,
|
|
@@ -8623,6 +8634,10 @@ Loops chapter of `docs/video-rendering.md`.
|
|
|
8623
8634
|
- **Walk figures in front of props, not through them.** A prop stands on its
|
|
8624
8635
|
middle; its front comes forward of that. Use its front line as the
|
|
8625
8636
|
figure's `ground` (a house's `anchor:doorstep`).
|
|
8637
|
+
- **Open a door from its handle side.** A house's door hangs on its left edge
|
|
8638
|
+
by default; a figure coming from the left opens it from the hinge. Hang it
|
|
8639
|
+
on the far side (`house({ door: { hinge: 'right', opens: 'in' } })`) and aim
|
|
8640
|
+
the grab at `anchor:handle`, not `anchor:door`.
|
|
8626
8641
|
- **Angles are degrees.** Stick-figure arms: 0 hangs down, 90 straight out,
|
|
8627
8642
|
180 straight up; in profile the left arm's forward is negative.
|
|
8628
8643
|
- **A character's look is data, and names are checked.** `hair: 'bob'`, not
|
|
@@ -8726,7 +8741,7 @@ path for all of that:
|
|
|
8726
8741
|
</figure>
|
|
8727
8742
|
|
|
8728
8743
|
<!-- once, anywhere on the page (a site-wide footer is fine) -->
|
|
8729
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
8744
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.127.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
8730
8745
|
```
|
|
8731
8746
|
|
|
8732
8747
|
Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post
|
|
@@ -9312,7 +9327,7 @@ lesson's step options (`duration`, `easing`, `delay`).
|
|
|
9312
9327
|
<figcaption>The determinant is the area of the unit square after the map.</figcaption>
|
|
9313
9328
|
</figure>
|
|
9314
9329
|
|
|
9315
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
9330
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.127.0/cdn/tinyfly-math.iife.js" data-tinyfly-auto></script>
|
|
9316
9331
|
```
|
|
9317
9332
|
|
|
9318
9333
|
The figure draws itself into an SVG and redraws from the timeline whenever the
|
|
@@ -10446,8 +10461,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
|
|
|
10446
10461
|
adds to the same `tinyfly` global:
|
|
10447
10462
|
|
|
10448
10463
|
```html
|
|
10449
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
10450
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
10464
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.127.0/cdn/tinyfly.iife.js"></script>
|
|
10465
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.127.0/cdn/tinyfly-maps.iife.js"></script>
|
|
10451
10466
|
```
|
|
10452
10467
|
|
|
10453
10468
|
It is a separate script because the offline world map it carries adds about
|
|
@@ -10792,6 +10807,140 @@ figure's head from `characterJoints`.
|
|
|
10792
10807
|
|
|
10793
10808
|
---
|
|
10794
10809
|
|
|
10810
|
+
<!-- docs/cosmic-explainer.md -->
|
|
10811
|
+
|
|
10812
|
+
# Cosmic Explainer Scenes
|
|
10813
|
+
|
|
10814
|
+
A kit for animated science explainers in the bright, flat, glowing look of
|
|
10815
|
+
popular science channels: a saturated gradient sky per scene, drifting dust
|
|
10816
|
+
and soft bokeh for depth, flat-shaded shapes with no outlines (a sphere with a
|
|
10817
|
+
shadow crescent and a highlight, an isometric cube, a probability haze),
|
|
10818
|
+
zooming through scale with growing portals (a hand → skin → cells → one atom),
|
|
10819
|
+
burned-in short captions two words at a time, label chips, and sound effects
|
|
10820
|
+
made from numbers.
|
|
10821
|
+
|
|
10822
|
+
Every function draws on a Canvas 2D context, takes the time in ms and plain
|
|
10823
|
+
options, and draws the same thing for the same input: particles sit where a
|
|
10824
|
+
hash of their index puts them, never `Math.random`, so a frame looks the same
|
|
10825
|
+
whether it is rendered in order, out of order or scrubbed to. Text is yours
|
|
10826
|
+
(any script that separates words with spaces, Devanagari included) and so are
|
|
10827
|
+
the fonts. Pair it with the noir kit's `drawGlow` and `drawVignette`, the
|
|
10828
|
+
scene's `bloom`, and the characters.
|
|
10829
|
+
|
|
10830
|
+
```js
|
|
10831
|
+
import { drawSkyGradient, drawDust, drawBokeh, drawShadedBall, drawHaze, drawZoomLevels,
|
|
10832
|
+
depthAt, levelPresence, drawShortCaption, drawLabelChip, drawGlow } from '@algorisys/tinyfly/characters'
|
|
10833
|
+
|
|
10834
|
+
const dive = [{ time: 1800, value: 0 }, { time: 3400, value: 1.35 }, { time: 5400, value: 2.35 }]
|
|
10835
|
+
const atom = (ctx, time) => {
|
|
10836
|
+
drawSkyGradient(ctx, { width: 720, height: 1280, sky: 'space' })
|
|
10837
|
+
drawHaze(ctx, time, { x: 360, y: 576, radius: 120 })
|
|
10838
|
+
drawGlow(ctx, { x: 360, y: 576, radius: 60, color: '#fb923c' })
|
|
10839
|
+
}
|
|
10840
|
+
|
|
10841
|
+
function frame(ctx, time) {
|
|
10842
|
+
const depth = depthAt(time, dive)
|
|
10843
|
+
drawZoomLevels(ctx, time, { width: 720, height: 1280, depth, levels: [hand, cells, atom], center: { x: 360, y: 576 } })
|
|
10844
|
+
drawBokeh(ctx, time, { width: 720, height: 1280, offset: { x: depth * 40, y: 0 } })
|
|
10845
|
+
drawDust(ctx, time, { width: 720, height: 1280, offset: { x: depth * 60, y: 0 } })
|
|
10846
|
+
if (levelPresence(depth, 2) > 0.5) drawLabelChip(ctx, time, { text: 'one atom', x: 360, y: 150, at: 5150 })
|
|
10847
|
+
drawShortCaption(ctx, time, { lines: narrationCues, x: 360, y: 920 })
|
|
10848
|
+
}
|
|
10849
|
+
```
|
|
10850
|
+
|
|
10851
|
+
`examples/headless-video/cosmic-explainer.mjs` is a whole 9:16 short built
|
|
10852
|
+
this way, with its sound mix made entirely from the generators.
|
|
10853
|
+
|
|
10854
|
+
## Skies and depth
|
|
10855
|
+
|
|
10856
|
+
| Function | Draws |
|
|
10857
|
+
|---|---|
|
|
10858
|
+
| `drawSkyGradient(ctx, { width, height, sky?, top?, bottom? })` | A vertical gradient filling the frame. `sky` is one of `COSMIC_SKIES`: `space`, `micro`, `magenta`, `cyan`, `lime`, `sunset`, `ocean`; or give `top` and `bottom`. An unknown name throws with the list. |
|
|
10859
|
+
| `drawDust(ctx, time, { width, height, count?, color?, opacity?, size?, drift?, offset?, seed? })` | Twinkling specks in three parallax depths, wrapping round the frame. `drift` is px per second for the nearest layer; `offset` is the camera's shift (far specks move less). |
|
|
10860
|
+
| `drawBokeh(ctx, time, { width, height, count?, color?, opacity?, minRadius?, maxRadius?, drift?, offset?, seed? })` | Big soft out-of-focus discs drifting across (foreground depth); they move 1.6× the camera offset. |
|
|
10861
|
+
|
|
10862
|
+
Give each scene a different sky, so a scene change reads even without a hard
|
|
10863
|
+
cut, and keep dust and bokeh in every shot, so no frame is ever still.
|
|
10864
|
+
|
|
10865
|
+
## Flat-shaded shapes
|
|
10866
|
+
|
|
10867
|
+
| Function | Draws |
|
|
10868
|
+
|---|---|
|
|
10869
|
+
| `drawShadedBall(ctx, { x, y, radius, color, light?, shadow?, highlight?, opacity? })` | A sphere: the base fill, a darker crescent away from `light` (each axis −1..1, default top left), a small white highlight. No outline. |
|
|
10870
|
+
| `drawIsoCube(ctx, { x, y, size, color, opacity?, sheen? })` | An isometric cube: lit top, a mid left face, a dark right face, an optional sparkle. `isoCubeFaces` gives the three polygons. |
|
|
10871
|
+
| `drawHaze(ctx, time, { x, y, radius, color?, dots?, dot?, opacity?, squash?, spin?, seed? })` | A probability cloud of flickering dots, densest on a ring at `radius` (an electron shell). |
|
|
10872
|
+
| `cosmicShade(color, amount, alpha?)` | The colour toward black (`amount` < 0) or white (> 0): the flat-shading palette from one base colour. |
|
|
10873
|
+
|
|
10874
|
+
Colours are `#rgb`, `#rrggbb` or `rgb()`; anything else throws, since the kit
|
|
10875
|
+
has to shade it.
|
|
10876
|
+
|
|
10877
|
+
## Zooming through scale
|
|
10878
|
+
|
|
10879
|
+
The signature move: a dive from something you know down through levels of
|
|
10880
|
+
scale. The levels are drawings, each `factor` times smaller than the one
|
|
10881
|
+
before (default 14); one number, the **depth**, drives them all. Level *k* is
|
|
10882
|
+
drawn at scale `factor ** (depth − k)` inside a circular portal at the zoom
|
|
10883
|
+
centre, so the next level opens as a window in the middle of the current one
|
|
10884
|
+
and grows until it fills the frame; levels hidden behind a covering portal are
|
|
10885
|
+
not drawn.
|
|
10886
|
+
|
|
10887
|
+
| Function | |
|
|
10888
|
+
|---|---|
|
|
10889
|
+
| `depthAt(time, keys)` | The depth at a time, eased between `{ time, value }` keys. About `k + 0.35` shows level *k* filling the frame. |
|
|
10890
|
+
| `zoomAt(time, keys)` | A zoom factor eased in log space (values > 0): halfway between 1× and 100× is 10×, so a dive feels steady. |
|
|
10891
|
+
| `drawZoomLevels(ctx, time, { width, height, depth, levels, factor?, center?, portalRadius?, rim?, rimWidth? })` | Draw the visible levels; each level function draws itself at scale 1 around `center`. `rim: null` drops the glowing ring. |
|
|
10892
|
+
| `zoomLevelLayout({ width, height, depth, levelCount, factor?, portalRadius? })` | Which levels draw at a depth, with their scale and portal radius. |
|
|
10893
|
+
| `levelPresence(depth, level)` | 0..1: how fully a level fills the screen, to show or fade its label. |
|
|
10894
|
+
| `drawPortalRim(ctx, x, y, radius, color?, width?)` | The glowing ring on its own (a lens edge, an inset). |
|
|
10895
|
+
|
|
10896
|
+
Time the depth keys to the narration: put each level's arrival on the word
|
|
10897
|
+
that names it. For an endless, self-similar zoom (the same frame inside
|
|
10898
|
+
itself forever) use `nestedZoom` from `tinyfly/adapters` instead.
|
|
10899
|
+
|
|
10900
|
+
## Short captions and chips
|
|
10901
|
+
|
|
10902
|
+
| Function | |
|
|
10903
|
+
|---|---|
|
|
10904
|
+
| `drawShortCaption(ctx, time, { lines, x, y, size?, font?, color?, shadow?, wordsPerChunk?, lowercase? })` | Burned-in captions one to three words at a time (default 2), lower case, boxless, with a drop shadow; returns the text drawn. `lines` are `{ text, start, end }` (narration cues fit as they are). Sit them at about 72% of the height in 9:16, 86% in 16:9. |
|
|
10905
|
+
| `captionChunkAt(line, time, wordsPerChunk?)` | The chunk showing at a time: each chunk gets its share of the line by its share of the characters, close enough for a few words at a time. |
|
|
10906
|
+
| `captionChunks(text, wordsPerChunk?)` | A line cut at spaces. |
|
|
10907
|
+
| `drawLabelChip(ctx, time, { text, x, y, size?, font?, fill?, color?, at?, pop? })` | A rounded chip that pops on at `at`; returns its width. |
|
|
10908
|
+
| `drawCornerNote(ctx, { text, x, y, size?, font?, color? })` | A small right-aligned note, such as `*not to scale`. |
|
|
10909
|
+
|
|
10910
|
+
## Sound effects from numbers
|
|
10911
|
+
|
|
10912
|
+
`@algorisys/tinyfly/headless` makes sound effects as mono `Float32Array`
|
|
10913
|
+
samples, seeded and deterministic, with no files to find or license:
|
|
10914
|
+
`soundWhoosh(rate, { duration?, rise?, seed? })` for zooms and cuts,
|
|
10915
|
+
`soundPop(rate, { frequency?, duration? })` for chips, `soundThud(rate)` for
|
|
10916
|
+
impacts, `soundShimmer(rate)` for reveals, `soundTick(rate)` for counters,
|
|
10917
|
+
`soundClick(rate)` for a latch or padlock, and `soundPad(rate, { duration })`,
|
|
10918
|
+
a slow ambient drone to mix low under narration.
|
|
10919
|
+
|
|
10920
|
+
`renderMix` layers take `samples` as well as `file`, so a mix needs no ffmpeg
|
|
10921
|
+
decoding for them:
|
|
10922
|
+
|
|
10923
|
+
```js
|
|
10924
|
+
import { renderMix, soundPad, soundWhoosh, soundPop } from '@algorisys/tinyfly/headless'
|
|
10925
|
+
|
|
10926
|
+
const audio = await renderMix([
|
|
10927
|
+
{ id: 'voice', file: 'build/narration.wav' },
|
|
10928
|
+
{ samples: soundPad(48000, { duration: END }), gain: 0.2, duck: { under: 'voice', amount: 0.5 } },
|
|
10929
|
+
{ samples: soundWhoosh(48000), at: [3000, 5200], gain: 0.5 },
|
|
10930
|
+
{ samples: soundPop(48000), at: [3300, 5500], gain: 0.4 },
|
|
10931
|
+
], { output: 'build/mix.wav', duration: END, baseDir: here })
|
|
10932
|
+
```
|
|
10933
|
+
|
|
10934
|
+
## Style notes
|
|
10935
|
+
|
|
10936
|
+
- One sky per scene; dust and bokeh always on; a slow push-in on every shot.
|
|
10937
|
+
- A whoosh on every zoom or scene change, a pop on every chip, ticks for
|
|
10938
|
+
counters, a thud for impacts, a shimmer for reveals, a quiet pad under all.
|
|
10939
|
+
- Anything drawn at an illustrative scale gets a `drawCornerNote` saying so;
|
|
10940
|
+
anything that claims a scale is drawn to it.
|
|
10941
|
+
|
|
10942
|
+
---
|
|
10943
|
+
|
|
10795
10944
|
<!-- docs/character-appearance.md -->
|
|
10796
10945
|
|
|
10797
10946
|
# Character Appearance
|
|
@@ -15909,7 +16058,7 @@ magnet.addEventListener('pointerleave', () => {
|
|
|
15909
16058
|
|
|
15910
16059
|
<!-- capabilities: generated from the library -->
|
|
15911
16060
|
|
|
15912
|
-
# tinyfly capabilities (v0.
|
|
16061
|
+
# tinyfly capabilities (v0.127.0)
|
|
15913
16062
|
|
|
15914
16063
|
Generated from the library itself: every name below is accepted, and names not listed are rejected (beat scripts, code panels and `checkTracks` say which name was probably meant).
|
|
15915
16064
|
|
|
@@ -16162,7 +16311,7 @@ Scenery: `scenery({ x, y, width, height, kind: sky | room, hour, clouds, wind, r
|
|
|
16162
16311
|
| `bike()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk` | `wheelSpin` | seat, front, back, roof |
|
|
16163
16312
|
| `motorbike()` | vehicle | `drive` (to), `brake` (to), `bump`, `honk`, `lights` (on) | `wheelSpin`, `lights` | seat, front, back, roof |
|
|
16164
16313
|
| `tree()` | plant | `sway`, `shake`, `shedLeaves` | `sway`, `canopySway` | canopy, top, base, branch |
|
|
16165
|
-
| `house()` | building | `door` (open), `lights` (on), `shake`, `smoke` | `door`, `lights` | door, doorstep, ridge, chimney |
|
|
16314
|
+
| `house()` | building | `door` (open), `lights` (on), `shake`, `smoke` | `door`, `lights` | door, handle, doorstep, ridge, chimney |
|
|
16166
16315
|
| `chair()` | furniture | `tip`, `fall` | `tip` | seat, back, front |
|
|
16167
16316
|
| `desk()` | furniture | `drawer` (open) | `drawer` | top, edge, drawer, chair |
|
|
16168
16317
|
| `bed()` | furniture | `bounce` | `give` | mattress, pillow, foot, side |
|
|
@@ -16247,6 +16396,32 @@ Canvas drawing functions for detective and noir scenes (see docs/noir-detective.
|
|
|
16247
16396
|
|
|
16248
16397
|
Case board cards: { id, x, y (its pin, relative to the board), kind?, title?, note?, width?, height?, angle?, color?, at?, highlight?: { at, duration } }, kinds `photo`, `note`. Strings: { from, to, at?, duration?, color? }. Marks: { on, kind, at, duration?, color?, width? }, kinds `cross` (two diagonals across the card, one after the other (ruled out)), `strike` (one diagonal, bottom-left to top-right (half ruled out)), `scribble` (a zigzag back and forth across the card (scribbled out)), `circle` (a loose ring round the card (this one)).
|
|
16249
16398
|
|
|
16399
|
+
## Cosmic explainer kit
|
|
16400
|
+
|
|
16401
|
+
Canvas drawing functions for science-explainer scenes (see docs/cosmic-explainer.md): flat gradient skies, parallax dust and bokeh, flat-shaded shapes, zooming through scale with portals, burned-in short captions and label chips. Times are ms; every one is a pure function of its options and the time (particles are seeded), so frames draw the same in any order. Pair with the noir kit’s `drawGlow` and `drawVignette`.
|
|
16402
|
+
|
|
16403
|
+
- `drawSkyGradient(ctx, { width, height, sky?, top?, bottom? })`: a flat saturated gradient sky filling the frame (one per scene)
|
|
16404
|
+
- `drawDust(ctx, time, { width, height, count?, color?, opacity?, size?, drift?, offset?, seed? })`: twinkling specks in three parallax depths, wrapping round the frame (offset = camera shift)
|
|
16405
|
+
- `drawBokeh(ctx, time, { width, height, count?, color?, opacity?, minRadius?, maxRadius?, drift?, offset?, seed? })`: big soft out-of-focus discs drifting across the frame
|
|
16406
|
+
- `dustTwinkle(time, i, seed?)`: the twinkle 0..1 drawDust uses for speck i
|
|
16407
|
+
- `drawShadedBall(ctx, { x, y, radius, color, light?, shadow?, highlight?, opacity? })`: a flat sphere: base fill, a darker crescent away from the light, a small highlight; no outline
|
|
16408
|
+
- `drawIsoCube(ctx, { x, y, size, color, opacity?, sheen? })`: an isometric cube: lit top, mid left, dark right face (isoCubeFaces gives the polygons)
|
|
16409
|
+
- `drawHaze(ctx, time, { x, y, radius, color?, dots?, dot?, opacity?, squash?, spin?, seed? })`: a probability cloud of flickering dots, densest on a ring (an electron shell)
|
|
16410
|
+
- `cosmicShade(color, amount, alpha?)`: a colour toward black (amount < 0) or white (> 0), for flat shading
|
|
16411
|
+
- `zoomAt(time, [{ time, value }])`: a zoom factor eased in log space between keys (a steady dive from 1x to 1000x)
|
|
16412
|
+
- `depthAt(time, [{ time, value }])`: a depth eased between keys (0 = the first level)
|
|
16413
|
+
- `drawZoomLevels(ctx, time, { width, height, depth, levels: [(ctx, time) => void], factor?, center?, portalRadius?, rim?, rimWidth? })`: zoom through scale: each level factor times smaller, opening as a growing portal in the middle of the last; levels behind a covering portal are skipped
|
|
16414
|
+
- `zoomLevelLayout({ width, height, depth, levelCount, factor?, portalRadius? })`: which levels draw at a depth, their scale and portal radius
|
|
16415
|
+
- `drawPortalRim(ctx, x, y, radius, color?, width?)`: a glowing ring
|
|
16416
|
+
- `levelPresence(depth, level, settle?)`: 0..1: how much a level fills the screen (to fade its label)
|
|
16417
|
+
- `drawShortCaption(ctx, time, { lines: [{ text, start, end }], x, y, size?, font?, color?, shadow?, wordsPerChunk?, lowercase? })`: burned-in short captions: one to three words at a time in step with the voice (by character share)
|
|
16418
|
+
- `captionChunkAt({ text, start, end }, time, wordsPerChunk?)`: the chunk showing at a time, or null
|
|
16419
|
+
- `captionChunks(text, wordsPerChunk?)`: a line cut into chunks (split at spaces; works for Devanagari)
|
|
16420
|
+
- `drawLabelChip(ctx, time, { text, x, y, size?, font?, fill?, color?, at?, pop? })`: a rounded label chip that pops on; returns its width
|
|
16421
|
+
- `drawCornerNote(ctx, { text, x, y, size?, font?, color? })`: a small right-aligned note, e.g. "*not to scale"
|
|
16422
|
+
|
|
16423
|
+
Skies: `space`, `micro`, `magenta`, `cyan`, `lime`, `sunset`, `ocean`. Sounds: from tinyfly/headless: soundWhoosh, soundPop, soundThud, soundShimmer, soundTick, soundClick, soundPad (Float32Array samples for mixAudio / renderMix layers).
|
|
16424
|
+
|
|
16250
16425
|
## Code panel
|
|
16251
16426
|
|
|
16252
16427
|
`codePanel({ code, language, x, y, fontSize?, lineHeight?, width? })`: a code listing as a scene object. Languages: `go`, `rust`, `csharp`, `javascript`, `typescript`, `python`, `plain`. Remove styles: `wipe`, `fly`, `blur`.
|
package/llms.txt
CHANGED
|
@@ -13,50 +13,51 @@ Key facts:
|
|
|
13
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
14
|
- Source: https://github.com/algorisys-oss/tinyfly. License: MIT.
|
|
15
15
|
|
|
16
|
-
All documentation and the interactive course in a single file: [llms-full.txt](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
16
|
+
All documentation and the interactive course in a single file: [llms-full.txt](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/llms-full.txt)
|
|
17
17
|
|
|
18
18
|
## Start here
|
|
19
19
|
|
|
20
|
-
- [Getting Started](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
21
|
-
- [GSAP Compatibility](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
22
|
-
- [Code Examples](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
23
|
-
- [Building Animations with an LLM](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
20
|
+
- [Getting Started](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.127.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.127.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; a festive garba/dandiya scene with partner contacts, circle travel and spins, also rendered to video.
|
|
23
|
+
- [Building Animations with an LLM](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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
24
|
|
|
25
25
|
## Reference
|
|
26
26
|
|
|
27
|
-
- [API Reference](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
28
|
-
- [File Format](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
27
|
+
- [API Reference](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.127.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
29
|
|
|
30
30
|
## Editor features
|
|
31
31
|
|
|
32
|
-
- [Editor Guide](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
33
|
-
- [Shape Morphing](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
34
|
-
- [Pen Tool](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
35
|
-
- [Polygons & Stars](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
36
|
-
- [Grid & Snapping](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
37
|
-
- [Onion Skinning](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
38
|
-
- [Sprite-sheet Export](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
32
|
+
- [Editor Guide](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.127.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.127.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.127.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.127.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.127.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.127.0/docs/sprite-sheet-export.md): Exporting frames as a PNG grid plus JSON metadata for game engines and canvas players.
|
|
39
39
|
|
|
40
40
|
## Guides
|
|
41
41
|
|
|
42
|
-
- [Cricket Stories](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
43
|
-
- [Scroll Animation](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
44
|
-
- [Props: Everyday Objects with Behaviours](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
45
|
-
- [Teaching Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
46
|
-
- [Maths Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
47
|
-
- [Rendering Video from Code](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
48
|
-
- [Animated Maps](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
49
|
-
- [Cartoon Hands](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
50
|
-
- [Noir and Detective Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
- [
|
|
54
|
-
- [
|
|
55
|
-
- [3D
|
|
56
|
-
- [
|
|
57
|
-
- [
|
|
42
|
+
- [Cricket Stories](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/cricket.md): Reusable sports APIs, organic adult/child players, sixteen cricket plays, Test/ODI/T20 facts, contact-keyed JSON, captions, headless video and a 360° ground camera.
|
|
43
|
+
- [Scroll Animation](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/scroll-animation.md): Scroll-driven and play-when-visible animation with ScrollDriver and VisibilityDriver.
|
|
44
|
+
- [Props: Everyday Objects with Behaviours](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/props.md): Cars, trucks, buses, tractors, carts, train carriages, bikes, motorbikes, trees, houses, a helicopter and a plane: 3D rigs drawn with the characters’ pens (clean, pencil) that turn toward the camera, with beats acted through the 12 principles (anticipation, squash and stretch, follow-through, an exaggeration dial), wheels that roll exactly, effects, and figures riding them.
|
|
45
|
+
- [Teaching Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.
|
|
46
|
+
- [Maths Animations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/math.md): tinyfly/math: figures as JSON (grids a matrix warps, vectors, function plots, polygons, eigenlines, TeX labels and equations that rewrite step by step), animated by plain tracks, played in lesson-page embeds, explorables and videos from one layout; a built-in TeX subset and ready linear algebra figures.
|
|
47
|
+
- [Rendering Video from Code](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.
|
|
48
|
+
- [Animated Maps](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.
|
|
49
|
+
- [Cartoon Hands](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.
|
|
50
|
+
- [Noir and Detective Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/noir-detective.md): A canvas kit for detective stories: rain in a window, light through blinds, darkness with torch beams and holes, glow, vignette, lightning and a flickering bulb; the red clue magnifier, an evidence folder, a clock and time chip, a freeze-frame suspect name card, a typed narration box and speech bubbles; and a case board as data (pinned photo and note cards, red string, marker cross-outs, strikes, scribble-outs and rings drawn on over time, with the marker nib for a hand). Deterministic from time; text and fonts are yours.
|
|
51
|
+
- [Cosmic Explainer Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/cosmic-explainer.md): A canvas kit for animated science explainers: saturated gradient skies, parallax dust and bokeh, flat-shaded shapes (a sphere with a shadow crescent, an isometric cube, a probability haze), zooming through scale in growing portals (drawZoomLevels, depthAt, zoomAt), burned-in short captions two words at a time and label chips; plus sound effects made from numbers (whoosh, pop, thud, shimmer, tick, click, an ambient pad) that renderMix takes as samples. Deterministic from time.
|
|
52
|
+
- [Character Appearance](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/character-appearance.md): Hair (34 styles), facial hair (20), glasses, hats and ears for the v2 character as plain data on the head, so they turn with it through all eight views; builds (child, tall, short…), a recurring cast (castMember), expressions with blush, tears and sweat, everyday poses, held items (mug, phone, bags, umbrella, parcel) and two characters’ hands meeting (meetHands: handshake, high five, hand-over).
|
|
53
|
+
- [Cartoon Acting](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.
|
|
54
|
+
- [Dance and Flips](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/dance.md): The stick figure dances disco, hip hop, breaking, jazz, K-pop, Bollywood, Bhangra, Bharatanatyam (with mudras), the Charleston, tap and popping, and does flips, leaps and splits; native v2 garba (two/three clap) and dandiya add body-local routines, circle formations, world foot plants, paired stick-tip contacts and signed spins; JSON bakes, timing, contact limits and editor menus.
|
|
55
|
+
- [3D Scenes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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 pen or solid looks, scripted native dances, timed signed spins and circle formations with foot contacts.
|
|
56
|
+
- [3D Transforms and Rotations](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.
|
|
57
|
+
- [Extending tinyfly](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.
|
|
58
|
+
- [Deployment](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/docs/DEPLOYMENT.md): Building and hosting the editor, and serving the player bundles.
|
|
58
59
|
|
|
59
60
|
## Optional
|
|
60
61
|
|
|
61
|
-
- [README](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
62
|
-
- [Release notes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.
|
|
62
|
+
- [README](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.0/README.md): Feature overview, project layout and development setup.
|
|
63
|
+
- [Release notes](https://raw.githubusercontent.com/algorisys-oss/tinyfly/v0.127.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.127.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",
|
package/skills/tinyfly/SKILL.md
CHANGED
|
@@ -44,6 +44,13 @@ names.
|
|
|
44
44
|
detective gear `bean: { coat, fedora, shades: true }`; `halo` edges line limbs.
|
|
45
45
|
It is always drawn clean; every pose, gait, dance and expression field works on it.
|
|
46
46
|
Household clothes: `bean: { skirt, drape, bangles }` (`skirt` a colour or `{ color, length }`; preset `beanSari`).
|
|
47
|
+
- Science explainers (the cosmic kit, docs/cosmic-explainer.md): `drawSkyGradient(ctx, { width, height, sky })`,
|
|
48
|
+
`drawDust` / `drawBokeh` (pass the camera `offset` for parallax), `drawShadedBall`, `drawIsoCube`, `drawHaze`;
|
|
49
|
+
a dive through scale with `drawZoomLevels(ctx, time, { width, height, depth: depthAt(time, keys), levels })`
|
|
50
|
+
(level functions draw at scale 1 around the centre; about `k + 0.35` fills the frame with level k);
|
|
51
|
+
`drawShortCaption(ctx, time, { lines, x, y })` (two words at a time), `drawLabelChip`, `drawCornerNote`.
|
|
52
|
+
Sounds without files from tinyfly/headless: `soundWhoosh`, `soundPop`, `soundThud`, `soundShimmer`,
|
|
53
|
+
`soundTick`, `soundClick`, `soundPad`; pass them to `renderMix` as `{ samples, at, gain }` layers.
|
|
47
54
|
- Detective / noir scenes: canvas functions, all pure in time (ms): `drawRain`, `drawBlinds`,
|
|
48
55
|
`drawDarkness` (torch `cones` with `angle` in degrees, `holes`), `drawGlow`, `drawVignette`,
|
|
49
56
|
`lightningFlash`, `lightFlicker`; overlays `drawClueMarker`, `drawEvidenceFolder`, `drawClockFace`,
|
|
@@ -109,6 +116,9 @@ names.
|
|
|
109
116
|
or `part:ID`). Walk figures on a prop's front line (a house's
|
|
110
117
|
`anchor:doorstep` y), not on the prop's own `y`, or they pass through its
|
|
111
118
|
walls.
|
|
119
|
+
- A house's door hangs on its left edge unless `house({ door: { hinge:
|
|
120
|
+
'right', opens: 'in' } })`; hang it on the side away from the figure and
|
|
121
|
+
grab `anchor:handle` (on the free edge), or the figure opens it from the hinge.
|
|
112
122
|
- For objects in the scene (vehicles, trees, houses, furniture, aircraft,
|
|
113
123
|
animals, birds) use the prop presets with `propScript()`; seat figures with
|
|
114
124
|
`propRide()`, tow with `propTow()`. Furniture's anchors are where a figure
|