@@ -2,30 +2,46 @@ import React from 'react';
2
2
import { storiesOf } from '@storybook/react' ;
3
3
import FullView from '../Example/FullView' ;
4
4
import Card from '../Example/Card' ;
5
- import Animate , {
6
- Flash ,
7
- Bounce ,
8
- FadeOut ,
9
- FadeIn
10
- } from '../src' ;
11
-
5
+ import Animate , { Flash , Bounce , FadeOut , FadeIn } from '../src' ;
12
6
13
7
storiesOf ( 'Animate (HOC)' , module )
14
- . add ( 'Multiple Animations' , ( ) => (
15
- < FullView center >
16
- < Animate Animation = { [ Flash , Bounce , FadeOut , FadeIn ] } duration = "0.8s" delay = "0.2s" >
17
- < Card rounded width = "100px" height = "100px" >
18
- card content...
19
- </ Card >
20
- </ Animate >
21
- </ FullView >
22
- ) )
23
- . add ( 'Multiple Animations with diferent times and delays' , ( ) => (
24
- < FullView center >
25
- < Animate Animation = { [ Flash , Bounce , FadeOut , FadeIn ] } duration = { [ "0.8s" , "3s" , "2s" , "0.4s" ] } delay = { [ "0.2s" , "0.1s" , "0.5s" , "1s" ] } >
26
- < Card rounded width = "100px" height = "100px" >
27
- card content...
28
- </ Card >
29
- </ Animate >
30
- </ FullView >
31
- ) ) ;
8
+ . add ( 'Multiple Animations' , ( ) => (
9
+ < FullView center >
10
+ < Animate
11
+ Animation = { [ Flash , Bounce , FadeOut , FadeIn ] }
12
+ duration = "0.8s"
13
+ delay = "0.2s"
14
+ >
15
+ < Card rounded width = "100px" height = "100px" >
16
+ card content...
17
+ </ Card >
18
+ </ Animate >
19
+ </ FullView >
20
+ ) )
21
+ . add ( 'Multiple Animations with diferent times and delays' , ( ) => (
22
+ < FullView center >
23
+ < Animate
24
+ Animation = { [ Flash , Bounce , FadeOut , FadeIn ] }
25
+ duration = { [ '0.8s' , '3s' , '2s' , '0.4s' ] }
26
+ delay = { [ '0.2s' , '0.1s' , '0.5s' , '1s' ] }
27
+ >
28
+ < Card rounded width = "100px" height = "100px" >
29
+ card content...
30
+ </ Card >
31
+ </ Animate >
32
+ </ FullView >
33
+ ) )
34
+ . add ( 'with onAnimationDone callback' , ( ) => (
35
+ < FullView center >
36
+ < Animate
37
+ Animation = { [ Flash , Bounce , FadeOut , FadeIn ] }
38
+ duration = { [ '0.8s' , '3s' , '0.2s' , '0.2s' ] }
39
+ delay = { [ '0.2s' , '0.1s' , '0.3s' , '0.8s' ] }
40
+ onAnimationDone = { ( ) => alert ( 'animation finished!' ) }
41
+ >
42
+ < Card rounded width = "100px" height = "100px" >
43
+ card content...
44
+ </ Card >
45
+ </ Animate >
46
+ </ FullView >
47
+ ) ) ;
0 commit comments