vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG
MIT License
692 stars 87 forks source link

How to make incremental count #197

Closed rajeevverma076 closed 2 years ago

rajeevverma076 commented 2 years ago

I wanted to know I can clock incremental way. There are no props available for this. Can someone help me with this?

vydimitrov commented 2 years ago

Hey @rajeevverma076, can you give a bit more info on what you want to achieve?

rajeevverma076 commented 2 years ago

Hi @vydimitrov

I wanted to achieve incremental count down. For example, if I will click on any button my timer will start in an incremental way, not decremental. Currently it is working count down in incremental only.

Ex- https://codepen.io/ninjascribble/pen/DRPwQY

vydimitrov commented 2 years ago

Do you need the circle animation or just the count up numbers?

vydimitrov commented 2 years ago

How about this one? https://codesandbox.io/s/cool-bardeen-0e3gu1?file=/src/index.jss

rajeevverma076 commented 2 years ago

circle animation same as [react-countdown-circle-timer]

rajeevverma076 commented 2 years ago

How about this one? https://codesandbox.io/s/cool-bardeen-0e3gu1?file=/src/index.jss

This is good but duration={10} should be dymanic. Means no limit.

rajeevverma076 commented 2 years ago

How to used children props.

const children = ({ remainingTime }) => { const minutes = Math.floor(remainingTime / 60) const seconds = remainingTime % 60 return ${minutes}:${seconds} }

rajeevverma076 commented 2 years ago

Please help me with this. const children = ({ remainingTime }) => { const minutes = Math.floor(remainingTime / 60) const seconds = remainingTime % 60 return ${minutes}:${seconds} }

vydimitrov commented 2 years ago

This is good but duration={10} should be dymanic. Means no limit.

Just pass big enough number

vydimitrov commented 2 years ago

Please help me with this. const children = ({ remainingTime }) => { const minutes = Math.floor(remainingTime / 60) const seconds = remainingTime % 60 return ${minutes}:${seconds} }

What do you want me to help you with?

rajeevverma076 commented 2 years ago

Hello @vydimitrov

Thank you for your prompt response to my query. Can you please let me know one more query it is possible to show the progress bar on the continuous way with stoping watch and I will pass props once the process has been completed? For example, I have pass duration={100} and my process completed in 60 seconds till the time progress bar should continually run like this. https://codesandbox.io/s/ccttsj?file=/demo.js

vydimitrov commented 2 years ago

Let me know if you manage to achieve what you wanted so I can close the issue.

vydimitrov commented 2 years ago

Closing this issue, let me know if you have any other questions.