-
-
Save shubhnik/e89d38e424ce5a43849aa2fd0efaee09 to your computer and use it in GitHub Desktop.
Animations once the image is rendered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentDidMount(){ | |
Animated.parallel([ | |
Animated.timing( | |
this.state.viewOpacity, | |
{ | |
toValue:1, | |
duration:100, | |
useNativeDriver:true | |
} | |
), | |
Animated.timing( | |
this.state.animateImageY, | |
{ | |
toValue: height/2 - (this.props.translateY+50), | |
duration:200, | |
useNativeDriver:true | |
} | |
), | |
Animated.timing( | |
this.state.animateImageX, | |
{ | |
toValue: width/2 - (this.props.translateX+width/4), | |
duration:200, | |
useNativeDriver:true | |
} | |
), | |
Animated.timing( | |
this.state.scaleImageX, | |
{ | |
toValue: 2, | |
duration:100, | |
useNativeDriver:true | |
} | |
), | |
Animated.timing( | |
this.state.scaleImageY, | |
{ | |
toValue: (height/3)/100, | |
duration:100, | |
useNativeDriver:true | |
} | |
) | |
]).start() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment