reacthub-pixitweenjs 0.2.109-alpha.3 → 0.2.109-alpha.5

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 CHANGED
@@ -1,61 +1,415 @@
1
- <h1 align="center">
2
- Welcome to Reacthub PixiTweenJS
3
- </h1>
1
+ <div align="center">
4
2
 
5
- To install the component packages using NPM/ Yarn:
3
+ # ✨ Reacthub PixiTweenJS ✨
6
4
 
7
- ```js
8
- npm install reacthub-pixitweenjs
5
+ **A powerful library for creating stunning animated, time-controlled canvas elements in React using PixiJS, GSAP, and more**
6
+
7
+ [![npm version](https://img.shields.io/npm/v/reacthub-pixitweenjs.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/reacthub-pixitweenjs)
8
+ [![npm downloads](https://img.shields.io/npm/dm/reacthub-pixitweenjs.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/reacthub-pixitweenjs)
9
+ [![license](https://img.shields.io/npm/l/reacthub-pixitweenjs.svg?style=for-the-badge)](LICENSE.md)
10
+ [![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
11
+ [![React](https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB)](https://reactjs.org/)
12
+ [![PixiJS](https://img.shields.io/badge/PixiJS-4A90E2?style=for-the-badge&logo=pixijs&logoColor=white)](https://pixijs.com/)
13
+ [![GSAP](https://img.shields.io/badge/GSAP-88CE02?style=for-the-badge&logo=gsap&logoColor=white)](https://greensock.com/gsap/)
14
+
15
+ <br>
16
+
17
+ <pre>
18
+ ╔═══════════════════════════════════════════════════════════════════════════════╗
19
+ ║ ║
20
+ ║ ██████╗ ██╗██╗ ██╗██╗████████╗███████╗██╗ ██╗███████╗██████╗ ███╗ ║
21
+ ║ ██╔══██╗██║╚██╗██╔╝██║╚══██╔══╝██╔════╝██║ ██║██╔════╝██╔══██╗████╗ ║
22
+ ║ ██████╔╝██║ ╚███╔╝ ██║ ██║ █████╗ ██║ █╗ ██║█████╗ ██████╔╝██╔██╗ ║
23
+ ║ ██╔═══╝ ██║ ██╔██╗ ██║ ██║ ██╔══╝ ██║███╗██║██╔══╝ ██╔══██╗██║╚██╗║
24
+ ║ ██║ ██║██╔╝ ██╗██║ ██║ ███████╗╚███╔███╔╝███████╗██║ ██║██║ ╚█║║
25
+ ║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚══════╝ ╚══╝╚══╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝║
26
+ ║ ║
27
+ ║ 🎬 Timeline-based animations | ⚡ WebGL powered | 🎨 Interactive ║
28
+ ║ ║
29
+ ╚═══════════════════════════════════════════════════════════════════════════════╝
30
+ </pre>
31
+
32
+ **[📖 Documentation](https://pixitweenjs.xyz/)** • **[🎮 Live Demo](https://pixitweenjs.xyz/)** • **[💬 Issues](https://github.com/khanzzirfan/reacthub-pixitweenjs/issues)** • **[🤝 Contributing](Contribution.md)**
33
+
34
+ </div>
35
+
36
+ ---
37
+
38
+ ## 🌟 **Features**
39
+
40
+ <div align="center">
41
+
42
+ | Feature | Description |
43
+ | :--------------------------: | --------------------------------------------------- |
44
+ | 🎬 **Timeline Control** | Precise start/end time control for all elements |
45
+ | ⚡ **High Performance** | WebGL-accelerated rendering with PixiJS |
46
+ | 🎨 **Rich Media Support** | Images, Videos, Audio, GIFs, SVG, Lottie animations |
47
+ | ✏️ **Interactive Text** | Advanced typography with custom styling & effects |
48
+ | 🔄 **GSAP Integration** | Professional-grade animations & transitions |
49
+ | 🎛️ **Visual Transformation** | Drag, rotate, scale with intuitive transformer |
50
+ | 🎨 **Color Correction** | Temperature, HSL, blur, vignette & more filters |
51
+ | 🎭 **Particle Effects** | Build stunning visual effects |
52
+ | 🔊 **Audio Visualization** | Real-time waveform rendering |
53
+ | 📱 **Responsive** | Works seamlessly across devices |
54
+ | 🔧 **TypeScript** | Full type safety & IntelliSense |
55
+ | 🎯 **Composable** | Modular components for flexibility |
56
+
57
+ </div>
58
+
59
+ ---
60
+
61
+ ## 🚀 **Quick Start**
62
+
63
+ ### Installation
64
+
65
+ ```bash
66
+ npm install reacthub-pixitweenjs
67
+ ```
68
+
69
+ or
70
+
71
+ ```bash
72
+ yarn add reacthub-pixitweenjs
73
+ ```
74
+
75
+ ### Required Dependencies
76
+
77
+ Make sure to install these peer dependencies:
78
+
79
+ ```bash
80
+ npm install \
81
+ @pixi/gif@^2.1.0 \
82
+ @pixi/react@~7.1.0 \
83
+ @pixi/sound@^5.2.1 \
84
+ pixi-filters@^5.2.1 \
85
+ pixi-svg@^3.2.0 \
86
+ pixi.js@^7.2.3 \
87
+ gsap@3.11.5 \
88
+ howler@^2.2.3 \
89
+ lottie-web@^5.10.2 \
90
+ react-custom-events@^1.1.1 \
91
+ react@^18.2.0 \
92
+ react-dom@^18.2.0
93
+ ```
94
+
95
+ ### Basic Example
96
+
97
+ ```tsx
98
+ import React from "react";
99
+ import { GsapPixieContextProvider } from "reacthub-pixitweenjs";
100
+ import { PixiStage } from "reacthub-pixitweenjs";
101
+ import { PixiSequence } from "reacthub-pixitweenjs";
102
+ import { PixiImageSprite } from "reacthub-pixitweenjs";
103
+
104
+ function MyAnimatedScene() {
105
+ return (
106
+ <GsapPixieContextProvider>
107
+ <PixiStage
108
+ width={1920}
109
+ height={1080}
110
+ options={{ backgroundColor: 0x2d2e3c }}
111
+ >
112
+ <PixiSequence startAt={0} endAt={10}>
113
+ <PixiImageSprite
114
+ uniqueId="hero-image"
115
+ src="https://example.com/image.jpg"
116
+ transformation={{
117
+ x: 960,
118
+ y: 540,
119
+ width: 800,
120
+ height: 600,
121
+ anchor: 0.5,
122
+ alpha: 1,
123
+ }}
124
+ startAt={0}
125
+ endAt={10}
126
+ />
127
+ </PixiSequence>
128
+ </PixiStage>
129
+ </GsapPixieContextProvider>
130
+ );
131
+ }
132
+ ```
133
+
134
+ ---
135
+
136
+ ## 🎯 **Core Components**
137
+
138
+ ### 🖼️ **PixiImageSprite**
139
+
140
+ Display images with advanced transformations and filters.
141
+
142
+ ```tsx
143
+ <PixiImageSprite
144
+ src="path/to/image.jpg"
145
+ transformation={{
146
+ x: 100,
147
+ y: 100,
148
+ width: 400,
149
+ height: 300,
150
+ anchor: 0.5,
151
+ rotation: 0,
152
+ alpha: 1,
153
+ scale: 1,
154
+ colorCorrection: {
155
+ temperature: 6500,
156
+ contrast: 1,
157
+ saturation: 1,
158
+ blurRadius: 0,
159
+ },
160
+ }}
161
+ startAt={0}
162
+ endAt={5}
163
+ />
164
+ ```
165
+
166
+ ### 🎬 **PixiVideoSprite**
167
+
168
+ Seamlessly integrate video with GSAP timeline synchronization.
169
+
170
+ ```tsx
171
+ <PixiVideoSprite
172
+ src="path/to/video.mp4"
173
+ transformation={{ x: 0, y: 0, width: 1920, height: 1080, anchor: 0 }}
174
+ startAt={0}
175
+ endAt={30}
176
+ />
177
+ ```
178
+
179
+ ### 🎵 **PixiAudioSprite**
180
+
181
+ Audio playback with real-time visualization support.
182
+
183
+ ```tsx
184
+ <PixiAudioSprite
185
+ src="path/to/audio.mp3"
186
+ startAt={0}
187
+ endAt={20}
188
+ showWaveform={true}
189
+ />
190
+ ```
191
+
192
+ ### ✏️ **PixiTextSprite**
193
+
194
+ Rich typography with custom fonts, colors, and effects.
195
+
196
+ ```tsx
197
+ <PixiTextSprite
198
+ text="Hello, World!"
199
+ transformation={{
200
+ x: 500,
201
+ y: 300,
202
+ width: 400,
203
+ height: 100,
204
+ anchor: 0.5,
205
+ fontSize: 48,
206
+ fontFamily: "Arial",
207
+ fill: 0xffffff,
208
+ stroke: 0x000000,
209
+ strokeThickness: 2,
210
+ }}
211
+ startAt={0}
212
+ endAt={10}
213
+ />
214
+ ```
215
+
216
+ ### 🎨 **PixiSVGSprite**
217
+
218
+ Vector graphics with full transformation support.
219
+
220
+ ```tsx
221
+ <PixiSVGSprite
222
+ svgPath="M10,10 L100,10 L100,100 Z"
223
+ fill={0xff5733}
224
+ transformation={{ x: 200, y: 200, width: 100, height: 100, anchor: 0.5 }}
225
+ startAt={0}
226
+ endAt={10}
227
+ />
228
+ ```
229
+
230
+ ### 🎪 **PixiGifSprite & PixiLottieSprite**
231
+
232
+ Animated GIFs and Lottie animations.
233
+
234
+ ```tsx
235
+ <PixiGifSprite
236
+ src="animation.gif"
237
+ transformation={{ x: 400, y: 400, width: 200, height: 200, anchor: 0.5 }}
238
+ startAt={0}
239
+ endAt={15}
240
+ />
241
+
242
+ <PixiLottieSprite
243
+ src="animation.json"
244
+ transformation={{ x: 600, y: 400, width: 300, height: 300, anchor: 0.5 }}
245
+ startAt={0}
246
+ endAt={10}
247
+ />
248
+ ```
249
+
250
+ ### 🔄 **PixiSequence**
251
+
252
+ Time-based composition and sequencing.
253
+
254
+ ```tsx
255
+ <PixiSequence startAt={0} endAt={30}>
256
+ <PixiImageSprite ... />
257
+ <PixiTextSprite ... />
258
+ <PixiVideoSprite ... />
259
+ </PixiSequence>
260
+ ```
261
+
262
+ ### 🎛️ **PixiTransformer**
263
+
264
+ Interactive element manipulation with visual handles.
265
+
266
+ ```tsx
267
+ <PixiTransformer
268
+ pixiTransformerRef={transformerRef}
269
+ imageRef={imageRef}
270
+ transformCommit={handleTransform}
271
+ transformChange={handleChange}
272
+ />
273
+ ```
274
+
275
+ ---
276
+
277
+ ## 🎨 **Advanced Features**
278
+
279
+ ### 🎞️ Timeline Composition
280
+
281
+ Create complex animations with precise timing:
282
+
283
+ ```tsx
284
+ <PixiSequenceWrapper startAt={0} endAt={30}>
285
+ {/* Intro Sequence */}
286
+ <PixiSequence startAt={0} endAt={5}>
287
+ <PixiImageSprite startAt={0} endAt={5} ... />
288
+ </PixiSequence>
289
+
290
+ {/* Main Content */}
291
+ <PixiSequence startAt={5} endAt={25}>
292
+ <PixiVideoSprite startAt={5} endAt={25} ... />
293
+ <PixiTextSprite startAt={10} endAt={20} ... />
294
+ </PixiSequence>
295
+
296
+ {/* Outro Sequence */}
297
+ <PixiSequence startAt={25} endAt={30}>
298
+ <PixiImageSprite startAt={25} endAt={30} ... />
299
+ </PixiSequence>
300
+ </PixiSequenceWrapper>
9
301
  ```
10
302
 
11
- ```js
12
- yarn add reacthub-pixitweenjs
303
+ ### 🎨 Color Correction & Effects
304
+
305
+ Professional-grade image manipulation:
306
+
307
+ ```tsx
308
+ transformation={{
309
+ colorCorrection: {
310
+ temperature: 6500, // White balance
311
+ contrast: 1.2, // Contrast adjustment
312
+ saturation: 1.5, // Color saturation
313
+ exposure: 0, // Brightness exposure
314
+ hue: 0, // Hue shift
315
+ blurRadius: 0, // Gaussian blur
316
+ sharpness: 1, // Edge sharpness
317
+ vignette: 0 // Vignette effect
318
+ },
319
+ effect: {
320
+ // Add particle effects, glows, etc.
321
+ }
322
+ }}
13
323
  ```
14
324
 
15
- Make sure you install the devDependencies in your project.
325
+ ### 🔄 GSAP Animation Integration
326
+
327
+ Leverage the full power of GSAP:
328
+
329
+ ```tsx
330
+ const { tl } = useContext(GsapPixieContext);
16
331
 
17
- ```js
18
- npm install
19
- "@pixi/gif": "^2.1.0",
20
- "@pixi/react": "~7.1.0",
21
- "@pixi/sound": "^5.2.1",
22
- "pixi-filters": "^5.2.1",
23
- "pixi-svg": "^3.2.0",
24
- "pixi.js": "^7.2.3",
25
- "gsap": "3.11.5",
26
- "howler": "^2.2.3",
27
- "lottie-web": "^5.10.2",
28
- "react-custom-events": "^1.1.1",
332
+ // Access the master timeline
333
+ tl.to(spriteRef, {
334
+ x: 1000,
335
+ y: 500,
336
+ rotation: 360,
337
+ duration: 5,
338
+ });
29
339
  ```
30
340
 
31
- ## Description
341
+ ---
342
+
343
+ ## 📚 **Documentation & Resources**
344
+
345
+ - **[📖 Complete Documentation](https://pixitweenjs.xyz/)** - Interactive Storybook docs
346
+ - **[🎮 Live Playground](https://pixitweenjs.xyz/)** - Try it online
347
+ - **[💡 Installation Guide](https://pixitweenjs.xyz/?path=/docs/getting-started-installation--docs)**
348
+ - **[🎬 Examples](https://pixitweenjs.xyz/?path=/docs/components-imagesprite--docs)**
349
+
350
+ ---
351
+
352
+ ## 🤝 **Contributing**
353
+
354
+ We welcome contributions! Please read our [Contributing Guide](Contribution.md) before submitting PRs.
355
+
356
+ ---
357
+
358
+ ## 📄 **License**
359
+
360
+ This library is licensed under the **Apache License 2.0** with additional terms. See [LICENSE.md](LICENSE.md) for complete terms.
361
+
362
+ > **📋 Quick Reference:** Apache 2.0 is an open-source license that allows commercial use, modification, distribution, patent use, private use, and sublicensing. See the full license for all terms and additional restrictions.
363
+
364
+ ### What You Can Do
365
+
366
+ ✅ **Permitted:**
367
+
368
+ - ✅ Commercial use in any project
369
+ - ✅ Modify and adapt the code
370
+ - ✅ Distribute and sublicense
371
+ - ✅ Private and internal use
372
+ - ✅ Patent grant included
373
+ - ✅ Place warranty
374
+
375
+ ❌ **Additional Restrictions:**
376
+
377
+ - ❌ Must include copyright notice
378
+ - ❌ Cannot remove attribution
379
+ - ❌ Must include license file
380
+ - ❌ Commercial deployments should notify author
381
+
382
+ ### Commercial Use
383
+
384
+ Apache 2.0 allows commercial use. However, for large-scale enterprise deployments or white-label products, we recommend contacting **reacthub.ai@gmail.com** to discuss licensing options and potential support arrangements.
32
385
 
33
- PixiTweenJs is designed to help you build animated time-controlled canvas elements on web apps using extensible Pixijs Components underneath. The package composes the reacthub/pixitweenjs Web Component package. You can use these Web Components flexibly, either from npm packages, from the CDN, or you can bring it into your project to customize and extend it.
386
+ ---
34
387
 
35
- ## Usage
388
+ ## 🌟 **Inspired By**
36
389
 
37
- Visit the [storybook](https://pixitweenjs.xyz/)
390
+ - **[editly](https://github.com/mifi/editly)** - Declarative video API
391
+ - **[remotion](https://github.com/remotion-dev/remotion)** - Create videos with React
38
392
 
39
- ## Documentation
393
+ ---
40
394
 
41
- ## License
395
+ ## 📊 **Stats**
42
396
 
43
- This library is licensed under the MIT License. See the LICENSE.md file for details.
397
+ <div align="center">
44
398
 
45
- Note: This library comes with restrictions. You are not allowed to copy, modify, or sell this library or any derivative work on behalf of the original author. Usage is permitted only under the terms specified in the license.
399
+ ![GitHub stars](https://img.shields.io/github/stars/khanzzirfan/reacthub-pixitweenjs?style=for-the-badge&logo=github)
400
+ ![GitHub forks](https://img.shields.io/github/forks/khanzzirfan/reacthub-pixitweenjs?style=for-the-badge&logo=github)
401
+ ![GitHub issues](https://img.shields.io/github/issues/khanzzirfan/reacthub-pixitweenjs?style=for-the-badge&logo=github)
46
402
 
47
- For example:
403
+ </div>
48
404
 
49
- - Allowed: Use in personal and non-commercial projects.
50
- - Not Allowed: Copying, modification, or commercial use without explicit permission.
405
+ ---
51
406
 
52
- ## Contributing
407
+ <div align="center">
53
408
 
54
- Want to contribute to pixitweenjs? Our [contributing guide](Contribution.md) has you covered.
409
+ ### **Made with ❤️ in 🇦🇺 Australia**
55
410
 
56
- ## See also
411
+ **Built for developers who create beautiful, interactive experiences**
57
412
 
58
- - [editly](https://github.com/mifi/editly) - Declarative video API I also created earlier
59
- - [remotion](https://github.com/remotion-dev/remotion) - Great inspiration
413
+ [⬆ Back to Top](#-reacthub-pixitweenjs-)
60
414
 
61
- Made with ❤️ in 🇦🇺
415
+ </div>
@@ -1,3 +1,4 @@
1
+ import { Effects } from '../types/Effects';
1
2
  import * as PIXI from "pixi.js";
2
3
  import * as PixiFilters from "pixi-filters";
3
4
  export interface FiltersProps {
@@ -17,13 +18,22 @@ export interface FiltersProps {
17
18
  noise?: number;
18
19
  outline?: number;
19
20
  outlineColor?: number;
21
+ effect?: Effects;
20
22
  }
21
23
  export declare const withFiltersHook: (props: FiltersProps) => {
22
24
  adjustmentFilter: PixiFilters.AdjustmentFilter;
23
25
  blurFilter: PixiFilters.KawaseBlurFilter;
24
- hueFilter: PIXI.ColorMatrixFilter;
26
+ hslFilter: PixiFilters.HslAdjustmentFilter;
25
27
  sharpnessFilter: PixiFilters.ConvolutionFilter;
26
- temperatureFilter: PIXI.Filter;
28
+ temperatureFilter: PIXI.ColorMatrixFilter;
27
29
  vignetteFilter: PixiFilters.OldFilmFilter;
28
30
  noiseFilter: PIXI.NoiseFilter;
31
+ effectFilter: PixiFilters.HslAdjustmentFilter | PIXI.ColorMatrixFilter | PixiFilters.OldFilmFilter | (PIXI.ColorMatrixFilter | PixiFilters.GlowFilter)[] | null;
32
+ blackAndWhiteFilter: PixiFilters.HslAdjustmentFilter;
33
+ sepiaFilter: PIXI.ColorMatrixFilter;
34
+ retroVintageFilter: PIXI.ColorMatrixFilter;
35
+ nightVisionFilter: PixiFilters.GlowFilter;
36
+ nightVisionColorMatrix: PIXI.ColorMatrixFilter;
37
+ cyanFilter: PIXI.ColorMatrixFilter;
38
+ normalFilter: PIXI.ColorMatrixFilter;
29
39
  };