dielduarte / animate-css-styled-components

simple port of animate css for styled-components

Home Page:https://dielduarte.github.io/animate-css-styled-components/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fire function when animation complete

JacobMJones opened this issue · comments

Is there a way to call a function once an animation is complete?

Hey! @JacobMJones, what a great idea! unfortunately not yet, but how we have control about time/delays I'll work in a beta feature to solve that and I'll let you know!

@JacobMJones hey, I've just opened a branch called feat/onAnimationDoneCallBack.

The idea is simple but kind of limited due that we have control of the times animations only using the Animate component instead of the styled components of each animation.

so to use the callback when the animation is done, you should do:

<Animate
        Animation={[Flash]}
        duration={['0.8s'}
        delay={['0.1s']}
        onAnimationDone={() => alert('animation finished!')}
      >
        your component here...
</Animate> 

could you test and see if this works well for you? also, I added an example on the storybook, to see the example just run in your terminal yarn storybook

hey @JacobMJones, did you have time to see if it worked well for your case?