Last active
August 29, 2015 14:25
-
-
Save lelandrichardson/4fb50de584c62c4b7d09 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var Ferrisel = React.createClass({ | |
getInitialState() { | |
return { | |
panX: new Animated.Value(0), | |
panY: new Animated.Value(0) | |
}; | |
}, | |
render() { | |
var { pages } = this.props; | |
var { panX, panY } = this.state; | |
return ( | |
<PanView | |
allowScrollX | |
allowScrollY | |
lockDirection | |
panX={panX} | |
panY={panY} | |
boundaryY={[MIN, MAX]} | |
> | |
{pages.map((page, i) => ( | |
<Animated.Image | |
source={page.source} | |
style={{ | |
transform: [{ | |
translateX: panX | |
}, { | |
translateY: panY.interpolate({ | |
inputRange: [...], | |
outputRange: [...], | |
easing: ... | |
}) | |
}, { | |
scale: panY.interpolate({ | |
inputRange: [...], | |
outputRange: [...] | |
}) | |
}] | |
}} | |
/> | |
))} | |
</PanView> | |
) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment