Created
August 5, 2017 00:07
-
-
Save EncodeTheCode/71c8b1d8c381f7e8876da5a22972d6e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function battery_status(){function DecToPer(f){return(f*100)+'%';};var B=window.navigator.battery,A=[B.charging,B.chargingTime,B.dischargingTime,DecToPer(B.level),B.onchargingchange,B.onchargingtimechange,B.ondischargingtimechange,B.onlevelchange];return A;};var S=battery_status();document.write('<span class="orange">Battery Status:</span> <span class="green">'+S[3]+'</span> <span class="gray">(</span><span class="orange">Charging:</span> <span class="green">'+S[0]+'</span><span class="gray">,</span> <span class="orange">Charging Time:</span> <span class="green">'+S[1]+'</span><span class="gray">)</span>'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment