@algorisys/tinyfly 0.121.0 → 0.122.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 +11 -4
- package/docs/character-appearance.md +62 -1
- 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 +6 -0
- package/docs/maps.md +2 -2
- package/docs/math.md +1 -1
- package/docs/teaching.md +1 -1
- package/lib/addons/characters.js +1458 -1404
- package/lib/addons/cricket-play-BRehNToP.js +5506 -0
- package/lib/addons/sports.js +1 -1
- package/lib/browser/tinyfly.iife.js +12 -12
- package/lib/browser/tinyfly.js +6499 -6171
- package/lib/browser/tinyfly.umd.js +12 -12
- package/lib/types/characters/body/bean-figure.d.ts +154 -0
- package/lib/types/characters/cast.d.ts +204 -2
- package/lib/types/characters/character.d.ts +21 -5
- package/lib/types/characters/head/face.d.ts +22 -2
- package/lib/types/characters/index.d.ts +2 -1
- package/llms-full.txt +82 -13
- package/llms.txt +31 -31
- package/package.json +1 -1
- package/skills/tinyfly/SKILL.md +5 -0
- package/lib/addons/cricket-play-C5CkNOc6.js +0 -5219
package/README.md
CHANGED
|
@@ -155,6 +155,13 @@ Coloured irises, highlights, lids and age creases use the same expressions,
|
|
|
155
155
|
head turns and motion APIs. Choose a preset in the editor's Cast picker or
|
|
156
156
|
use `character(castMember('animeYoungWoman', 300))` in code.
|
|
157
157
|
|
|
158
|
+
**Bean figures**: `figure: 'bean'` draws the white outlined stick-figure style natively:
|
|
159
|
+
smooth outlined noodle limbs with no seams at the elbows, knees, shoulders, neck or hips (or
|
|
160
|
+
bare line limbs with `bean: { limbs: 'line' }`), a shaped body, big oval eyes (`face.style: 'oval'`),
|
|
161
|
+
mittens and cartoon shoes, plus detective gear (`coat`, `fedora`, aviator `shades`), on the same rig, so every pose, gait, dance and expression works.
|
|
162
|
+
Try `character(castMember('beanMan', 400))` or the other `BEAN_CAST` presets; see
|
|
163
|
+
[the appearance guide](docs/character-appearance.md#bean-figures-white-outlined-stick-figures).
|
|
164
|
+
|
|
158
165
|
The [Young Adult Manga Cast](https://tinyfly.app/examples/live-manga-cast)
|
|
159
166
|
adds four original presets with angular jaws, tapered chins, narrower eyes
|
|
160
167
|
and pointed hair tufts. Use `MANGA_CAST` or `castMember('mangaYoungMan', 300)`;
|
|
@@ -284,7 +291,7 @@ GSAP-shaped functions at the top level. Teaching embeds are included: add
|
|
|
284
291
|
itself.
|
|
285
292
|
|
|
286
293
|
```html
|
|
287
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
294
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.122.0/cdn/tinyfly.iife.js"></script>
|
|
288
295
|
<script>
|
|
289
296
|
tinyfly.to('.box', { x: 200, rotate: 90, duration: 1, ease: 'power2.out' })
|
|
290
297
|
|
|
@@ -321,7 +328,7 @@ A teaching figure needs no code at all:
|
|
|
321
328
|
<script type="application/json" data-tinyfly-timeline>{ …timeline JSON with markers… }</script>
|
|
322
329
|
<figcaption>Appending to a full slice</figcaption>
|
|
323
330
|
</figure>
|
|
324
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
331
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.122.0/cdn/tinyfly.iife.js" data-tinyfly-auto></script>
|
|
325
332
|
```
|
|
326
333
|
|
|
327
334
|
See [Teaching Animations](docs/teaching.md).
|
|
@@ -420,7 +427,7 @@ Without a build step, the player bundle puts the same functions on a `tinyfly` g
|
|
|
420
427
|
<div data-tinyfly="box" style="width: 60px; height: 60px; background: #4a9eff;"></div>
|
|
421
428
|
</div>
|
|
422
429
|
|
|
423
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
430
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.122.0/cdn/tinyfly-player.iife.js"></script>
|
|
424
431
|
<script>
|
|
425
432
|
tinyfly.play('#animation', './animation.json', { loop: -1 })
|
|
426
433
|
</script>
|
|
@@ -529,7 +536,7 @@ Or skip the code entirely with declarative embeds (see [Teaching Animations](doc
|
|
|
529
536
|
<svg viewBox="0 0 720 200">…</svg>
|
|
530
537
|
<script type="application/json" data-tinyfly-timeline>{ …timeline JSON… }</script>
|
|
531
538
|
</figure>
|
|
532
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
539
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.122.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
533
540
|
```
|
|
534
541
|
|
|
535
542
|
### Audio / Video Sync
|
|
@@ -497,7 +497,7 @@ cast member at an adult `height` (each stands at their own scale of it). The
|
|
|
497
497
|
family: `boy`, `girl`, `youngMan`, `youngWoman`, `man`, `woman`, `grandpa`,
|
|
498
498
|
`grandma`; at work (from the occupations sheet): `doctor`, `cook`, `builder`,
|
|
499
499
|
`courier`, `teacher`, `farmer`. `CHARACTER_CAST` has each one's `label`,
|
|
500
|
-
`group` (`family`, `work`, `anime` or `
|
|
500
|
+
`group` (`family`, `work`, `anime`, `manga` or `bean`), `scale` and `options`.
|
|
501
501
|
|
|
502
502
|
```js
|
|
503
503
|
const family = ['man', 'woman', 'girl', 'grandma'].map((name) => character(castMember(name, 280)))
|
|
@@ -540,6 +540,67 @@ face close-ups and a complete turnaround. Both the Character and 3D Scene
|
|
|
540
540
|
editors offer these presets in their Cast picker. The Character editor also
|
|
541
541
|
has Face style, Iris colour, Eyelashes and Age creases controls, saved in project JSON.
|
|
542
542
|
|
|
543
|
+
### Bean figures (white outlined stick figures)
|
|
544
|
+
|
|
545
|
+
`figure: 'bean'` draws the common white outlined stick-figure style: a white
|
|
546
|
+
figure with a thick black outline, smooth noodle limbs, a shaped body (rounded
|
|
547
|
+
shoulders, a slight waist, fuller hips and a rounded seat), a round head with
|
|
548
|
+
big white oval eyes, small pupils and heavy brows, white mittens and big
|
|
549
|
+
cartoon shoes (a flat sole on the ground, a rounded toe cap, a low heel). The
|
|
550
|
+
rig solves the pose as for every figure, so every pose, gait, dance, reach,
|
|
551
|
+
turn and lip-sync works on it.
|
|
552
|
+
|
|
553
|
+
```js
|
|
554
|
+
const hero = character({ figure: 'bean', height: 400, hair: { style: 'spiky', color: '#111' },
|
|
555
|
+
bean: { shirt: '#ef4444', trousers: '#1e3a5f' } })
|
|
556
|
+
drawCharacter(ctx, hero, humanPose({ ...HUMAN_POSES.point, ...HUMAN_EXPRESSIONS.happy, turn: 0.5 }))
|
|
557
|
+
const stick = character(castMember('beanStick', 400)) // bare line limbs
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
- Each limb is one smooth curve through its joints, stroked in the ink and
|
|
561
|
+
stroked again, narrower, in the fill, with round caps and joins: elbows and
|
|
562
|
+
knees never show a seam. The front arm, and on a plain figure the neck and
|
|
563
|
+
the legs, join the body without a seam: their outline is left out where it
|
|
564
|
+
lies inside the body at the root, so the fills flow together. Under a tee or
|
|
565
|
+
trousers the hem shows instead.
|
|
566
|
+
- Painter order (`joints.parts[id].order`): the back arm, the legs, the neck,
|
|
567
|
+
the body (and coat), the near arm and the head (and fedora). A limb reaching toward the viewer
|
|
568
|
+
(hands on the knees, seated thighs) draws over the body.
|
|
569
|
+
- `bean: { limbs, torso, limbWidth, lineWidth, outlineWidth, fill, shirt, sleeves, trousers, shoes }`:
|
|
570
|
+
`limbs: 'tube'` (default, outlined noodles) or `'line'` (bare round-capped
|
|
571
|
+
ink lines for the arms, legs and neck; the body, eyes, mittens and shoes
|
|
572
|
+
stay; `halo: '#f5f5f4'` adds a pale edge so they read on a dark set); the
|
|
573
|
+
near arm is in front of the body in both modes; `torso` body fullness
|
|
574
|
+
(1; 1.3 chubby, 0.85 thin); widths as fractions of the height (0.024 tube,
|
|
575
|
+
0.017 line, 0.0105 outline; `lineWidth` on the character also sets the
|
|
576
|
+
outline); `fill` (white); a `shirt` colour with `sleeves: 'short' | 'long' | 'none'`;
|
|
577
|
+
`trousers`; `shoes` (the fill; a dark shoe gets a shine and a dark sole).
|
|
578
|
+
An `outfit`'s `shirt`, `trousers` and `sleeves` colour the bean too (its
|
|
579
|
+
layers are not used).
|
|
580
|
+
- Detective gear: `coat` (a trench coat in that colour: lapels, a belt and
|
|
581
|
+
buckle, double-breasted buttons, a hem at the knee and sleeves to the
|
|
582
|
+
wrist), `fedora` (a brim, a pinched crown and a band) and `shades: true`
|
|
583
|
+
(big dark aviator lenses in place of the eyes, the brows still showing,
|
|
584
|
+
so the face keeps its expression; the same as `face: { shades: true }` on
|
|
585
|
+
any oval-eyed face). `castMember('beanDetective', 400)` wears all three.
|
|
586
|
+
- Defaults: ink `#111111`, white skin, `hands: 'mitten'`, shoulders 0.04 and
|
|
587
|
+
hips 0.02 of the height, `face: { style: 'oval', projection: 'volume', teeth: true, tongue: true }`.
|
|
588
|
+
The bean is always drawn in the clean look (its outline is the look).
|
|
589
|
+
- `face.style: 'oval'` works on any figure: big white oval eyes almost
|
|
590
|
+
touching, a small pupil following `lookX`/`lookY`, lids in the skin for
|
|
591
|
+
`lid`, a blink or a half-open `eye.*`, a lid line when shut (arched up in a
|
|
592
|
+
laugh), heavy brows for `brow.left`/`brow.right` and `browTilt`, and
|
|
593
|
+
bigger eyes for `eye.*` above 1 and `bulge`. Glasses grow to fit round the
|
|
594
|
+
big eyes; `face.shades` puts aviators in their place.
|
|
595
|
+
- `hands: 'mitten'` (any figure) is a plain oval mitten along the forearm.
|
|
596
|
+
- Presets in `BEAN_CAST` (also in `CHARACTER_CAST`, group `bean`):
|
|
597
|
+
`beanMan`, `beanWoman`, `beanKid`, `beanBoss`, `beanDetective` and
|
|
598
|
+
`beanStick` (bare lines).
|
|
599
|
+
- Helpers for your own layers: `beanTorso(bean, joints)` and
|
|
600
|
+
`beanTorsoOutline(torso)` (the body's shape), `beanLimbLine(root, joint, end)`
|
|
601
|
+
(a limb's centre line), `mittenAt`, `beanShoeAt`, `beanOrder`, `beanOverBody`,
|
|
602
|
+
`drawBeanFedora`.
|
|
603
|
+
|
|
543
604
|
### Young adult manga cast
|
|
544
605
|
|
|
545
606
|
`MANGA_CAST` supplies four original archetypes: `mangaYoungMan`,
|
package/docs/editor-guide.md
CHANGED
|
@@ -1143,7 +1143,7 @@ The dialog shows the generated HTML/JavaScript code with a **Copy Code** button.
|
|
|
1143
1143
|
**Steps to embed:**
|
|
1144
1144
|
1. Build the player: `npm run build:player`
|
|
1145
1145
|
2. Copy `lib/player/tinyfly-player.iife.js` to your project (or load
|
|
1146
|
-
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
1146
|
+
`https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.122.0/cdn/tinyfly-player.iife.js`
|
|
1147
1147
|
instead; see [Deployment](DEPLOYMENT.md))
|
|
1148
1148
|
3. Copy the generated code into your HTML
|
|
1149
1149
|
4. Adjust the script `src` path if needed
|
package/docs/examples.md
CHANGED
|
@@ -743,7 +743,7 @@ For simple website embedding without a build system.
|
|
|
743
743
|
</html>
|
|
744
744
|
```
|
|
745
745
|
|
|
746
|
-
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.
|
|
746
|
+
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.122.0/cdn/tinyfly-player.iife.js`.
|
|
747
747
|
|
|
748
748
|
---
|
|
749
749
|
|
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.122.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.122.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
|
@@ -217,6 +217,12 @@ from. The eight presets in `ANIME_CAST` (`animeBoy`, `animeGirl`,
|
|
|
217
217
|
Use `face: { style: 'anime', iris: '#4b7fce', lashes: true, ageLines: 0.6 }`
|
|
218
218
|
for coloured expressive eyes and optional creases; this is a face style,
|
|
219
219
|
not a `look` value. It uses the same expressions, blink, gaze and turn fields.
|
|
220
|
+
White outlined stick figures are `figure: 'bean'` (presets `beanMan`, `beanWoman`,
|
|
221
|
+
`beanKid`, `beanBoss`, `beanDetective`, `beanStick` in `BEAN_CAST`): seamless outlined noodle limbs or bare
|
|
222
|
+
lines (`bean: { limbs: 'tube' | 'line' }`), a shaped body (`bean.torso` fullness), big oval eyes
|
|
223
|
+
(`face.style: 'oval'`, usable on any figure), `hands: 'mitten'` and cartoon shoes; colours from
|
|
224
|
+
`bean: { shirt, sleeves, trousers, shoes }` or an `outfit`; detective gear `bean: { coat, fedora, shades: true }`
|
|
225
|
+
(aviators replace the eyes, brows still show); `halo` gives line limbs a pale edge. A bean is always drawn clean.
|
|
220
226
|
The `look` values are `clean`, `pencil`, `silhouette` and `illustrated`
|
|
221
227
|
(inked and painted, tuned with `illustrated: { light, weight, taper, shadow, highlight }`).
|
|
222
228
|
Age is proportions, hair, creases and clothes, never a stoop; a `cane` in a hand or
|
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.122.0/cdn/tinyfly.iife.js"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.122.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/math.md
CHANGED
|
@@ -258,7 +258,7 @@ lesson's step options (`duration`, `easing`, `delay`).
|
|
|
258
258
|
<figcaption>The determinant is the area of the unit square after the map.</figcaption>
|
|
259
259
|
</figure>
|
|
260
260
|
|
|
261
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
261
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.122.0/cdn/tinyfly-math.iife.js" data-tinyfly-auto></script>
|
|
262
262
|
```
|
|
263
263
|
|
|
264
264
|
The figure draws itself into an SVG and redraws from the timeline whenever the
|
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.122.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
|