alfajango / mobilecan

Simple demonstration of the functionality available to when developing applications for mobile web browsers.
http://www.mobilecan.io/
MIT License
0 stars 0 forks source link

Battery status #4

Closed JangoSteve closed 9 years ago

JangoSteve commented 9 years ago

Here's an article on the battery status API. I've also never used this. The browser support says it should work on Android, and some of the desktop browsers, but not mobile Safari. Maybe let's add a section to each page which lists the actual APIs being used for that feature, and we can link to e.g. CanIUse or the browser support section at the bottom of the MDN documentation.

https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API

For this demo, maybe let's create a sort of battery icon using CSS and fill it based on the user's battery status (and also display the percentage).

JangoSteve commented 9 years ago

Let's add back the battery status in a new page.

JangoSteve commented 9 years ago

I think let's just add a small change of colorizing the battery indicator based on levels. So e.g. let's make it red when the batter level is 15% or lower, yellow when it's 16-30%, and green for >30%. And then maybe let's make it gray when the battery status can't be read on the device.