Skip to content
uses battery api to show the battery status.
JavaScript CSS HTML
Branch: gh-pages
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo.png
index.html
main.css
main.js
quote.json
readme.md

readme.md

wtfpl Travis stable Code Climate Codacy Badge

Battery Checker:

Checks your battery with battery api.

Alt text

Basically it's the result of playing with js Promise,fetch and battery api.

Internals:

There's two part to this project.

1. Quotes:

It uses a promise and tries to fetch data from two sources(one from external api, another from local json).
It then shows the data whichever is returned first(using promise.all ). Clearly the localone should be faster.

2. Battery:

This ones pretty simple. Uses native battery api which returns a promise.
If the browser doesn't support the battery api, it'll show an error.

You can’t perform that action at this time.