For a current project I'm on, we needed both circular timer, and progress bar. Again, I wasn't able to find small library to do that. But I found awesome answer on Stack Overflow, decided SVG is way to go, and wrote Sektor.
Sektor is a plain JavaScript library that draws circle sector (or an arc). Once it is drawn, you can change it's angle and animate the change.
It works in every browser with SVG and requestAnimationFrane
support (IE10+ and modern browsers). Check demo and docs.
I may use this for example how much better is to use requestAnimationFrame
than setInterval
. If you are bored, try it yourself, and you'll see that animating using requestAnimationFrame
is way smoother.
React component is coming soon as well. Cheers!
Comments (3)