Skip to content
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

Elasticity prop as a function #23

Open
Crizzooo opened this issue Jul 24, 2017 · 2 comments
Open

Elasticity prop as a function #23

Crizzooo opened this issue Jul 24, 2017 · 2 comments
Assignees

Comments

@Crizzooo
Copy link

Crizzooo commented Jul 24, 2017

Hey all,

I'm trying to do some function based elasticity per the anime.js documentation.

The following works for duration and delay, but not for elasticity. Does React-Anime not support this feature? The function doesnt appear to have any impact on elasticity.

   <Anime
        translateY={[-400, 0]}
        opacity={[0, 1]}
        duration={ (el, i) => 3000 + 100 * i }
        delay={ (el, i) => { console.log('delay?', i); return 3500 + 100 * i;} }
        elasticity={ (el, i) => console.log('elastic?', i)}
        complete={ props.onComplete ? props.onComplete : null}
        easing="easeOutBack"
        >
        {props.text.split('').map( (el) => createLetter(el))}
      </Anime>

The function gets called and logs for delay, but never does so for elasticity.

@Crizzooo
Copy link
Author

Nevermind, my mistake. Easing and Elasticity cannot both be applied at same time. My apologies!

@Crizzooo
Copy link
Author

Nope, the above was an issue, but even with the easing prop removed, it appears that the elasticity function is never fired.

Does react-anime take in elasticity functions as well as numbers? My above example works if elasticity={400} for all children, but I want to make it dynamic based on the indexes of the children...

To recap, functions appear to be called in duration and delay props of Anime components, but elasticity funcs are not called.

@Crizzooo Crizzooo reopened this Jul 24, 2017
@alaingalvan alaingalvan self-assigned this Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants