Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- runIntroAnimation = async () => {
- await this.setState({
- timer: this.state.timer + 1.5,
- scaleA: new Animated.Value(1),
- opacityA: new Animated.Value(1),
- scaleB: new Animated.Value(1),
- opacityB: new Animated.Value(1)
- });
- let { scaleA, scaleB, opacityA, opacityB } = this.state;
- Animated.stagger(500, [
- Animated.parallel([
- Animated.timing(opacityA, {
- toValue: 0.25,
- duration: 750
- }),
- Animated.timing(scaleA, {
- toValue: 1.5,
- duration: 750
- })
- ]),
- Animated.parallel([
- Animated.timing(opacityB, {
- toValue: 0.25,
- duration: 750
- }),
- Animated.timing(scaleB, {
- toValue: 1.5,
- duration: 750
- })
- ])
- ]).start(() =>
- this.state.timer >= 3 ? this.props.done() : this.runIntroAnimation()
- );
- };
Add Comment
Please, Sign In to add comment