Skip to content

Instantly share code, notes, and snippets.

@joshwcomeau
Last active May 8, 2016 14:17
Show Gist options
  • Save joshwcomeau/7d22b6f0cecf8778b726c608fe245e15 to your computer and use it in GitHub Desktop.
Save joshwcomeau/7d22b6f0cecf8778b726c608fe245e15 to your computer and use it in GitHub Desktop.
letter-animation
class LetterDemo extends Component {
constructor(props) { ... }
componentWillMount() { ... }
componentWillUnmount() { ... }
renderLetters() { ... }
render() {
const animations = {
enterAnimation: {
from: {
transform: 'translateY(-30px)',
opacity: 0,
},
to: {
transform: 'translateY(0)',
opacity: 1,
},
},
leaveAnimation: {
from: {
transform: 'translateY(0)',
opacity: 1,
},
to: {
transform: 'translateY(30px)',
opacity: 0,
},
},
};
return (
<div className="letter-demo">
<FlipMove {...animations}>
{this.renderLetters()}
</FlipMove>
</div>
);
}
}
export default LetterDemo;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment