Playing with the Javascript Battery API. Some fast tests. Amazing stuff can be achieved!
The percentage and the level of battery change in real time. The color of the level bar will change accordingly with the battery level. And the bolt symbol will show/hide depending if the power adapter is plugged.
Learn more: https://davidwalsh.name/javascript-battery-api https://developer.mozilla.org/en/docs/Web/API/Battery_Status_API
A Pen by Aarón García on CodePen.