Skip to content

Instantly share code, notes, and snippets.

@iremlopsum
Created May 20, 2019 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iremlopsum/17b4804a142a39525160df22e67410ea to your computer and use it in GitHub Desktop.
Save iremlopsum/17b4804a142a39525160df22e67410ea to your computer and use it in GitHub Desktop.
const defaultOptions = {
transitionOptions: animatedValue => ({
opacity: animatedValue.interpolate({
inputRange: [0, 1, 2],
outputRange: [0, 1, .9],
}),
transform: [
{
perspective: 2000
},
{
translateX: animatedValue.interpolate({
inputRange: [0, 1, 2],
outputRange: [-width / 2, 0, width / 2],
}),
},
{
rotateY: animatedValue.interpolate({
inputRange: [0, 1, 2],
outputRange: ['90deg', '0deg', '-90deg'],
}),
},
{
scale: animatedValue.interpolate({
inputRange: [0, 1, 2],
outputRange: [1.2, 1, .9],
}),
},
],
}),
animateInConfig: {
easing: Easing.bezier(.42,-0.03,.27,.95),
duration: 450,
},
animateOutConfig: {
easing: Easing.bezier(.42,-0.03,.27,.95),
duration: 450,
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment