-
Notifications
You must be signed in to change notification settings - Fork 5
/
App.js
143 lines (137 loc) · 2.88 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import React from 'react';
import { StyleSheet, Text, View, TouchableOpacity } from 'react-native';
import {
VerticalMotionExample,
FadeOutExample,
FadeInExample,
PositiveScaleExample,
NegativeScaleExample,
IncreasingSizeExample,
DecreasingSizeExample,
RotateExample,
RotateXExample,
RotateYExample,
ChangeColorExample,
SpringVerticalMotionExample,
LoopRotateExample,
EasingBounceExample,
SequenceExample,
ParallelExample,
DelayExample,
StaggerExample,
DecayExample
} from './examples';
const examples = {
verticalMotion: {
title: 'Vertical motion example',
component: VerticalMotionExample
},
fadeOut: {
title: 'Fade out example',
component: FadeOutExample
},
fadeIn: {
title: 'Fade in example',
component: FadeInExample
},
positiveScale: {
title: 'Positive scale example',
component: PositiveScaleExample
},
negativeScale: {
title: 'Negative scale example',
component: NegativeScaleExample
},
increasingSize: {
title: 'Increasing size example',
component: IncreasingSizeExample
},
decreasingSize: {
title: 'Decreasing size example',
component: DecreasingSizeExample
},
rotate: {
title: 'Rotate example',
component: RotateExample
},
rotateX: {
title: 'RotateX example',
component: RotateXExample
},
rotateY: {
title: 'RotateY example',
component: RotateYExample
},
changeColor: {
title: 'Change color example',
component: ChangeColorExample
},
spring: {
title: 'Spring example',
component: SpringVerticalMotionExample
},
loop: {
title: 'Loop example',
component: LoopRotateExample
},
easingBounce: {
title: 'Easing bounce example',
component: EasingBounceExample
},
decay: {
title: 'Decay example',
component: DecayExample
},
sequence: {
title: 'Sequence example',
component: SequenceExample
},
parallel: {
title: 'Parallel example',
component: ParallelExample
},
delay: {
title: 'Delay example',
component: DelayExample
},
stagger: {
title: 'Stagger example',
component: StaggerExample
}
}
export default class App extends React.Component {
state = {
currentExample: 'decay' // Change to see an example
}
render() {
const { title, component } = examples[this.state.currentExample];
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={styles.headerText}>{title}</Text>
</View>
{ React.createElement(component) }
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
header: {
height: 60,
width: '100%',
justifyContent: 'center',
alignItems: 'center',
padding: 15,
position: 'absolute',
top: '5%'
},
headerText: {
fontSize: 20,
fontWeight: '600'
}
});