Guest User

Untitled

a guest
Jan 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. runIntroAnimation = async () => {
  2. await this.setState({
  3. timer: this.state.timer + 1.5,
  4. scaleA: new Animated.Value(1),
  5. opacityA: new Animated.Value(1),
  6. scaleB: new Animated.Value(1),
  7. opacityB: new Animated.Value(1)
  8. });
  9. let { scaleA, scaleB, opacityA, opacityB } = this.state;
  10. Animated.stagger(500, [
  11. Animated.parallel([
  12. Animated.timing(opacityA, {
  13. toValue: 0.25,
  14. duration: 750
  15. }),
  16.  
  17. Animated.timing(scaleA, {
  18. toValue: 1.5,
  19. duration: 750
  20. })
  21. ]),
  22. Animated.parallel([
  23. Animated.timing(opacityB, {
  24. toValue: 0.25,
  25. duration: 750
  26. }),
  27. Animated.timing(scaleB, {
  28. toValue: 1.5,
  29. duration: 750
  30. })
  31. ])
  32. ]).start(() =>
  33. this.state.timer >= 3 ? this.props.done() : this.runIntroAnimation()
  34. );
  35. };
Add Comment
Please, Sign In to add comment