My circular progress bar features two paths, with one path increasing in length as data is received, eventually turning the entire circle red.
Here is the SVG HTML code:
<path d="M 50,50 m 0,-47 a 47,47 0 1 1 0,94 a 47,47 0 1 1 0,-94" stroke="#A9B0B7" stroke-width="4" fill-opacity="0">
</path>
<path id="path2" d="M 50,50 m 0,-47 a 47,47 0 1 1 0,94 a 47,47 0 1 1 0,-94" stroke="#EB483F" stroke-width="6" fill-opacity="0" style="stroke-dasharray: 295.416, 295.416; stroke-dashoffset: 250"></path>
</svg>
The CSS code below enhances the loading of the red path:
#path2 {
-webkit-transition-property: stroke-dashoffset;
transition-property: stroke-dashoffset;
-webkit-transition-duration: 1s;
transition-duration: 0.3s;
}
.viewbox {
width: 50%;
}
For more details and to view the code in action, visit this link.
I am looking to add an animation to the remaining gray portion, possibly with a small div moving through it to illuminate it. Something like what can be found in this example.
I believe I need to incorporate keyframe animation and place the div inside the svg path, but I am unsure of the exact method for achieving this.