Created
March 20, 2018 11:15
-
-
Save ashrithks/0d88e6b1b721c8bc2a5ae6ae5ecb3ffd to your computer and use it in GitHub Desktop.
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
let CollapseExpand = (index, position) => { | |
const inputRange = [index - 1, index, index + 1]; | |
const opacity = position.interpolate({ | |
inputRange, | |
outputRange: [0, 1, 1], | |
}); | |
const scaleY = position.interpolate({ | |
inputRange, | |
outputRange: ([0, 1, 1]), | |
}); | |
return { | |
opacity, | |
transform: [ | |
{ scaleY } | |
] | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment