kimmobrunfeldt / kimmobrunfeldt/progressbar.js
Expand on from/to functionality
- Dominant language
- JavaScript
- Stars
- 7.9k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
Currently you can include the following in your config to animate the progress bar's color between a starting and end point:
```
from: { color: 'red' },
to: { color: 'green' },
step: (state, bar) => {
bar.path.setAttribute('stroke', state.color);
}
```
CSS3 animations support this `from` and `to` style, but also allow for a percentage based way to define the various states, so you could have more than two, and they could be distributed arbitrarily.
```
0%: { color: 'red' },
50%: { color: 'yellow' },
100%: { color: 'green' },
step: (state, bar) => {
bar.path.setAttribute('stroke', state.color);
}
```
Is there an easy way to accomplish this before I get around to submitting a PR?
Contributor guide
Research direction
No source file or test is named. Start by tracing how the existing from, to, and step configuration is handled in progressbar.js, then compare it with the requested percentage-based states. Done means multiple arbitrarily placed percentage states work while the current from/to form remains supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100