reacthub-pixitweenjs 0.2.4 → 0.2.6

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.
Files changed (40) hide show
  1. package/.storybook/preview.tsx +6 -0
  2. package/CHANGELOG.md +27 -0
  3. package/README.md +1 -1
  4. package/build-storybook.log +79 -476
  5. package/package.json +29 -29
  6. package/src/components/PixiAnimatedSprite/PixiAnimatedSprite.tsx +51 -0
  7. package/src/components/PixiAnimatedSprite/index.ts +2 -0
  8. package/src/components/PixiAudioSprite/PixiAudioSprite.stories.tsx +61 -0
  9. package/src/components/PixiAudioSprite/PixiAudioSprite.tsx +202 -0
  10. package/src/components/PixiAudioSprite/index.ts +1 -0
  11. package/src/components/PixiGifSprite/PixiGifSprite.stories.tsx +135 -0
  12. package/src/components/PixiGifSprite/PixiGifSprite.tsx +372 -0
  13. package/src/components/PixiGifSprite/index.ts +2 -0
  14. package/src/components/PixiImageSprite/PixiImageSprite.stories.tsx +11 -0
  15. package/src/components/PixiImageSprite/PixiImageSprite.tsx +33 -70
  16. package/src/components/PixiSVGSprite/PixiSvgPathSprite.stories.tsx +137 -0
  17. package/src/components/PixiSVGSprite/PixiSvgPathSprite.tsx +346 -0
  18. package/src/components/PixiSVGSprite/index.ts +1 -0
  19. package/src/components/PixiTextSprite/PixiTextSprite.stories.tsx +176 -0
  20. package/src/components/PixiTextSprite/PixiTextSprite.tsx +540 -0
  21. package/src/components/PixiTextSprite/index.ts +1 -0
  22. package/src/components/PixiVideoSprite/PixiVideoSprite.stories.tsx +147 -0
  23. package/src/components/PixiVideoSprite/PixiVideoSprite.tsx +631 -0
  24. package/src/components/PixiVideoSprite/PixiVideoSpriteBackup.txt +755 -0
  25. package/src/components/PixiVideoSprite/index.ts +1 -0
  26. package/src/declare.module.ts +5 -0
  27. package/src/main.tsx +8 -7
  28. package/src/providers/GsapPixieContextProvider.tsx +102 -22
  29. package/src/reacthub-react-bindings.d.ts +27 -0
  30. package/src/stories/Installation.mdx +3 -3
  31. package/src/utils/AppStateProvider.tsx +18 -29
  32. package/src/utils/AppStateStage.tsx +1 -13
  33. package/src/utils/AppWrapper.tsx +4 -0
  34. package/src/utils/GsapAnim.tsx +1 -7
  35. package/src/utils/InteractionManager.tsx +36 -0
  36. package/src/utils/PixiStage.tsx +1 -5
  37. package/src/utils/PixiTransformer.tsx +165 -0
  38. package/src/utils/VideoSeekBar.tsx +35 -31
  39. package/src/utils/useDebounce.tsx +15 -0
  40. package/src/hooks/usePixiTransformer.tsx +0 -168
@@ -0,0 +1,137 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { PixiSvgPathSprite } from ".";
3
+ import { AppStateContextProvider } from "../../utils/AppStateProvider";
4
+
5
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
6
+ const meta = {
7
+ title: "Components/SvgSprite",
8
+ component: PixiSvgPathSprite,
9
+
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ uniqueId: {
13
+ control: "text",
14
+ description: "uniqueId of the sprite",
15
+ },
16
+ path: {
17
+ control: "text",
18
+ description: "source of the svg path",
19
+ },
20
+ transformation: {
21
+ control: "object",
22
+ description: "transformation of the sprite",
23
+ x: { control: "number", description: "x position of the sprite" },
24
+ y: { control: "number", description: "y position of the sprite" },
25
+ width: { control: "number", description: "width of the sprite" },
26
+ height: { control: "number", description: "height of the sprite" },
27
+ anchor: { control: "number", description: "anchor of the sprite" },
28
+ rotation: { control: "number", description: "rotation of the sprite" },
29
+ alpha: {
30
+ control: "number",
31
+ min: 0,
32
+ max: 1,
33
+ description: "alpha of the sprite",
34
+ },
35
+ scale: { control: "number", description: "scale of the sprite" },
36
+ tint: { control: "number", description: "tint of the sprite" },
37
+ blendMode: { control: "number", description: "blendMode of the sprite" },
38
+ colorCorrection: {
39
+ control: "object",
40
+ description: "colorCorrection of the sprite",
41
+ brightness: {
42
+ control: "number",
43
+ description: "brightness of the sprite",
44
+ },
45
+ contrast: { control: "number", description: "contrast of the sprite" },
46
+ saturation: {
47
+ control: "number",
48
+ description: "saturation of the sprite",
49
+ },
50
+ alpha: { control: "number", description: "alpha of the sprite" },
51
+ },
52
+ },
53
+ applyTransformer: { control: "boolean", description: "applyTransformer" },
54
+ startAt: { control: "number", description: "startAt" },
55
+ endAt: { control: "number", description: "endAt" },
56
+ initialAlpha: {
57
+ control: "number",
58
+ min: 0,
59
+ max: 1,
60
+ description: "sprite initial alpha value (default 1)",
61
+ },
62
+ onAnchorTransformationEnd: {
63
+ action: "onAnchorTransformationEnd",
64
+ description:
65
+ "on transforamtion end the event is fire callback with latest sprite transformation properties.",
66
+ },
67
+ pointerdown: {
68
+ action: "pointerdown",
69
+ description: "pointerdown event",
70
+ },
71
+ },
72
+ } satisfies Meta<typeof PixiSvgPathSprite>;
73
+
74
+ export default meta;
75
+ type Story = StoryObj<typeof meta>;
76
+
77
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
78
+ export const Normal: Story = {
79
+ render: (args: any) => (
80
+ <AppStateContextProvider {...args}>
81
+ <PixiSvgPathSprite {...args} />
82
+ </AppStateContextProvider>
83
+ ),
84
+ args: {
85
+ uniqueId: "svg001", // uniqueId of the sprite
86
+ path: "M 100 100 L 300 100 L 200 300 z",
87
+ transformation: {
88
+ x: 100,
89
+ y: 100,
90
+ width: 150,
91
+ height: 150,
92
+ anchor: 0.5,
93
+ rotation: 0,
94
+ alpha: 1,
95
+ scale: 1,
96
+ tint: 0xffffff,
97
+ blendMode: 0,
98
+ colorCorrection: {},
99
+ fill: "#FFC0CB",
100
+ },
101
+ applyTransformer: false,
102
+ startAt: 0,
103
+ endAt: 10,
104
+ initialAlpha: 1,
105
+ },
106
+ };
107
+
108
+ export const FadeIn: Story = {
109
+ render: (args: any) => (
110
+ <AppStateContextProvider {...args}>
111
+ <PixiSvgPathSprite {...args} />
112
+ </AppStateContextProvider>
113
+ ),
114
+ args: {
115
+ uniqueId: "surya002", // uniqueId of the sprite
116
+ path: "M 100, 100 m -75, 0 a 75,75 0 1,0 150,0 a 75,75 0 1,0 -150,0",
117
+ transformation: {
118
+ x: 100,
119
+ y: 100,
120
+ width: 150,
121
+ height: 150,
122
+ anchor: 0.5,
123
+ rotation: 0,
124
+ alpha: 1,
125
+ scale: 1,
126
+ tint: 0xffffff,
127
+ blendMode: 0,
128
+ animation: "FADE_IN",
129
+ colorCorrection: {},
130
+ fill: "#fe2c54",
131
+ },
132
+ applyTransformer: false,
133
+ startAt: 0,
134
+ endAt: 10,
135
+ initialAlpha: 0,
136
+ },
137
+ };
@@ -0,0 +1,346 @@
1
+ import * as React from "react";
2
+ import { useContext, useEffect, useRef, useState } from "react";
3
+ // @ts-ignore
4
+ import PropTypes from "prop-types";
5
+ import { GsapPixieContext } from "../../providers/GsapPixieContextProvider";
6
+ import { Sprite, Container, useApp, withFilters } from "@pixi/react";
7
+ import { AdjustmentFilter } from "@pixi/filter-adjustment";
8
+ import * as PIXI from "pixi.js";
9
+ import gsap from "gsap";
10
+ import { SVG } from "pixi-svg";
11
+ import PixiTransformer from "../../utils/PixiTransformer";
12
+ // @ts-ignore
13
+ import svgpath from "svgpath";
14
+ // @ts-ignore
15
+ import isEmpty from "lodash/isEmpty";
16
+ import { getAnimByName } from "../../utils/GsapAnim";
17
+ import { TransformationEnd } from "../../types/transformation";
18
+
19
+ type PixiSvgPathSpriteProps = {
20
+ uniqueId: string;
21
+ path: string;
22
+ startAt: number;
23
+ endAt: number;
24
+ initialAlpha: number;
25
+ transformation: {
26
+ x: number;
27
+ y: number;
28
+ width: number;
29
+ height: number;
30
+ anchor: number;
31
+ rotation?: number;
32
+ alpha?: number;
33
+ scale?: number | [number, number];
34
+ tint?: number;
35
+ blendMode?: number;
36
+ animation?: string;
37
+ fill?: string;
38
+ fontWeight?: string;
39
+ fontStyle?: string;
40
+ stroke?: string;
41
+ strokeWidth?: number;
42
+ blurRadius?: number;
43
+ colorCorrection?: {
44
+ enabled?: boolean;
45
+ temperature?: number;
46
+ hue?: number;
47
+ contrast?: number;
48
+ saturation?: number;
49
+ exposure?: number;
50
+ reset?: boolean;
51
+ sharpness?: number;
52
+ value?: number;
53
+ levels?: number;
54
+ luminance?: number;
55
+ enhance?: number;
56
+ blurRadius?: number;
57
+ red?: number;
58
+ green?: number;
59
+ blue?: number;
60
+ alpha?: number;
61
+ scaleInput?: number;
62
+ };
63
+ effect?: string;
64
+ };
65
+ pointerdown?: () => void;
66
+ pointerup?: () => void;
67
+ mousedown?: () => void;
68
+ mouseup?: () => void;
69
+ pointerover?: () => void;
70
+ mouseover?: () => void;
71
+ mouseout?: () => void;
72
+ applyTransformer?: boolean;
73
+ onAnchorTransformationEnd?: (endData: any) => void;
74
+ };
75
+
76
+ const Filters = withFilters(Container, {
77
+ blur: PIXI.filters.BlurFilter,
78
+ adjust: AdjustmentFilter,
79
+ matrix: PIXI.filters.ColorMatrixFilter,
80
+ });
81
+
82
+ /** CYAN Filters */
83
+ const CYAN = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
84
+
85
+ const PixiSvgPathSprite: React.FC<PixiSvgPathSpriteProps> = (props) => {
86
+ //// State
87
+ const [isMounted, setIsMounted] = React.useState(false);
88
+ const [, setIsTransformerDragging] = useState(false);
89
+ const [, setIsMouseOverTransformer] = useState(false);
90
+ const [texture, setTexture] = React.useState<any>(null);
91
+
92
+ //// Refs
93
+ const imageRef = useRef<PIXI.Sprite>(null);
94
+ const containerRef = useRef<PIXI.Container>(null);
95
+ const parentNode = useRef<PIXI.Container>(null);
96
+ const imgGroupRef = useRef<PIXI.Container>(null);
97
+ const transformerRef = useRef<PIXI.Container>(null);
98
+
99
+ //// Context
100
+ const { tl } = useContext(GsapPixieContext);
101
+
102
+ /// 1001
103
+ // console.log("contxt Values", tl);
104
+ const {
105
+ uniqueId,
106
+ path,
107
+ startAt,
108
+ endAt,
109
+ initialAlpha,
110
+ transformation: {
111
+ x,
112
+ y,
113
+ width,
114
+ height,
115
+ anchor,
116
+ animation,
117
+ colorCorrection,
118
+ effect,
119
+ fill,
120
+ stroke = "none",
121
+ strokeWidth = 0,
122
+ blurRadius = 0,
123
+ },
124
+ pointerdown,
125
+ pointerup,
126
+ mousedown,
127
+ mouseup,
128
+ pointerover,
129
+ mouseover,
130
+ mouseout,
131
+ applyTransformer,
132
+ onAnchorTransformationEnd,
133
+ } = props;
134
+
135
+ // color corrections
136
+ const {
137
+ contrast = 1,
138
+ saturation = 1,
139
+ exposure = 1,
140
+ alpha = 1,
141
+ } = colorCorrection || {};
142
+
143
+ const app = useApp();
144
+
145
+ /** adjustment filter */
146
+ const adjustments = {
147
+ brightness: exposure,
148
+ contrast,
149
+ saturation,
150
+ alpha,
151
+ };
152
+
153
+ // const fillColor = PIXI.utils.string2hex(fill || "#262730");
154
+
155
+ /** handle on tranformer onchange */
156
+ const handleOnTransformChange = React.useCallback(() => {
157
+ setIsTransformerDragging(true);
158
+ }, []);
159
+
160
+ // transformer to handle sprite transformation
161
+ const handleOnTransformEnd = React.useCallback(
162
+ (endData: TransformationEnd) => {
163
+ console.log("changeEnd", endData);
164
+ if (onAnchorTransformationEnd) {
165
+ console.log("running onAnchorTransformationEnd");
166
+ onAnchorTransformationEnd(endData);
167
+ }
168
+ },
169
+ []
170
+ );
171
+
172
+ useEffect(() => {
173
+ let ctx = gsap.context(() => {});
174
+ if (containerRef.current && tl.current) {
175
+ const data = {
176
+ duration: Number(endAt) - Number(startAt),
177
+ };
178
+
179
+ const ease = getAnimByName(animation || "None");
180
+ ctx = gsap.context(() => {
181
+ if (!isEmpty(ease.from)) {
182
+ tl.current
183
+ .from(containerRef.current, { ...ease.from }, startAt)
184
+ .to(imgGroupRef.current, { alpha: 1, duration: 0.2 }, startAt)
185
+ .from(imgGroupRef.current, { ...data }, startAt)
186
+ .to(containerRef.current, { alpha: 0, duration: 0.2 }, endAt - 0.2);
187
+ } else if (!isEmpty(ease.to)) {
188
+ tl.current
189
+ .to(
190
+ containerRef.current,
191
+ { alpha: 1, duration: 0.2, ...ease.to },
192
+ startAt
193
+ )
194
+ .from(imgGroupRef.current, { ...data }, startAt)
195
+ .to(containerRef.current, { alpha: 0, duration: 0.2 }, endAt - 0.2);
196
+ } else if (!isEmpty(ease.fromTo)) {
197
+ tl.current
198
+ .fromTo(
199
+ containerRef.current,
200
+ ease.fromTo?.from,
201
+ ease.fromTo?.to,
202
+ startAt
203
+ )
204
+ .from(imgGroupRef.current, { ...data }, startAt)
205
+ .to(containerRef.current, { alpha: 0, duration: 0.2 }, endAt - 0.2);
206
+ } else {
207
+ tl.current
208
+ .to(containerRef.current, { alpha: 1, duration: 0.01 }, startAt)
209
+ .from(imgGroupRef.current, { ...data }, startAt)
210
+ .to(
211
+ containerRef.current,
212
+ { alpha: 0, duration: 0.1 },
213
+ Number(endAt) - Number(0.1)
214
+ );
215
+ }
216
+ });
217
+ }
218
+ return () => ctx.revert(); // cleanup!
219
+ }, [animation, startAt, endAt]);
220
+
221
+ React.useEffect(() => {
222
+ if (containerRef.current) {
223
+ setIsMounted(true);
224
+ }
225
+ }, []);
226
+
227
+ React.useEffect(() => {
228
+ const transformedPath = svgpath(path).scale(5).translate(0, 0).toString();
229
+ // console.log('path', path);
230
+ // console.log('transformedPath', transformedPath);
231
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">
232
+ <path stroke="${stroke}" stroke-width="${strokeWidth}" fill="${fill}" d="${transformedPath}">
233
+ </path>
234
+ </svg>`;
235
+
236
+ const svgObject = new SVG(svg);
237
+ const tex = app.renderer.generateTexture(svgObject);
238
+ setTexture(tex);
239
+ return () => {
240
+ // removeTransformer();
241
+ };
242
+ }, [app, path, stroke, strokeWidth, fill]);
243
+
244
+ return (
245
+ // @ts-ignore
246
+ <Container ref={parentNode}>
247
+ {/* @ts-ignore */}
248
+ <Container
249
+ ref={containerRef}
250
+ alpha={initialAlpha}
251
+ position={[x, y]}
252
+ pivot={[x, y]}
253
+ width={width}
254
+ height={height}
255
+ >
256
+ {colorCorrection && colorCorrection.enabled ? (
257
+ <Filters
258
+ scale={1}
259
+ blur={{ blur: blurRadius, quality: 4 }}
260
+ adjust={adjustments}
261
+ apply={({ matrix }: { matrix: any }) => {
262
+ if (effect === "BlackAndWhite") {
263
+ matrix.desaturate();
264
+ } else if (effect === "Sepia") {
265
+ matrix.sepia();
266
+ } else if (effect === "RetroVintage") {
267
+ matrix.negative();
268
+ } else if (effect === "NightVision") {
269
+ matrix.negative();
270
+ } else if (effect === "Normal") {
271
+ matrix.reset();
272
+ }
273
+ }}
274
+ matrix={{
275
+ enabled: true,
276
+ // @ts-ignore
277
+ matrix: CYAN,
278
+ }}
279
+ >
280
+ {/* @ts-ignore */}
281
+
282
+ <Container ref={imgGroupRef}>
283
+ {texture && (
284
+ <Sprite
285
+ texture={texture}
286
+ width={width}
287
+ height={height}
288
+ anchor={anchor}
289
+ ref={imageRef}
290
+ x={x}
291
+ y={y}
292
+ // @ts-ignore
293
+ interactive={true}
294
+ pointerdown={pointerdown}
295
+ pointerup={pointerup}
296
+ pointerover={pointerover}
297
+ mousedown={mousedown}
298
+ mouseup={mouseup}
299
+ mouseover={mouseover}
300
+ mouseout={mouseout}
301
+ />
302
+ )}
303
+ </Container>
304
+ </Filters>
305
+ ) : (
306
+ // @ts-ignore
307
+ <Container ref={imgGroupRef}>
308
+ {texture && (
309
+ <Sprite
310
+ texture={texture}
311
+ width={width}
312
+ height={height}
313
+ anchor={anchor}
314
+ ref={imageRef}
315
+ x={x}
316
+ y={y}
317
+ // @ts-ignore
318
+ interactive={true}
319
+ pointerdown={pointerdown}
320
+ pointerup={pointerup}
321
+ pointerover={pointerover}
322
+ mousedown={mousedown}
323
+ mouseup={mouseup}
324
+ mouseover={mouseover}
325
+ mouseout={mouseout}
326
+ />
327
+ )}
328
+ </Container>
329
+ )}
330
+ </Container>
331
+ {applyTransformer && (
332
+ <PixiTransformer
333
+ pixiTransformerRef={transformerRef}
334
+ imageRef={containerRef}
335
+ isMounted={isMounted}
336
+ transformCommit={handleOnTransformEnd}
337
+ transformChange={handleOnTransformChange}
338
+ mouseoverEvent={setIsMouseOverTransformer}
339
+ uniqueId={uniqueId}
340
+ />
341
+ )}
342
+ </Container>
343
+ );
344
+ };
345
+
346
+ export default PixiSvgPathSprite;
@@ -0,0 +1 @@
1
+ export { default as PixiSvgPathSprite } from "./PixiSvgPathSprite";
@@ -0,0 +1,176 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { PixiTextSprite } from ".";
3
+ import { AppStateContextProvider } from "../../utils/AppStateProvider";
4
+
5
+ // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction
6
+ const meta = {
7
+ title: "Components/TextSprite",
8
+ component: PixiTextSprite,
9
+
10
+ tags: ["autodocs"],
11
+ argTypes: {
12
+ uniqueId: {
13
+ control: "text",
14
+ description: "uniqueId of the sprite",
15
+ },
16
+ text: {
17
+ control: "text",
18
+ description: "Text to be displayed",
19
+ },
20
+ transformation: {
21
+ control: "object",
22
+ description: "transformation of the sprite",
23
+ x: { control: "number", description: "x position of the sprite" },
24
+ y: { control: "number", description: "y position of the sprite" },
25
+ width: { control: "number", description: "width of the sprite" },
26
+ height: { control: "number", description: "height of the sprite" },
27
+ anchor: { control: "number", description: "anchor of the sprite" },
28
+ rotation: { control: "number", description: "rotation of the sprite" },
29
+ alpha: {
30
+ control: "number",
31
+ min: 0,
32
+ max: 1,
33
+ description: "alpha of the sprite",
34
+ },
35
+ scale: { control: "number", description: "scale of the sprite" },
36
+ tint: { control: "number", description: "tint of the sprite" },
37
+ blendMode: { control: "number", description: "blendMode of the sprite" },
38
+ colorCorrection: {
39
+ control: "object",
40
+ description: "colorCorrection of the sprite",
41
+ brightness: {
42
+ control: "number",
43
+ description: "brightness of the sprite",
44
+ },
45
+ contrast: { control: "number", description: "contrast of the sprite" },
46
+ saturation: {
47
+ control: "number",
48
+ description: "saturation of the sprite",
49
+ },
50
+ alpha: { control: "number", description: "alpha of the sprite" },
51
+ },
52
+ },
53
+ applyTransformer: { control: "boolean", description: "applyTransformer" },
54
+ startAt: { control: "number", description: "startAt" },
55
+ endAt: { control: "number", description: "endAt" },
56
+ initialAlpha: {
57
+ control: "number",
58
+ min: 0,
59
+ max: 1,
60
+ description: "sprite initial alpha value (default 1)",
61
+ },
62
+ onAnchorTransformationEnd: {
63
+ action: "onAnchorTransformationEnd",
64
+ description:
65
+ "on transforamtion end the event is fire callback with latest sprite transformation properties.",
66
+ },
67
+ pointerdown: {
68
+ action: "pointerdown",
69
+ description: "pointerdown event",
70
+ },
71
+
72
+ pointerup: {
73
+ action: "pointerup",
74
+ description: "pointerup event",
75
+ },
76
+ onTextUpdate: {
77
+ action: "onTextUpdate",
78
+ description: "onTextUpdate event",
79
+ },
80
+ },
81
+ } satisfies Meta<typeof PixiTextSprite>;
82
+
83
+ export default meta;
84
+ type Story = StoryObj<typeof meta>;
85
+
86
+ // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
87
+ export const Normal: Story = {
88
+ render: (args: any) => (
89
+ <AppStateContextProvider {...args}>
90
+ <PixiTextSprite {...args} />
91
+ </AppStateContextProvider>
92
+ ),
93
+ args: {
94
+ uniqueId: "TextSpritexx001", // uniqueId of the sprite
95
+ text: "Hello Welcome to PixiJS",
96
+ locked: false,
97
+ applyTransformer: false,
98
+ transformation: {
99
+ x: 100,
100
+ y: 100,
101
+ width: 150,
102
+ height: 150,
103
+ anchor: 0.5,
104
+ rotation: 0,
105
+ alpha: 1,
106
+ scale: 1,
107
+ blendMode: 0,
108
+ colorCorrection: {},
109
+ fill: "#00ff99",
110
+ fontSize: 80,
111
+ fontFamily: "Arial",
112
+ align: "center",
113
+ stroke: "#522d2d",
114
+ strokeThickness: 0,
115
+ letterSpacing: 0,
116
+ lineHeight: 0,
117
+ dropShadow: false,
118
+ dropShadowColor: "#522d2d",
119
+ dropShadowBlur: 0,
120
+ wordWrap: false,
121
+ wordWrapWidth: 5000000,
122
+ padding: 10,
123
+ textBaseline: "alphabetic",
124
+ trim: false,
125
+ },
126
+ startAt: 0,
127
+ endAt: 10,
128
+ initialAlpha: 1,
129
+ },
130
+ };
131
+
132
+ export const FadeIn: Story = {
133
+ render: (args: any) => (
134
+ <AppStateContextProvider {...args}>
135
+ <PixiTextSprite {...args} />
136
+ </AppStateContextProvider>
137
+ ),
138
+ args: {
139
+ uniqueId: "TextSprite001", // uniqueId of the sprite
140
+ text: "Hello Welcome to PixiJS",
141
+ locked: false,
142
+ applyTransformer: false,
143
+ transformation: {
144
+ x: 100,
145
+ y: 100,
146
+ width: 150,
147
+ height: 150,
148
+ anchor: 0.5,
149
+ rotation: 0,
150
+ alpha: 1,
151
+ scale: 1,
152
+ tint: 0xffffff,
153
+ blendMode: 0,
154
+ colorCorrection: {},
155
+ fill: "#00ff99",
156
+ fontSize: 20,
157
+ fontFamily: "Arial",
158
+ align: "center",
159
+ stroke: 0x000000,
160
+ strokeThickness: 0,
161
+ letterSpacing: 0,
162
+ lineHeight: 0,
163
+ dropShadow: false,
164
+ dropShadowColor: 0x000000,
165
+ dropShadowBlur: 0,
166
+ wordWrap: false,
167
+ wordWrapWidth: 100,
168
+ padding: 0,
169
+ textBaseline: "alphabetic",
170
+ trim: false,
171
+ },
172
+ startAt: 0,
173
+ endAt: 10,
174
+ initialAlpha: 0,
175
+ },
176
+ };