pixi-effects 0.1.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/LICENSE +21 -0
- package/README.md +89 -0
- package/dist/Controller.cjs +940 -0
- package/dist/Controller.cjs.map +1 -0
- package/dist/Controller.d.cts +109 -0
- package/dist/Controller.d.ts +109 -0
- package/dist/Controller.js +933 -0
- package/dist/Controller.js.map +1 -0
- package/dist/Movie-Bp66rkaC.d.cts +364 -0
- package/dist/Movie-Bp66rkaC.d.ts +364 -0
- package/dist/index.cjs +3045 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +79 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +3023 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tefista
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# pixi-effects
|
|
2
|
+
|
|
3
|
+
> **Status**: v0.1.0. API stable; semver from here.
|
|
4
|
+
|
|
5
|
+
**[Live demos →](https://yjmtmtk.github.io/pixi-effects/)** · 8 numbered examples + an in-browser playground.
|
|
6
|
+
|
|
7
|
+
Declarative composition and video rendering for the web. After Effects-style timelines on top of [PixiJS v8](https://pixijs.com/) and [GSAP](https://gsap.com/), with strict TypeScript types. Render to MP4 / WebM / MOV via [mediabunny](https://mediabunny.dev/).
|
|
8
|
+
|
|
9
|
+
- **Declarative DSL** — describe your composition as a tree of typed sequences (text, image, video, audio, nested compositions). No imperative tween code.
|
|
10
|
+
- **Expression language** — sprinkle `'GW * 0.5'` or `'min(W, H) / 2'` anywhere a number goes. Resolved at runtime against a sequence-relative scope.
|
|
11
|
+
- **Filters** — chroma key, blur, color matrix. Animatable per-keyframe.
|
|
12
|
+
- **Built-in player UI** — drop-in HTML5-`<video>`-style overlay controller (play, scrub, mute, volume, fullscreen, export-to-file).
|
|
13
|
+
- **MP4 / WebM / MOV export** — pick container and quality from the controller, or call `movie.render()` from code.
|
|
14
|
+
- **Tiny dependency surface** — only `mediabunny` (runtime) plus PixiJS and GSAP (peer deps).
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install pixi-effects pixi.js gsap
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quickstart
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { Movie } from 'pixi-effects';
|
|
26
|
+
import { Controller } from 'pixi-effects/controller';
|
|
27
|
+
|
|
28
|
+
const canvas = document.querySelector('canvas')!;
|
|
29
|
+
const movie = new Movie();
|
|
30
|
+
new Controller(movie, { canvas });
|
|
31
|
+
|
|
32
|
+
await movie.init({
|
|
33
|
+
canvas,
|
|
34
|
+
width: 1280, height: 720, duration: 5, frameRate: 30,
|
|
35
|
+
composition: {
|
|
36
|
+
sequences: [
|
|
37
|
+
{
|
|
38
|
+
type: 'text',
|
|
39
|
+
text: 'hello pixi-effects',
|
|
40
|
+
initial: { x: 'GW/2', y: 'GH/2', anchorX: 0.5, anchorY: 0.5 },
|
|
41
|
+
keyframes: [
|
|
42
|
+
{ at: 0, from: { alpha: 0, scale: 0 }, to: { alpha: 1, scale: 1 }, duration: 0.6, ease: 'back.out(1.7)' },
|
|
43
|
+
{ at: -0.5, to: { alpha: 0 }, duration: 0.5 },
|
|
44
|
+
],
|
|
45
|
+
style: { fontSize: 'GW * 0.05', fill: '#ffffff', fontFamily: 'Arial' },
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`movie.play()` starts playback. The controller bar handles user input. To export from code:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const blob = await movie.render({ format: 'mp4' });
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Documentation
|
|
59
|
+
|
|
60
|
+
- [**DSL reference**](./docs/dsl.md) — composition, sequences, keyframes, expressions, filters
|
|
61
|
+
- [**API reference**](./docs/api.md) — `Movie`, `Controller`, events, render options
|
|
62
|
+
- [**Examples**](./examples/) — runnable HTML files (read in order):
|
|
63
|
+
- `01-hello.html` — minimum viable composition
|
|
64
|
+
- `02-keyframes.html` — keyframes, easings, expressions
|
|
65
|
+
- `03-shapes.html` — every shape primitive
|
|
66
|
+
- `04-media.html` — image / video / audio
|
|
67
|
+
- `05-composition-mask.html` — nested compositions and masks
|
|
68
|
+
- `06-filters.html` — built-in and pixi-filters via `{ type: 'custom' }`
|
|
69
|
+
- `07-transitions.html` — all seven transition kinds in one timeline
|
|
70
|
+
- `08-presets-export.html` — `kenBurns` preset and `movie.render()` from code
|
|
71
|
+
- `09-audio.html` — multi-track audio mixing with BGM ducking and SFX cues
|
|
72
|
+
- `playground.html` — in-browser editor with preset dropdown
|
|
73
|
+
|
|
74
|
+
## Browser support
|
|
75
|
+
|
|
76
|
+
Rendering uses the [WebCodecs API](https://developer.mozilla.org/docs/Web/API/WebCodecs_API) via mediabunny:
|
|
77
|
+
|
|
78
|
+
| Feature | Chrome 94+ | Edge 94+ | Safari 16.4+ | Firefox 130+ |
|
|
79
|
+
| --------- | ---------- | -------- | ------------ | ------------ |
|
|
80
|
+
| Playback | ✅ | ✅ | ✅ | ✅ |
|
|
81
|
+
| MP4 (avc) | ✅ | ✅ | ✅ | ✅ |
|
|
82
|
+
| WebM (vp9)| ✅ | ✅ | ✅ | ✅ |
|
|
83
|
+
| MOV (avc) | ✅ | ✅ | ✅ | ✅ |
|
|
84
|
+
|
|
85
|
+
Some codecs (notably `aac` audio in older Firefox) may need the [mediabunny polyfill encoders](https://mediabunny.dev/) (`@mediabunny/aac-encoder`, etc.).
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT — see [LICENSE](./LICENSE).
|