Last active
May 8, 2016 14:17
-
-
Save joshwcomeau/7d22b6f0cecf8778b726c608fe245e15 to your computer and use it in GitHub Desktop.
letter-animation
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
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