Design from a Dribbble shot by Cesar Zeppini. I built the visual meter on top of a hidden meter element. The value of the meter’s value attribute determines the width of the red meter bar and the number displayed in the green box. Demo by changing the value of the value attribute from 750 to a number between 0 and 1000.
Because the functionality of the visual meter relies on JavaScript, progressive enhancement is necessary. Progressive enhancement can be achieved by leaving the meter element’s display property at default until hidden by a script-loaded stylesheet. This stylesheet would contain all the style declarations for the visual meter. If the stylesheet failed to load, the meter element would remain accessible.
A Pen by Saminou yengue kizidi on CodePen.