@algorisys/tinyfly 0.103.0 → 0.104.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 +10 -4
- package/docs/character-appearance.md +38 -1
- package/docs/editor-guide.md +6 -1
- package/docs/examples.md +10 -1
- package/docs/getting-started.md +1 -1
- package/docs/gsap-compat.md +1 -1
- package/docs/llm-guide.md +7 -1
- package/docs/maps.md +2 -2
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +2816 -2615
- package/lib/browser/tinyfly.iife.js +12 -12
- package/lib/browser/tinyfly.js +3673 -3472
- package/lib/browser/tinyfly.umd.js +12 -12
- package/lib/types/characters/capabilities.d.ts +2 -0
- package/lib/types/characters/cast.d.ts +536 -2
- package/lib/types/characters/head/face.d.ts +8 -0
- package/lib/types/characters/index.d.ts +2 -1
- package/llms-full.txt +69 -11
- package/llms.txt +29 -29
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +7 -1
package/README.md
CHANGED
|
@@ -142,6 +142,12 @@ six dancers circle with decorated clothes and sticks, partner strikes and
|
|
|
142
142
|
half/full spins. Its [headless scene](examples/headless-video/festive-dandiya.mjs)
|
|
143
143
|
renders the same 24-second loop to video, without bundled audio.
|
|
144
144
|
|
|
145
|
+
The [Colour Anime Cast](https://tinyfly.app/examples/live-anime-cast) adds eight
|
|
146
|
+
editable characters across children, young adults, adults and older adults.
|
|
147
|
+
Coloured irises, highlights, lids and age creases use the same expressions,
|
|
148
|
+
head turns and motion APIs. Choose a preset in the editor's Cast picker or
|
|
149
|
+
use `character(castMember('animeYoungWoman', 300))` in code.
|
|
150
|
+
|
|
145
151
|
## Documentation
|
|
146
152
|
|
|
147
153
|
- [Getting Started](docs/getting-started.md) — Installation, setup, and your first animation
|
|
@@ -242,7 +248,7 @@ GSAP-shaped functions at the top level. Teaching embeds are included: add
|
|
|
242
248
|
itself.
|
|
243
249
|
|
|
244
250
|
```html
|
|
245
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
251
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.104.0/cdn/tinyfly.iife.js"></script>
|
|
246
252
|
<script>
|
|
247
253
|
tinyfly.to('.box', { x: 200, rotate: 90, duration: 1, ease: 'power2.out' })
|
|
248
254
|
|
|
@@ -278,7 +284,7 @@ A teaching figure needs no code at all:
|
|
|
278
284
|
<script type="application/json" data-tinyfly-timeline>{ …timeline JSON with markers… }</script>
|
|
279
285
|
<figcaption>Appending to a full slice</figcaption>
|
|
280
286
|
</figure>
|
|
281
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
287
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.104.0/cdn/tinyfly.iife.js" data-tinyfly-auto></script>
|
|
282
288
|
```
|
|
283
289
|
|
|
284
290
|
See [Teaching Animations](docs/teaching.md).
|
|
@@ -377,7 +383,7 @@ Without a build step, the player bundle puts the same functions on a `tinyfly` g
|
|
|
377
383
|
<div data-tinyfly="box" style="width: 60px; height: 60px; background: #4a9eff;"></div>
|
|
378
384
|
</div>
|
|
379
385
|
|
|
380
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
386
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.104.0/cdn/tinyfly-player.iife.js"></script>
|
|
381
387
|
<script>
|
|
382
388
|
tinyfly.play('#animation', './animation.json', { loop: -1 })
|
|
383
389
|
</script>
|
|
@@ -486,7 +492,7 @@ Or skip the code entirely with declarative embeds (see [Teaching Animations](doc
|
|
|
486
492
|
<svg viewBox="0 0 720 200">…</svg>
|
|
487
493
|
<script type="application/json" data-tinyfly-timeline>{ …timeline JSON… }</script>
|
|
488
494
|
</figure>
|
|
489
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
495
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.104.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
490
496
|
```
|
|
491
497
|
|
|
492
498
|
### Audio / Video Sync
|
|
@@ -250,12 +250,49 @@ cast member at an adult `height` (each stands at their own scale of it). The
|
|
|
250
250
|
family: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`,
|
|
251
251
|
`grandma`; at work (from the occupations sheet): `doctor`, `cook`, `builder`,
|
|
252
252
|
`courier`, `teacher`, `farmer`. `CHARACTER_CAST` has each one's `label`,
|
|
253
|
-
`group` (`family` or `
|
|
253
|
+
`group` (`family`, `work` or `anime`), `scale` and `options`.
|
|
254
254
|
|
|
255
255
|
```js
|
|
256
256
|
const family = ['man', 'woman', 'girl', 'grandma'].map((name) => character(castMember(name, 280)))
|
|
257
257
|
```
|
|
258
258
|
|
|
259
|
+
### Colour anime cast
|
|
260
|
+
|
|
261
|
+
`ANIME_CAST` contains eight editable presets, also included in `CHARACTER_CAST`:
|
|
262
|
+
`animeBoy`, `animeGirl`, `animeYoungMan`, `animeYoungWoman`, `animeMan`,
|
|
263
|
+
`animeWoman`, `animeOlderMan`, and `animeOlderWoman`. Children use shorter
|
|
264
|
+
limbs and a larger head; older adults use grey hair and subtle face creases.
|
|
265
|
+
All presets use the same human rig, so existing expressions, acting,
|
|
266
|
+
hand gestures, gaits, dance, and full head/body turns work with them.
|
|
267
|
+
The looks are starting points: any hair, outfit, iris colour or build can be changed.
|
|
268
|
+
|
|
269
|
+
```js
|
|
270
|
+
const young = character(castMember('animeYoungWoman', 300))
|
|
271
|
+
drawCharacter(ctx, young, humanPose({ ...HUMAN_EXPRESSIONS.surprised, turn: 0.5 }))
|
|
272
|
+
const older = character(castMember('animeOlderMan', 300, {
|
|
273
|
+
face: { style: 'anime', iris: '#94713e', lashes: false, ageLines: 0.6 }
|
|
274
|
+
}))
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
For any character, `face: { style: 'anime' }` draws almond-shaped eyes with
|
|
278
|
+
coloured irises and highlights. `iris` sets their colour (default `#4b7fce`),
|
|
279
|
+
`lashes` enables outer lashes (default true), and `ageLines` sets subtle eye
|
|
280
|
+
and smile creases from 0 to 1 (default 0). `style: 'simple'` is the original
|
|
281
|
+
face and remains the default. Face style is separate from the pen's `look`
|
|
282
|
+
(`clean`, `pencil`, or `silhouette`); `look: 'anime'` is not a pen style.
|
|
283
|
+
|
|
284
|
+
The existing `eye.left`, `eye.right`, `blink`, `lookX`, `lookY`, `pupil`, `lid`,
|
|
285
|
+
`bulge`, brows and mouth fields animate both styles. The coloured eye opening
|
|
286
|
+
narrows with the lids; blink or a fully lowered lid closes it. Far-side eyes
|
|
287
|
+
hide in profile and all face features hide from behind. The style and colours
|
|
288
|
+
are plain JSON; `face.inPupil` remains an optional drawing hook for custom content.
|
|
289
|
+
`castMember` changes replace option objects such as `face` or `outfit` as a whole.
|
|
290
|
+
|
|
291
|
+
The **Colour Anime Cast** example shows all eight presets, expressions,
|
|
292
|
+
face close-ups and a complete turnaround. Both the Character and 3D Scene
|
|
293
|
+
editors offer these presets in their Cast picker. The Character editor also
|
|
294
|
+
has Face style, Iris colour, Eyelashes and Age creases controls, saved in project JSON.
|
|
295
|
+
|
|
259
296
|
## Hugs, help-ups and everyday cycles
|
|
260
297
|
|
|
261
298
|
Two people, more than hands: `embrace(a, b)` is a hug. Both turn toward each
|
package/docs/editor-guide.md
CHANGED
|
@@ -168,6 +168,11 @@ its box; resize the box to change its height. In the property panel:
|
|
|
168
168
|
Poses that rest on a knee, the hands or the back are set down on the ground.
|
|
169
169
|
- **Face**: an expression (happy, sad, surprised, angry, embarrassed with a
|
|
170
170
|
blush, crying with tears, afraid with a bead of sweat…), or the pose's own.
|
|
171
|
+
**Face style** switches between Simple and Colour anime. Anime faces have an
|
|
172
|
+
**Iris colour** and **Eyelashes** toggle; **Age creases** adds subtle facial
|
|
173
|
+
lines. The Cast picker includes eight colour anime presets for boys, girls,
|
|
174
|
+
young adults, adults and older adults. The 3D Scene character's Cast picker
|
|
175
|
+
uses the same presets.
|
|
171
176
|
|
|
172
177
|
To animate a character, pick a view, a pose and a face, and click
|
|
173
178
|
**◆ Keyframe pose at playhead**. Move the playhead, pick the next pose, and
|
|
@@ -1135,7 +1140,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
1135
1140
|
**Steps to embed:**
|
|
1136
1141
|
1. Build the player: `npm run build:player`
|
|
1137
1142
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
1138
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
1143
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.104.0/cdn/tinyfly-player.iife.js`
|
|
1139
1144
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
1140
1145
|
3. Copy the generated code into your HTML
|
|
1141
1146
|
4. Adjust the script `src` path if needed
|
package/docs/examples.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Practical examples for common animation patterns using the tinyfly API.
|
|
4
4
|
|
|
5
|
+
## Colour Anime Cast
|
|
6
|
+
|
|
7
|
+
Open [Colour Anime Cast](https://tinyfly.app/examples/live-anime-cast) to inspect
|
|
8
|
+
eight male and female characters across children, young adults, adults and
|
|
9
|
+
older adults. Switch expressions, cycle moods, show face close-ups or enable
|
|
10
|
+
a full turnaround. `ANIME_CAST` and `castMember` supply editable JSON options;
|
|
11
|
+
`face.style: 'anime'` uses the same blink, gaze, brow and mouth fields as the
|
|
12
|
+
original face. See [Character Appearance](character-appearance.md#colour-anime-cast).
|
|
13
|
+
|
|
5
14
|
## Festive Garba and Dandiya
|
|
6
15
|
|
|
7
16
|
The [Navratri example](https://tinyfly.app/examples/live-festive-dandiya)
|
|
@@ -715,7 +724,7 @@ For simple website embedding without a build system.
|
|
|
715
724
|
</html>
|
|
716
725
|
```
|
|
717
726
|
|
|
718
|
-
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.
|
|
727
|
+
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.104.0/cdn/tinyfly-player.iife.js`.
|
|
719
728
|
|
|
720
729
|
---
|
|
721
730
|
|
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.104.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.104.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
|
@@ -95,7 +95,13 @@ code: `build` (`child`, `tall`, `short`…), `hair` (a style name, or
|
|
|
95
95
|
`flat`, `pointed`, `big`) and `outfit: { shirt, trousers, over: 'hoodie' |
|
|
96
96
|
'cardigan' | 'overalls' | 'sari' | 'apron' | 'labCoat', shoes: 'boots' }`.
|
|
97
97
|
`castMember('grandpa', 300)` gives a whole ready-made character to start
|
|
98
|
-
from.
|
|
98
|
+
from. The eight presets in `ANIME_CAST` (`animeBoy`, `animeGirl`,
|
|
99
|
+
`animeYoungMan`, `animeYoungWoman`, `animeMan`, `animeWoman`,
|
|
100
|
+
`animeOlderMan`, `animeOlderWoman`) work through `castMember` too.
|
|
101
|
+
Use `face: { style: 'anime', iris: '#4b7fce', lashes: true, ageLines: 0.6 }`
|
|
102
|
+
for coloured expressive eyes and optional creases; this is a face style,
|
|
103
|
+
not a `look` value. It uses the same expressions, blink, gaze and turn fields.
|
|
104
|
+
Age is proportions, hair, creases and clothes, never a stoop; a `cane` in a hand or
|
|
99
105
|
a `wheelchair()` to ride (`RIDING_POSES.wheeling`) is an accessory any
|
|
100
106
|
character can have. Expressions come from `HUMAN_EXPRESSIONS`
|
|
101
107
|
and are pose fields, as are the face marks `blush`, `tears` and `sweat` (0–1)
|
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.104.0/cdn/tinyfly.iife.js"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.104.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.104.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
|