react-animate-z 1.0.3 โ†’ 2.0.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.
Files changed (38) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +345 -182
  3. package/build/AnimBox/AnimateTyping.d.ts +15 -0
  4. package/build/AnimBox/StyledElement.d.ts +5 -0
  5. package/build/AnimBox/WrapperAnimate.d.ts +4 -0
  6. package/build/AnimBox/durations.d.ts +1 -0
  7. package/build/AnimBox/frames/_index.d.ts +208 -0
  8. package/build/AnimBox/frames/attention.d.ts +7 -0
  9. package/build/AnimBox/frames/blur.d.ts +12 -0
  10. package/build/AnimBox/frames/bounce.d.ts +9 -0
  11. package/build/AnimBox/frames/fade.d.ts +24 -0
  12. package/build/AnimBox/frames/flash.d.ts +7 -0
  13. package/build/AnimBox/frames/flip.d.ts +23 -0
  14. package/build/AnimBox/frames/float.d.ts +7 -0
  15. package/build/AnimBox/frames/fold.d.ts +6 -0
  16. package/build/AnimBox/frames/funMap.d.ts +10 -0
  17. package/build/AnimBox/frames/glowing.d.ts +7 -0
  18. package/build/AnimBox/frames/hangOn.d.ts +12 -0
  19. package/build/AnimBox/frames/jelly.d.ts +7 -0
  20. package/build/AnimBox/frames/motion.d.ts +16 -0
  21. package/build/AnimBox/frames/pop.d.ts +16 -0
  22. package/build/AnimBox/frames/pulse.d.ts +7 -0
  23. package/build/AnimBox/frames/rotate.d.ts +15 -0
  24. package/build/AnimBox/frames/slide.d.ts +18 -0
  25. package/build/AnimBox/frames/squeezeShake.d.ts +12 -0
  26. package/build/AnimBox/frames/textEffects.d.ts +9 -0
  27. package/build/AnimBox/frames/zoom.d.ts +12 -0
  28. package/build/AnimBox/index.d.ts +4 -0
  29. package/build/AnimBox/types.d.ts +27 -0
  30. package/build/index.d.ts +5 -6
  31. package/build/index.esm.js +1 -1
  32. package/build/index.js +1 -1
  33. package/package.json +76 -79
  34. package/build/components/AnimationConstant.d.ts +0 -26
  35. package/build/components/AnimationTyping.d.ts +0 -4
  36. package/build/components/AnimationWrapper.d.ts +0 -3
  37. package/build/components/IFType.d.ts +0 -26
  38. package/build/components/index.d.ts +0 -4
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Delpi.Kye
3
+ Copyright (c) 2025 Delpi.Kye
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,213 +1,376 @@
1
+ # ๐Ÿ“ฆ react-animate-z
2
+
1
3
  <div align="center">
2
- <h1>react-animate-z</h1>
3
- <a href="https://www.npmjs.com/package/react-animate-z">react-animate-z</a>
4
- <br />
5
- <br />
6
- <b><a href="https://codesandbox.io/u/delpi.k">LIVE EXAMPLE</a></b>
4
+ <b>โœจ Simple React animation components built with styled-components</b>.
5
+ <br />
6
+ <br />
7
+ <a href="https://www.npmjs.com/package/react-animate-z">react-animate-z</a>
8
+ <br />
9
+ <br />
10
+ <b><a href="https://codesandbox.io/p/devbox/lively-night-lrjs4s">LIVE EXAMPLE</a></b>
7
11
  </div>
8
12
 
9
- ---
10
- React Component to show animated text and objects, built with [styled-components](https://www.styled-components.com/).
13
+ <br />
11
14
 
12
- The Component provides regular animation for common object and some animation effects especially for typography like letters and multi-line text.
15
+ [![NPM](https://img.shields.io/npm/v/react-animate-z.svg)](https://www.npmjs.com/package/react-animate-z)
16
+ [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
17
+ ![Downloads](https://img.shields.io/npm/dt/react-animate-z.svg)
13
18
 
14
- WrapBlock: div (default)
19
+ A React + styled-components based animation library with more than
20
+ **180+ pre-built animations**.
15
21
 
16
- ## Installation
22
+ ## ๐Ÿš€ Features
17
23
 
18
- Install via npm:
24
+ โœ… Easy-to-use animation wrapper for any element
19
25
 
20
- ```
21
- npm i react-animate-z
22
- ```
26
+ โœ… Fully typed with TypeScript
23
27
 
24
- ## Usage
28
+ โœ… Customizable duration, delay, iteration, timing, direction, fillMode
25
29
 
26
- To use react-animate-z in your react project,
27
- wrap the content with a `Animate` component and customize the animation with relevant properties.
30
+ โœ… Typewriter-style text animation with blinking cursor
28
31
 
29
- ```js
30
- import Animate from 'react-animate-z'
32
+ ## ๐Ÿš€ Installation
33
+
34
+ ```bash
35
+ npm install react-animate-z
36
+
37
+ # or
38
+
39
+ yarn add react-animate-z
40
+ ```
41
+
42
+ ## ๐ŸŽฌ Usage
31
43
 
32
- const Animate = () => {
44
+ ```tsx
45
+ import React from "react";
46
+ import Animate from "react-animate-z";
47
+
48
+ export default function App() {
33
49
  return (
34
- <Animate
35
- type="blur"
36
- duration="1000ms"
37
- delay="0s"
38
- direction="normal"
39
- timing="ease"
40
- iteration="infinite"
41
- fillMode="none">
42
- Content...
50
+ <Animate type="bounce" duration="1s">
51
+ <h1>Hello Animation</h1>
43
52
  </Animate>
44
- )
53
+ );
45
54
  }
46
55
  ```
47
56
 
48
- ### Available properties
49
-
50
- | Property | Corresponding Animation Property | Data Type | Default Value | Property Unit |
51
- | :---------: | :------------------------------: | :---------------: | :------------: | :-----------: |
52
- | `type` | `animation-name` | `String` | "blur" | - |
53
- | `duration` | `animation-duration` | `String` | "1s" | `s` or `ms` |
54
- | `delay` | `animation-delay` | `String` | "0s" | `s` or `ms` |
55
- | `direction` | `animation-direction` | `String` | "alternate" | - |
56
- | `timing` | `animation-timing-function` | `String` | "ease" | - |
57
- | `iteration` | `animation-iteration-count` | `Number` `String` | "infinite" | - |
58
- | `fillMode` | `animation-fill-mode` | `String` | "none" | - |
59
-
60
- ### Available animations name (see mapping)
61
-
62
- | `type` / Animation name |
63
- | ----------------------- |
64
- | `blur` |
65
- | `fadeIn` |
66
- | `fadeOut` |
67
- | `hang` |
68
- | `hangOnLeft` |
69
- | `hangOnRight` |
70
- | `swing` |
71
- | `glowing` |
72
- | `shakeMix` |
73
- | `shakeHorizontal` |
74
- | `shakeVertical` |
75
- | `spin` |
76
- | `bounce` |
77
- | `flipCenterToRight` |
78
- | `flipFromLeftToCenter` |
79
- | `flash` |
80
- | `pulse` |
81
- | `jelly` |
82
- | `squeezeHorizontal` |
83
- | `squeezeVertical` |
84
- | `flipHorizontal` |
85
- | `flipVertical` |
86
-
87
-
88
- ## Chain Animation
89
- An string-arry of animation names is used to wrap the animations you want to chain.
57
+ ## ๐Ÿ”ง Props
90
58
 
91
- ```js
92
- import Animate from 'react-animate-z'
59
+ Prop Type Default Description
93
60
 
94
- const AnimationsForChaining = ["swing", "flipSlowDown", "fadeOutToBottom", "jelly"]
61
+ | Prop | Type | Default | Description |
62
+ | ----------- | ---------------------- | ------------ | ---------------------------------------------------------------------------------------- |
63
+ | `type` | `AnimateType` | `'blurIn'` | Animation name (vรญ dแปฅ: `'blurIn'`, `'bounce'`, `'fadeOut'`, ...) |
64
+ | `duration` | `string \| number` | `'1s'` | Duration of the animation (can be in seconds `'1s'` or milliseconds `1000`) |
65
+ | `timing` | `TimingKey` | `'ease'` | Timing function (e.g., `'ease'`, `'linear'`, `'ease-in'`, `'ease-out'`) |
66
+ | `delay` | `string \| number` | `'0s'` | Delay before the animation starts |
67
+ | `iteration` | `number \| "infinite"` | `1` | Repeat count of the animation |
68
+ | `direction` | `string` | `'normal'` | Animation direction (`'normal'`, `'alternate'`, `'reverse'`, etc.) |
69
+ | `fillMode` | `string` | `'forwards'` | How styles are applied after animation (`'forwards'`, `'backwards'`, `'both'`, `'none'`) |
70
+ | `tagName` | `string` | `'div'` | Custom HTML tag to render |
95
71
 
96
- const AnimationChain = () => {
72
+ ---
97
73
 
98
- const [animationIndex, setAnimationIndex] = useState(0)
99
- const [animationType, setAnimationType] = useState(AnimationsForChaining[0])
74
+ ## ๐ŸŽจ Available Animations
100
75
 
101
- const handleChainAnimation = () => {
102
- setCounter(animationIndex+1)
103
- setAnimationType(selectedItems[animationIndex+1])
104
- }
76
+ ### ๐ŸŽพ Bounce
105
77
 
106
- return (
107
- <Animate
108
- onAnimationEnd={handleChainAnimation}
109
- type={animationType}
110
- duration="1000ms"
111
- timing="linear"
112
- iteration={1}>
113
- Animate
114
- </Animate>
115
- )
116
- }
117
- ```
78
+ - bounce
79
+ - bounceIn
80
+ - bounceOut
81
+ - bounceElastic
82
+ - bounceSmall
83
+ - bounceRotate
84
+ - bounceJelly
118
85
 
119
- ##### animation type - mapping name
86
+ ### โœจ Text / Glow Effects
120
87
 
121
- ```js
122
- // props: type
123
- "blur"
124
- "bounce"
125
- "effect3D"
126
- "flash"
127
- "float"
128
- "glowing"
129
- "jelly"
130
- "pulse"
131
- "shadow"
132
- "spin"
133
- "swing"
134
- "fadeIn"
135
- "fadeInFromLeft"
136
- "fadeInFromRight"
137
- "fadeInFromTop"
138
- "fadeInFromBottom"
139
- "fadeOut"
140
- "fadeOutToLeft"
141
- "fadeOutToRight"
142
- "fadeOutToTop"
143
- "fadeOutToBottom"
144
- "flip"
145
- "flipIn"
146
- "flipOut"
147
- "flipSlowDown"
148
- "flipFromTop"
149
- "flipToTop"
150
- "flipFromBottom"
151
- "flipToBottom"
152
- "flipFromLeftToCenter"
153
- "fold"
154
- "unfold"
155
- "hangOnLeft"
156
- "hangOnRight"
157
- "rotateSlowDown"
158
- "rotateCW"
159
- "rotateACW"
160
- "shakeMix"
161
- "shakeHorizontal"
162
- "shakeVertical"
163
- "squeezeMix"
164
- "squeezeHorizontal"
165
- "squeezeVertical"
166
- "slideInFromLeft"
167
- "slideInFromRight"
168
- "slideOutToLeft"
169
- "slideOutToRight"
170
- "slideInFromTop"
171
- "slideInFromBottom"
172
- "slideOutToTop"
173
- "slideOutToBottom"
174
- "zoomIn"
175
- "zoomOut"
176
- "popIn"
177
- "popOut"
178
- // 1.0.3
179
- "rubberBand"
180
- "jello"
181
- "wobble"
182
- "rollIn"
183
- "jackInTheBox"
184
- ```
88
+ - effect3D
89
+ - neonGlow
90
+ - retro3D
91
+ - emboss
92
+ - fireGlow
93
+ - iceGlow
94
+ - shine
95
+
96
+ ### ๐ŸŒซ Blur
97
+
98
+ - blurIn
99
+ - blurInZoom
100
+ - blurInScale
101
+ - blurInUp
102
+ - blurInRotate
103
+ - blurOut
104
+ - blurOutZoom
105
+ - blurOutScale
106
+ - blurOutDown
107
+ - blurOutRotate
108
+
109
+ ### โšก Flash
110
+
111
+ - flash
112
+ - flashIrregular
113
+ - flashFast
114
+ - flashSlow
115
+ - flashPulse
116
+
117
+ ### ๐ŸŽˆ Float
118
+
119
+ - float
120
+ - floatSway
121
+ - floatHorizontal
122
+ - floatCircular
123
+ - floatWiggle
124
+
125
+ ### ๐Ÿ’ก Glow
126
+
127
+ - glow
128
+ - glowTextFlicker
129
+ - glowRainbow
130
+ - glowBreathing
131
+ - glowGlitch
132
+
133
+ ### ๐Ÿฎ Jelly
134
+
135
+ - jelly
136
+ - jellyX
137
+ - jellyY
138
+ - jellyIn
139
+ - jellyOut
140
+
141
+ ### ๐ŸŒ‘ Shadow / Spin / Swing / Orbit
142
+
143
+ - shadow
144
+ - shadowText
145
+ - shadowPulse
146
+ - shadowNeon
147
+ - spin
148
+ - spin3D
149
+ - spinX
150
+ - spinBounce
151
+ - swing
152
+ - swingPivot
153
+ - swingX
154
+ - swingY
155
+ - orbit
156
+ - orbitEllipse
185
157
 
186
- ##### animation type name: typewriter
158
+ ### ๐Ÿ’“ Pulse
159
+
160
+ - pulse
161
+ - pulseInOut
162
+ - pulseFade
163
+ - pulseFast
164
+ - pulseColor
165
+
166
+ ### ๐ŸŒซ Fade
167
+
168
+ - fadeIn
169
+ - fadeOut
170
+ - fadeInFromLeft
171
+ - fadeInFromRight
172
+ - fadeInFromTop
173
+ - fadeInFromBottom
174
+ - fadeOutToLeft
175
+ - fadeOutToRight
176
+ - fadeOutToTop
177
+ - fadeOutToBottom
178
+ - fadeInZoom
179
+ - fadeOutZoom
180
+ - fadeInRotate
181
+ - fadeOutRotate
182
+ - fadeInSkew
183
+ - fadeOutSkew
184
+ - fadeInFlipX
185
+ - fadeOutFlipX
186
+ - fadeInFlipY
187
+ - fadeOutFlipY
188
+ - fadeInPerspective
189
+ - fadeOutPerspective
190
+
191
+ ### ๐Ÿคฏ Squeeze / Shake
192
+
193
+ - squeezeMix
194
+ - squeezeHorizontal
195
+ - squeezeVertical
196
+ - squeezeDiagonal
197
+ - squeezePulse
198
+ - shakeMix
199
+ - shakeHorizontal
200
+ - shakeVertical
201
+ - shakeDiagonal
202
+ - shakeQuick
203
+
204
+ ### ๐Ÿ“ฅ Slide
205
+
206
+ - slideInFromLeft
207
+ - slideInFromRight
208
+ - slideOutToLeft
209
+ - slideOutToRight
210
+ - slideInFromTop
211
+ - slideInFromBottom
212
+ - slideOutToTop
213
+ - slideOutToBottom
214
+ - slideInFromLeftOvershoot
215
+ - slideInFromRightOvershoot
216
+ - slideOutToLeftOvershoot
217
+ - slideOutToRightOvershoot
218
+ - slideInFromTopOvershoot
219
+ - slideInFromBottomOvershoot
220
+ - slideOutToTopOvershoot
221
+ - slideOutToBottomOvershoot
222
+
223
+ ### ๐Ÿ”„ Flip
224
+
225
+ - flip
226
+ - flipIn
227
+ - flipOut
228
+ - flipSlowDown
229
+ - flipToLeft
230
+ - flipToRight
231
+ - flipFromTop
232
+ - flipToTop
233
+ - flipToBottom
234
+ - flipFromBottom
235
+ - flipFromLeftToCenter
236
+ - flipFromRightToCenter
237
+ - flipRich
238
+ - flipToTopRich
239
+ - flipToBottomRich
240
+ - flipToTopLeftRich
241
+ - flipToRightRich
242
+ - flipFromTopRich
243
+ - flipFromBottomRich
244
+ - flipFromLeftToCenterRich
245
+ - flipFromRightToCenterRich
246
+
247
+ ### ๐Ÿ“‚ Fold / Unfold
248
+
249
+ - fold
250
+ - foldDeep
251
+ - unfold
252
+ - unfoldDeep
253
+
254
+ ### ๐Ÿช Hang On
255
+
256
+ - hangOnLeft
257
+ - hangOnRight
258
+ - hangOnTop
259
+ - hangOnBottom
260
+ - hangOnLeftSwing
261
+ - hangOnRightSwing
262
+ - hangOnTopSwing
263
+ - hangOnBottomSwing
264
+ - hangOnOscillate
265
+ - hangOnDrop
266
+
267
+ ### ๐Ÿ” Zoom
268
+
269
+ - zoomIn
270
+ - zoomOut
271
+ - zoomInFromLeft
272
+ - zoomInFromRight
273
+ - zoomInFromTop
274
+ - zoomInFromBottom
275
+ - zoomOutToLeft
276
+ - zoomOutToRight
277
+ - zoomOutToTop
278
+ - zoomOutToBottom
279
+
280
+ ### ๐ŸŒ€ Rotate
281
+
282
+ - rotateCW
283
+ - rotateACW
284
+ - rotateSlowDown
285
+ - rotateX
286
+ - rotateY
287
+ - rotateFromLeft
288
+ - rotateFromRight
289
+ - rotateToLeft
290
+ - rotateToRight
291
+ - rotateFromTop
292
+ - rotateFromBottom
293
+ - rotateToTop
294
+ - rotateToBottom
295
+
296
+ ### ๐ŸŽ‰ Fun / Attention
297
+
298
+ - heartBeat
299
+ - tada
300
+ - hinge
301
+ - lightSpeedInLeft
302
+ - lightSpeedOutRight
303
+ - popIn
304
+ - popOut
305
+ - popBounceIn
306
+ - popBounceOut
307
+ - popUpIn
308
+ - popUpOut
309
+ - popRotateIn
310
+ - popRotateOut
311
+ - popBlurIn
312
+ - popBlurOut
313
+ - popLeftIn
314
+ - popLeftOut
315
+ - popRightIn
316
+ - popRightOut
317
+ - rubberBand
318
+ - jello
319
+ - wobble
320
+ - rollIn
321
+ - jackInTheBox
322
+
323
+ ---
324
+
325
+ #### Chain Animation
326
+
327
+ An string-arry of animation names is used to wrap the animations you want to chain.
187
328
 
188
329
  ```js
189
- // import { AnimateTyping } from 'react-animate-z';
190
-
191
- <Animate
192
- type="typewriter"
193
- // props
194
- typingWrite={{
195
- dataText: ["Sushi", "Pizza", "Brรถtchen", "Salat"],
196
- // heading?: string;
197
- // className?: string;
198
- // dataText?: string[];
199
- }}
200
- />
201
-
202
- // or
203
- <AnimateTyping
204
- dataText ={["Sushi", "Pizza", "Brรถtchen", "Salat"]}
205
- // heading?: string;
206
- // className?: string;
207
- // dataText?: string[];
208
- />
330
+ import React, { useState } from "react";
331
+ import { AnimateTyping } from "react-animate-z";
332
+
333
+ const AnimationsForChaining = [
334
+ "swing",
335
+ "flipSlowDown",
336
+ "fadeOutToBottom",
337
+ "jelly",
338
+ ];
339
+
340
+ const AnimationChain: React.FC = () => {
341
+ // const [animationIndex, setAnimationIndex] = useState(0);
342
+ // const [animationType, setAnimationType] = useState(AnimationsForChaining[0]);
343
+
344
+ // const handleChainAnimation = () => {
345
+ // const nextIndex = (animationIndex + 1) % AnimationsForChaining.length;
346
+ // setAnimationIndex(nextIndex);
347
+ // setAnimationType(AnimationsForChaining[nextIndex]);
348
+ // };
349
+
350
+ return (
351
+ <>
352
+ <AnimateTyping
353
+ heading="Hello,"
354
+ dataText={["I am Delpi", "I build animations", "I love coding!"]}
355
+ cursorColor="red"
356
+ />
357
+
358
+ <AnimateTyping dataText="Only once" />
359
+
360
+ <AnimateTyping
361
+ heading="Fast typing:"
362
+ dataText={["speed x2", "super fast!"]}
363
+ typingSpeed={50}
364
+ deletingSpeed={20}
365
+ pauseTime={1000}
366
+ />
367
+ </>
368
+ );
369
+ };
370
+
371
+ export default AnimationChain;
209
372
  ```
210
373
 
211
- ### License
374
+ ## ๐Ÿ“œ License
212
375
 
213
- MIT
376
+ MIT ยฉ Delpi
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ interface ICursorProps {
3
+ readonly cursorColor?: string | null;
4
+ }
5
+ export interface IAnimateTypingProps extends ICursorProps {
6
+ readonly heading?: string;
7
+ readonly className?: string;
8
+ readonly dataText?: string[] | string;
9
+ readonly children?: React.ReactNode | string[] | string;
10
+ readonly typingSpeed?: number;
11
+ readonly deletingSpeed?: number;
12
+ readonly pauseTime?: number;
13
+ }
14
+ declare const AnimateTyping: React.FC<IAnimateTypingProps>;
15
+ export default AnimateTyping;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { type IBaseStyledElementProps } from "./types";
3
+ export declare const StyledElement: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
4
+ ref?: import("react").Ref<HTMLDivElement>;
5
+ }, IBaseStyledElementProps>> & string;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { IAnimateProps } from "./types";
3
+ export declare const WrapperAnimate: React.FC<IAnimateProps>;
4
+ export default WrapperAnimate;
@@ -0,0 +1 @@
1
+ export declare const defaultDurationMap: Record<string, string>;