@algorisys/tinyfly 0.64.0 → 0.65.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 +59 -11
- package/lib/browser/tinyfly.iife.js +2 -2
- package/lib/browser/tinyfly.js +18 -4
- package/lib/browser/tinyfly.umd.js +2 -2
- package/lib/cli/tools.js +20 -3
- package/lib/embed/tinyfly-embed.iife.js +6 -3
- package/lib/embed/tinyfly-embed.js +437 -408
- package/lib/engine/tinyfly-engine.js +69 -55
- package/lib/engine/tinyfly-engine.umd.cjs +2 -2
- package/lib/player/tinyfly-player.es.js +86 -72
- package/lib/player/tinyfly-player.iife.js +2 -2
- package/lib/player/tinyfly-player.umd.js +2 -2
- package/lib/types/embed/controls.d.ts +5 -0
- package/lib/types/embed/mount.d.ts +2 -1
- package/lib/types/engine/core/timeline.d.ts +7 -2
- package/lib/types/player/player.d.ts +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# tinyfly
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@algorisys/tinyfly)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
3
6
|
A lightweight, API-driven animation engine and visual editor for creating high-performance, embeddable animations.
|
|
4
7
|
|
|
8
|
+
**Try it:** [studio](https://tinyfly.app/studio) · [interactive course](https://tinyfly.app/learn) · [examples](https://tinyfly.app/examples) · `npm install @algorisys/tinyfly`
|
|
9
|
+
|
|
5
10
|
**GSAP-level power with Excalidraw-level simplicity.**
|
|
6
11
|
|
|
7
12
|
## Features
|
|
@@ -14,7 +19,7 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
|
|
|
14
19
|
|
|
15
20
|
### Animation Capabilities
|
|
16
21
|
- **Timeline-based** - Orchestrate multiple tracks with precise timing
|
|
17
|
-
- **Rich easing** - Linear, quad, cubic, custom cubic-bezier, and
|
|
22
|
+
- **Rich easing** - Linear, quad, cubic, custom cubic-bezier, and parametric `elastic` / `bounce` / `back` / `steps` eases that stay one small, exact keyframe in JSON
|
|
18
23
|
- **Interpolation** - Numbers, colors, and arrays
|
|
19
24
|
- **Playback control** - Play, pause, stop, seek, reverse, speed adjustment
|
|
20
25
|
- **Looping** - Finite loops, infinite loops, ping-pong (alternate), and `repeatDelay` between iterations
|
|
@@ -30,6 +35,13 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
|
|
|
30
35
|
- **Drag & pointer input** - `Observer` normalises pointer/touch/wheel; `Draggable` supports bounds, axis lock, grid/edge snapping (shared with the editor stage), and drag-to-scrub
|
|
31
36
|
- **FLIP transitions** - `flip()` measures a layout change in the DOM layer and emits ordinary keyframes, keeping the engine free of live layout reads
|
|
32
37
|
|
|
38
|
+
### Teaching Animations
|
|
39
|
+
- **Markers and captions in the JSON** - Named steps (`pause`, `question` for predict-then-reveal) and captions per language, kept out of the tracks so translation never touches timing
|
|
40
|
+
- **A player that teaches** - Shows a real frame on load, steps between markers (`next` / `prev` / `stepMode`), respects `prefers-reduced-motion`, and pauses off screen
|
|
41
|
+
- **One-script embeds** - `tinyfly-embed.iife.js` with `data-tinyfly-auto` mounts every `[data-tinyfly-embed]` figure with step controls, announced captions and an accessible SVG, with no per-post JavaScript
|
|
42
|
+
- **Authoring kit** - `lesson()` step builder and diagram primitives (array cells, pointer, stack, queue / channel, table, pipeline) in `@algorisys/tinyfly/teach`
|
|
43
|
+
- **Build tools** - `npx @algorisys/tinyfly validate` catches broken figures in CI; `render` writes a frame to static SVG for RSS, email and print
|
|
44
|
+
|
|
33
45
|
### Render Adapters
|
|
34
46
|
- **DOM** - CSS transforms, opacity, colors, clip-path reveal, filters, shine, transform-origin, perspective
|
|
35
47
|
- **Canvas** - Shapes with position, size, rotation, colors, clip reveal, filters, transform-origin pivot
|
|
@@ -106,6 +118,8 @@ A lightweight, API-driven animation engine and visual editor for creating high-p
|
|
|
106
118
|
- [Examples](docs/examples.md) — Code examples for common animation patterns
|
|
107
119
|
- [Scroll Animation](docs/scroll-animation.md) — Scroll-driven and visibility-triggered playback via drivers
|
|
108
120
|
- [GSAP Compatibility](docs/gsap-compat.md) — The GSAP-flavoured API, the mapping table, and what we deliberately don't do
|
|
121
|
+
- [Teaching Animations](docs/teaching.md) — Step-through figures: markers, captions, the stepping player, controls, declarative embeds, `tinyfly/teach`, validate and render
|
|
122
|
+
- [Extending tinyfly](docs/extending.md) — Writing adapters, custom eases and stagger offsets, adding a track kind, contributing examples
|
|
109
123
|
- [Deployment](docs/DEPLOYMENT.md) — Hosting, Docker, and CDN configuration
|
|
110
124
|
- [2D Animation Roadmap](docs/2d-animation-roadmap.md) — Adobe Animate gap analysis and phased plan (symbols/library, camera, onion skinning, …)
|
|
111
125
|
|
|
@@ -179,7 +193,7 @@ GitHub. No npm required.
|
|
|
179
193
|
GSAP-shaped functions at the top level:
|
|
180
194
|
|
|
181
195
|
```html
|
|
182
|
-
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.
|
|
196
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.65.0/cdn/tinyfly.iife.js"></script>
|
|
183
197
|
<script>
|
|
184
198
|
tinyfly.to('.box', { x: 200, rotate: 90, duration: 1, ease: 'power2.out' })
|
|
185
199
|
|
|
@@ -363,6 +377,14 @@ Custom cubic-bezier easing:
|
|
|
363
377
|
}
|
|
364
378
|
```
|
|
365
379
|
|
|
380
|
+
Parametric eases, evaluated exactly when played:
|
|
381
|
+
```typescript
|
|
382
|
+
{ type: 'elastic', mode: 'out', amplitude: 1, period: 0.3 }
|
|
383
|
+
{ type: 'bounce', mode: 'in-out' }
|
|
384
|
+
{ type: 'back', mode: 'out', overshoot: 1.70158 }
|
|
385
|
+
{ type: 'steps', count: 5, position: 'end' } // CSS steps() jump positions
|
|
386
|
+
```
|
|
387
|
+
|
|
366
388
|
### Player
|
|
367
389
|
|
|
368
390
|
```typescript
|
|
@@ -379,6 +401,23 @@ player.pause();
|
|
|
379
401
|
player.seek(500);
|
|
380
402
|
player.setSpeed(2);
|
|
381
403
|
player.destroy();
|
|
404
|
+
|
|
405
|
+
// Teaching: markers, steps and captions
|
|
406
|
+
const lessonPlayer = new TinyflyPlayer('#figure', { stepMode: true, playWhenVisible: true });
|
|
407
|
+
await lessonPlayer.load('slice.json'); // shows the first frame straight away
|
|
408
|
+
lessonPlayer.next(); // animate to the next marker
|
|
409
|
+
lessonPlayer.prev(); // jump back a step
|
|
410
|
+
lessonPlayer.caption(); // the current step's caption, in the page's language
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
Or skip the code entirely with declarative embeds (see [Teaching Animations](docs/teaching.md)):
|
|
414
|
+
|
|
415
|
+
```html
|
|
416
|
+
<figure data-tinyfly-embed data-options='{"stepMode": true}'>
|
|
417
|
+
<svg viewBox="0 0 720 200">…</svg>
|
|
418
|
+
<script type="application/json" data-tinyfly-timeline>{ …timeline JSON… }</script>
|
|
419
|
+
</figure>
|
|
420
|
+
<script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.65.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
|
|
382
421
|
```
|
|
383
422
|
|
|
384
423
|
### Audio / Video Sync
|
|
@@ -559,7 +598,7 @@ tinyfly/
|
|
|
559
598
|
- [x] Visual curve editor for custom easing
|
|
560
599
|
- [x] npm engine package + CDN player build (`npm run build:libs`)
|
|
561
600
|
- [x] All-in-one `<script>` bundle with a GSAP-shaped `tinyfly` global, and `live.to()` that plays on real elements
|
|
562
|
-
- [
|
|
601
|
+
- [x] Publish to npm as [`@algorisys/tinyfly`](https://www.npmjs.com/package/@algorisys/tinyfly)
|
|
563
602
|
|
|
564
603
|
### Future
|
|
565
604
|
- [x] Scene transitions (fade, slide between scenes)
|
|
@@ -591,9 +630,12 @@ tinyfly/
|
|
|
591
630
|
- [x] Inertia / throw as an `inertia` track kind
|
|
592
631
|
- [x] Text tracks: type-on and scramble text
|
|
593
632
|
- [x] CustomEase, CustomBounce, CustomWiggle
|
|
594
|
-
- [
|
|
633
|
+
- [x] Framework wrappers (`@algorisys/tinyfly/react`, `/vue`, `/svelte`, `/solid`)
|
|
595
634
|
- [x] Scroll pinning (`scrollTrigger: { pin }`), split text, drawSVG, springs and shared-element Flip on `live` ([Phase 28](todo.md))
|
|
596
635
|
- [x] Interactive tutorial at `/learn` — 9 modules from keyframes to an award-style landing page, checked in three browsers ([Phase 29](todo.md))
|
|
636
|
+
- [x] GSAP parity: native eases, `live.utils`, keyframes, grid staggers, rotation dragging, scroll batch / scroll-to, smooth scrolling, timeline callbacks ([Phase 29E](todo.md))
|
|
637
|
+
- [x] Teaching embeds: markers, captions, stepping player, controls, declarative mounting, `tinyfly/teach`, validate / render ([Phase 30](todo.md))
|
|
638
|
+
- [ ] Editor UI for markers and captions
|
|
597
639
|
- [ ] Nested timelines at runtime, explicit track priority
|
|
598
640
|
- [ ] React Native adapter
|
|
599
641
|
- [ ] Collaborative editing
|
|
@@ -633,8 +675,12 @@ results rather than just looking for errors:
|
|
|
633
675
|
motion-path precision.
|
|
634
676
|
- **Editor:** adding elements, playing in all three renderers, and IndexedDB
|
|
635
677
|
persistence across a reload.
|
|
678
|
+
- **Site:** the landing page, docs, every example page, the showcases (pins, smooth
|
|
679
|
+
scrolling, parallax, reduced motion) and every course step.
|
|
680
|
+
- **Embeds:** keyboard stepping in the focused figure only, captions in the page
|
|
681
|
+
language, SVG paint, labelled images, play-when-visible and reduced motion.
|
|
636
682
|
|
|
637
|
-
Latest run: Chromium 150, Firefox 153 and WebKit 26.5 pass
|
|
683
|
+
Latest run: Chromium 150, Firefox 153 and WebKit 26.5 pass every check. In WebKit
|
|
638
684
|
on Linux, MP4 export is reported as a note: Playwright's WebKit build crashes while
|
|
639
685
|
starting its bundled GStreamer, before tinyfly's code runs. WebKit needs `libavif16`
|
|
640
686
|
on Linux hosts, and the runner removes the GTK/GIO variables a snap-installed
|
|
@@ -643,18 +689,20 @@ load.
|
|
|
643
689
|
|
|
644
690
|
### Test Coverage
|
|
645
691
|
|
|
646
|
-
`npm test` runs 1,
|
|
692
|
+
`npm test` runs 1,999 unit tests in 121 files, all passing:
|
|
647
693
|
|
|
648
694
|
| Area | Tests |
|
|
649
695
|
|---|---|
|
|
650
|
-
| Engine (`src/engine`: timeline, easing, paths, text, exports, serialization) |
|
|
696
|
+
| Engine (`src/engine`: timeline, easing, paths, text, exports, serialization) | 521 |
|
|
651
697
|
| Editor (`src/editor`: stores, utils, presets, AI, samples) | 393 |
|
|
652
|
-
|
|
|
653
|
-
| GSAP-style
|
|
698
|
+
| GSAP-style API (`src/compat/gsap`) | 328 |
|
|
699
|
+
| Examples page, GSAP-style demos and showcases (`src/examples`) | 235 |
|
|
654
700
|
| Render adapters (`src/adapters`) | 134 |
|
|
655
|
-
|
|
|
656
|
-
| Drivers and interaction (`src/drivers`, `src/interaction`) |
|
|
701
|
+
| Interactive course (`src/learn`) | 129 |
|
|
702
|
+
| Drivers and interaction (`src/drivers`, `src/interaction`) | 136 |
|
|
703
|
+
| Player, media sync, sequencer and teaching (`src/player`) | 92 |
|
|
657
704
|
| Docs viewer and `llms.txt` (`src/docs`) | 14 |
|
|
705
|
+
| Embeds, teaching kit, framework hooks, landing (`src/embed`, `src/teach`, `src/frameworks`, `src/landing`) | 17 |
|
|
658
706
|
|
|
659
707
|
## Contributing
|
|
660
708
|
|