-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Low Hanging Animation Options #429
Comments
It'd be nice to have an easy way to do this. But before that it'd be nice to have someone do some exploration for available options. One simple animation is simply fading in pages when you navigate to them as described here: |
My initial thought had been to drop this in to gatsby: https://github.com/maisano/react-router-transition which includes react-motion -- seems like could provide a robust set of options but unmet peer dependencies installing and haven't yet had time to look into further. The example you show above looks good for basic and solid approach to page transitions. |
If someone wanted to created some demo sites with animated page transition examples that'd be great! |
Hey! I was wondering if we could do something like starting from an initial opacity of 0 and then: componentDidMount() {
this.fadeIn(document.querySelector('.container'));
} The |
I saw a gif of navigation animation from @tannerlinsley. He submitted #1415 to make it possible |
#1415 enables pretty much any animation framework or strategy to be used const React = require('react')
const { Transition } = require('react-move')
exports.componentRenderer = ({currentPage, previousPage}) => {
console.log(currentPage, previousPage)
return (
<Transition
data={[
currentPage,
previousPage
]}
getKey={d => d.location.pathname}
enter={d => ({
transform: `translateX(100%)`,
opacity: 1,
zIndex: 1,
boxShadow: '0 0 20px 0 rgba(0,0,0,0)',
})}
update={d => ({
transform: `translateX(0%)`,
opacity: 1,
zIndex: 1,
boxShadow: '0 0 100px 0 rgba(0,0,0,.5)'
})}
leave={d => ({
transform: `translateX(-33%)`,
opacity: .8,
zIndex: 0
})}
ignore={['zIndex']}
duration={700}
>
{nodes => (
<div>
{nodes.map(node => {
const { component: Component, ...rest } = node.data
return <div key={node.key} style={{
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0,
background: 'white',
...node.state
}}>
<Component {...rest} />
</div>
})}
</div>
)}
</Transition>
)
} |
@stevensurgnier has been working on adding great support for page transitions — |
One of the things that would be nice to have is either animation examples via added modules, or something baked in to the core that makes it obvious and easy to add animations/transforms to blog page changes.
The text was updated successfully, but these errors were encountered: