formatting.

master
deirdreobyrne 2022-06-06 17:20:23 +01:00 committed by GitHub
parent 09e2407b55
commit a35b4f7e96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 9 deletions

View File

@ -21,7 +21,7 @@
function loadLocation() { function loadLocation() {
// "mylocation.json" is created by the "My Location" app // "mylocation.json" is created by the "My Location" app
location = require("Storage").readJSON("mylocation.json",1)||{"lat":50.1236,"lon":8.6553,"location":"Frankfurt"}; location = require("Storage").readJSON("mylocation.json",1)||{"lat":50.1236,"lon":8.6553,"location":"Frankfurt"};
southernHemisphere = (location.lat < 0); southernHemisphere = (location.lat < 0);
} }
// code source: github.com/rozek/banglejs-2-activities/blob/main/README.md#drawmoonphase // code source: github.com/rozek/banglejs-2-activities/blob/main/README.md#drawmoonphase
@ -47,11 +47,11 @@
loadLocation(); loadLocation();
g.reset().setColor(g.theme.bg); g.reset().setColor(g.theme.bg);
g.fillRect(CenterX - Radius, CenterY - Radius, CenterX + Radius, CenterY + Radius); g.fillRect(CenterX - Radius, CenterY - Radius, CenterX + Radius, CenterY + Radius);
if (g.theme.dark) { if (g.theme.dark) {
g.setColor(0xffff); // white g.setColor(0xffff); // white
} else { } else {
g.setColor(0x41f); // blue-ish g.setColor(0x41f); // blue-ish
} }
millis = (new Date()).getTime(); millis = (new Date()).getTime();
if ((millis - lastCalculated) >= 7000000) { // if it's more than 7,000 sec since last calculation, re-calculate! if ((millis - lastCalculated) >= 7000000) { // if it's more than 7,000 sec since last calculation, re-calculate!
@ -74,11 +74,11 @@
} }
WIDGETS["widmoon"] = { WIDGETS["widmoon"] = {
area: "tr", area: "tr",
width: 24, width: 24,
draw: draw draw: draw
}; };
setInterval(function() {WIDGETS["widmoon"].draw(WIDGETS["widmoon"])}, 7010000); // Re-draw at an interval of 10 sec more than our re-calculate period setInterval(function() {WIDGETS["widmoon"].draw(WIDGETS["widmoon"])}, 7010000); // Re-draw at an interval of 10 sec more than our re-calculate period
})(); })();