Design comparison
SolutionDesign
Solution retrospective
All feedback are welcomed.. how to do the progress bar color changing i have tried a lot but doesn't works any suggesstions..
Community feedback
- @yukilunPosted about 1 year ago
Hi!👋 For changing the progress bar color, you can add a event listener to listen for the input event of
#myRange
and change the background of#myRange
withlinear-gradient
property based on its value:myRange.addEventListener('input', (e) => { const percent = e.target.value / 1000 * 100; myRange.style.background = `linear-gradient(to right, hsl(188, 100%, 82%) ${percent}%, hsl(180, 2%, 84%) ${percent}%)`; });
Hope you find it helpful!😊
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord