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 · 3 comments
Closed

How to create a countdown timer #52

piotrooo opened this issue Apr 23, 2018 · 3 comments

Comments

@piotrooo
Copy link

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
Copy link
Owner

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!

@piotrooo
Copy link
Author

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
@kevinsqi
Copy link
Owner

FYI - this is now much easier to manage in v2.0.0 with props.minValue and props.maxValue. Can just set maxValue=5.

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