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

How to create a countdown timer #52

Closed
piotrooo opened this Issue Apr 23, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@piotrooo
Copy link

commented Apr 23, 2018

Hey,

firstly thanks for good plugin and nice work!

I have some idea which you can try to consider is ok.
In you plugin you base on the percentage and max value expressed by the 100%. For stuff which is based on the percent is ok. But I faced with following problem, I needed to run a circular progress based on the n-seconds, that's mean I need to countdown (increments/decrements). Max value is 5 and need to countdown to 0 (increments should be possible too, passed as an option).

I don't know is that idea will be good for you, but changes shouldn't be hard I guess.

@kevinsqi

This comment has been minimized.

Copy link
Owner

commented Apr 25, 2018

If I'm understanding you correctly, this is what you're looking for? https://codesandbox.io/s/23w8j4mk30

It's a little awkward, but we don't strictly need to add new functionality to achieve this - can simply convert from seconds to percentages instead and write wrapper components like ChangingProgressbar and CountdownProgressbar to abstract out the details.

Going to close this, but let me know if this doesn't address your need. Thanks!

@kevinsqi kevinsqi closed this Apr 25, 2018

@piotrooo

This comment has been minimized.

Copy link
Author

commented Apr 25, 2018

Thanks, nice approach I didn't think like this.

PS. I want to archive this: https://codesandbox.io/s/p7621n2zlj but is a small change in the _.rand function.

@kevinsqi kevinsqi changed the title Progres not based on the percentage How to create a countdown timer Jan 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.