react-animate-z 1.1.0 → 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 (36) hide show
  1. package/README.md +338 -182
  2. package/build/AnimBox/AnimateTyping.d.ts +15 -0
  3. package/build/AnimBox/StyledElement.d.ts +5 -0
  4. package/build/AnimBox/WrapperAnimate.d.ts +4 -0
  5. package/build/AnimBox/durations.d.ts +1 -0
  6. package/build/AnimBox/frames/_index.d.ts +208 -0
  7. package/build/AnimBox/frames/attention.d.ts +7 -0
  8. package/build/AnimBox/frames/blur.d.ts +12 -0
  9. package/build/AnimBox/frames/bounce.d.ts +9 -0
  10. package/build/AnimBox/frames/fade.d.ts +24 -0
  11. package/build/AnimBox/frames/flash.d.ts +7 -0
  12. package/build/AnimBox/frames/flip.d.ts +23 -0
  13. package/build/AnimBox/frames/float.d.ts +7 -0
  14. package/build/AnimBox/frames/fold.d.ts +6 -0
  15. package/build/AnimBox/frames/funMap.d.ts +10 -0
  16. package/build/AnimBox/frames/glowing.d.ts +7 -0
  17. package/build/AnimBox/frames/hangOn.d.ts +12 -0
  18. package/build/AnimBox/frames/jelly.d.ts +7 -0
  19. package/build/AnimBox/frames/motion.d.ts +16 -0
  20. package/build/AnimBox/frames/pop.d.ts +16 -0
  21. package/build/AnimBox/frames/pulse.d.ts +7 -0
  22. package/build/AnimBox/frames/rotate.d.ts +15 -0
  23. package/build/AnimBox/frames/slide.d.ts +18 -0
  24. package/build/AnimBox/frames/squeezeShake.d.ts +12 -0
  25. package/build/AnimBox/frames/textEffects.d.ts +9 -0
  26. package/build/AnimBox/frames/zoom.d.ts +12 -0
  27. package/build/AnimBox/index.d.ts +4 -0
  28. package/build/AnimBox/types.d.ts +27 -0
  29. package/build/index.d.ts +5 -6
  30. package/build/index.esm.js +1 -1
  31. package/build/index.js +1 -1
  32. package/package.json +76 -84
  33. package/build/components/AnimationTyping.d.ts +0 -4
  34. package/build/components/AnimationWrapper.d.ts +0 -3
  35. package/build/components/index.d.ts +0 -4
  36. package/build/components/types.d.ts +0 -26
package/README.md CHANGED
@@ -1,220 +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/p/sandbox/twpj8l">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
13
  <br />
11
14
 
12
15
  [![NPM](https://img.shields.io/npm/v/react-animate-z.svg)](https://www.npmjs.com/package/react-animate-z)
13
16
  [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
14
17
  ![Downloads](https://img.shields.io/npm/dt/react-animate-z.svg)
15
18
 
19
+ A React + styled-components based animation library with more than
20
+ **180+ pre-built animations**.
16
21
 
17
- ---
18
- React Component to show animated text and objects, built with [styled-components](https://www.styled-components.com/).
22
+ ## 🚀 Features
19
23
 
20
- The Component provides regular animation for common object and some animation effects especially for typography like letters and multi-line text.
24
+ Easy-to-use animation wrapper for any element
21
25
 
22
- WrapBlock: div (default)
26
+ Fully typed with TypeScript
23
27
 
24
- ## Installation
28
+ Customizable duration, delay, iteration, timing, direction, fillMode
25
29
 
26
- Install via npm:
30
+ Typewriter-style text animation with blinking cursor
27
31
 
28
- ```
29
- npm i react-animate-z
30
- ```
32
+ ## 🚀 Installation
31
33
 
32
- ## Usage
34
+ ```bash
35
+ npm install react-animate-z
33
36
 
34
- To use react-animate-z in your react project,
35
- wrap the content with a `Animate` component and customize the animation with relevant properties.
37
+ # or
36
38
 
37
- ```js
38
- import Animate from 'react-animate-z'
39
+ yarn add react-animate-z
40
+ ```
41
+
42
+ ## 🎬 Usage
43
+
44
+ ```tsx
45
+ import React from "react";
46
+ import Animate from "react-animate-z";
39
47
 
40
- const Animate = () => {
48
+ export default function App() {
41
49
  return (
42
- <Animate
43
- type="blur"
44
- duration="1000ms"
45
- delay="0s"
46
- direction="normal"
47
- timing="ease"
48
- iteration="infinite"
49
- fillMode="none">
50
- Content...
50
+ <Animate type="bounce" duration="1s">
51
+ <h1>Hello Animation</h1>
51
52
  </Animate>
52
- )
53
+ );
53
54
  }
54
55
  ```
55
56
 
56
- ### Available properties
57
-
58
- | Property | Corresponding Animation Property | Data Type | Default Value | Property Unit |
59
- | :---------: | :------------------------------: | :---------------: | :------------: | :-----------: |
60
- | `type` | `animation-name` | `String` | "blur" | - |
61
- | `duration` | `animation-duration` | `String` | "1s" | `s` or `ms` |
62
- | `delay` | `animation-delay` | `String` | "0s" | `s` or `ms` |
63
- | `direction` | `animation-direction` | `String` | "alternate" | - |
64
- | `timing` | `animation-timing-function` | `String` | "ease" | - |
65
- | `iteration` | `animation-iteration-count` | `Number` `String` | "infinite" | - |
66
- | `fillMode` | `animation-fill-mode` | `String` | "none" | - |
67
-
68
- ##### Props
69
- | `type` / Animation name |
70
- | ----------------------- |
71
- | `blur` |
72
- | `fadeIn` |
73
- | `fadeOut` |
74
- | `hang` |
75
- | `hangOnLeft` |
76
- | `hangOnRight` |
77
- | `swing` |
78
- | `glowing` |
79
- | `shakeMix` |
80
- | `shakeHorizontal` |
81
- | `shakeVertical` |
82
- | `spin` |
83
- | `bounce` |
84
- | `flipCenterToRight` |
85
- | `flipFromLeftToCenter` |
86
- | `flash` |
87
- | `pulse` |
88
- | `jelly` |
89
- | `squeezeHorizontal` |
90
- | `squeezeVertical` |
91
- | `flipHorizontal` |
92
- | `flipVertical` |
57
+ ## 🔧 Props
58
+
59
+ Prop Type Default Description
60
+
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 |
93
71
 
94
72
  ---
95
73
 
96
- ##### type
97
- ```js
98
- // props: type
99
- "blur"
100
- "bounce"
101
- "effect3D"
102
- "flash"
103
- "float"
104
- "glowing"
105
- "jelly"
106
- "pulse"
107
- "shadow"
108
- "spin"
109
- "swing"
110
- "fadeIn"
111
- "fadeInFromLeft"
112
- "fadeInFromRight"
113
- "fadeInFromTop"
114
- "fadeInFromBottom"
115
- "fadeOut"
116
- "fadeOutToLeft"
117
- "fadeOutToRight"
118
- "fadeOutToTop"
119
- "fadeOutToBottom"
120
- "flip"
121
- "flipIn"
122
- "flipOut"
123
- "flipSlowDown"
124
- "flipFromTop"
125
- "flipToTop"
126
- "flipFromBottom"
127
- "flipToBottom"
128
- "flipFromLeftToCenter"
129
- "fold"
130
- "unfold"
131
- "hangOnLeft"
132
- "hangOnRight"
133
- "rotateSlowDown"
134
- "rotateCW"
135
- "rotateACW"
136
- "shakeMix"
137
- "shakeHorizontal"
138
- "shakeVertical"
139
- "squeezeMix"
140
- "squeezeHorizontal"
141
- "squeezeVertical"
142
- "slideInFromLeft"
143
- "slideInFromRight"
144
- "slideOutToLeft"
145
- "slideOutToRight"
146
- "slideInFromTop"
147
- "slideInFromBottom"
148
- "slideOutToTop"
149
- "slideOutToBottom"
150
- "zoomIn"
151
- "zoomOut"
152
- "popIn"
153
- "popOut"
154
- // 1.0.3
155
- "rubberBand"
156
- "jello"
157
- "wobble"
158
- "rollIn"
159
- "jackInTheBox"
160
- ```
74
+ ## 🎨 Available Animations
75
+
76
+ ### 🎾 Bounce
77
+
78
+ - bounce
79
+ - bounceIn
80
+ - bounceOut
81
+ - bounceElastic
82
+ - bounceSmall
83
+ - bounceRotate
84
+ - bounceJelly
85
+
86
+ ### ✨ Text / Glow Effects
87
+
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
157
+
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
161
322
 
162
- ##### type-name: typewriter
323
+ ---
163
324
 
164
- ```js
165
- // import { AnimateTyping } from 'react-animate-z';
166
- <Animate
167
- type="typewriter"
168
- // props
169
- typingWrite={{
170
- dataText: ["Sushi", "Pizza", "Brötchen", "Salat"],
171
- // heading?: string;
172
- // className?: string;
173
- // dataText?: string[];
174
- }}
175
- />
176
-
177
- // or
178
- <AnimateTyping
179
- dataText ={["Sushi", "Pizza", "Brötchen", "Salat"]}
180
- // heading?: string;
181
- // className?: string;
182
- // dataText?: string[];
183
- />
184
- ```
325
+ #### Chain Animation
185
326
 
186
- ## Chain Animation
187
327
  An string-arry of animation names is used to wrap the animations you want to chain.
188
328
 
189
329
  ```js
190
- import Animate from 'react-animate-z'
191
-
192
- const AnimationsForChaining = ["swing", "flipSlowDown", "fadeOutToBottom", "jelly"]
193
-
194
- const AnimationChain = () => {
195
-
196
- const [animationIndex, setAnimationIndex] = useState(0)
197
- const [animationType, setAnimationType] = useState(AnimationsForChaining[0])
198
-
199
- const handleChainAnimation = () => {
200
- setCounter(animationIndex+1)
201
- setAnimationType(selectedItems[animationIndex+1])
202
- }
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
+ // };
203
349
 
204
350
  return (
205
- <Animate
206
- onAnimationEnd={handleChainAnimation}
207
- type={animationType}
208
- duration="1000ms"
209
- timing="linear"
210
- iteration={1}>
211
- Animate
212
- </Animate>
213
- )
214
- }
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;
215
372
  ```
216
373
 
374
+ ## 📜 License
217
375
 
218
- ### License
219
-
220
- 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>;