I just started playing around with React Animations, and I seem to be stuck.
I have a series of Cards that appear (animate-in). Right now, they're all coming in at the same time (the animation plays at the same time). Is there a way to add an offset to the animation so that they play one after the other?
Animate = React.addons.CSSTransitionGroup
<Animate transitionName="cardAnim" transitionAppear={true}>
{
courses.map(function(element, index){
return (
<Card style={CardStyle} key={index}>
<CardMedia>
<img src={"img/courses/" + index + ".png"} />
</CardMedia>
<CardTitle>
{element}
</CardTitle>
</Card>
)
})
}
</Animate>
My aim: I want each Card to animate in separately, as in, the second card animates in after the first one has entered, the third animates after the second one is done, and so on.
Can anyone help? Thanks :)
All right, so I figured it out. The key was the animation-fill-mode CSS property. I completely removed all React Animations and proceeded to figure it out using CSS only.
Here's the code, if anyone is interested:
CSS:
}
JSX:
Essentially, I changed properties using CSS and persisted them using animation-fill-mode.