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

Feature request: initialAnimation speed/delay #64

Closed
Wgil opened this issue Oct 4, 2018 · 4 comments
Closed

Feature request: initialAnimation speed/delay #64

Wgil opened this issue Oct 4, 2018 · 4 comments

Comments

@Wgil
Copy link

Wgil commented Oct 4, 2018

Hello!

I would like to run the initialAnimation when my component is already mounted and also I would like to change the animation speed. Is that currently possible? I could do a pull request if you are interested in this. :-)

Thank you.

@kevinsqi
Copy link
Owner

kevinsqi commented Oct 7, 2018

Hi @Wgil!

Animation speed is already configurable with CSS/styles: #54

You can run the animation whenever you want simply by changing the percentage prop value from 0 to the desired percentage. See https://codesandbox.io/s/81wzmm8n00 for an example of that.

Let me know if this doesn't address what you need.

@Wgil
Copy link
Author

Wgil commented Oct 7, 2018

Hello @iqnivek :-)

That certainly solves the scenario I'm facing since some of my progress bars are going to be loaded asynchronously. However, I think that I also will need to run the animation when the user scrolls down and the bars appear for the first time on the screen. I'm not pretty sure if this would be page responsibility or circles bars itself. Let me hear your thoughts on this, please.

Thank you!

@kevinsqi
Copy link
Owner

kevinsqi commented Oct 7, 2018

This should definitely be the page's responsibility. Fortunately what you're asking for is quite doable - I looked into it and react-visibility-sensor will do the trick for detecting and animating when the progressbar becomes visible.

I've updated the codesandbox to show how that would work: https://codesandbox.io/s/81wzmm8n00

Hope this helps!

@kevinsqi kevinsqi closed this as completed Oct 7, 2018
@Wgil
Copy link
Author

Wgil commented Oct 7, 2018

@iqnivek Thank you very much! You're so kind.

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