add clkinfodist

master
Gordon Williams 2025-07-22 14:52:14 +01:00
parent 74600dde8e
commit 0cf8d53c52
7 changed files with 38 additions and 1 deletions

View File

@ -5,7 +5,7 @@
"icon": "app.png",
"screenshots": [{"url":"screenshot.png"}],
"type": "clkinfo",
"tags": "clkinfo",
"tags": "clkinfo,clock",
"supports" : ["BANGLEJS2"],
"storage": [
{"name":"clkinfoclk.clkinfo.js","url":"clkinfo.js"}

View File

@ -0,0 +1 @@
0.01: New App!

BIN
apps/clkinfodist/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,22 @@
(function() {
let strideLength = (require("Storage").readJSON("myprofile.json",1)||{}).strideLength ?? 0.79,
lastSteps = 0;
function stepUpdateHandler() { distance.emit("redraw"); }
var distance = {
name : "Distance",
get : () => { let v = (Bangle.getHealthStatus("day").steps - lastSteps)*strideLength; return {
text : require("locale").distance(v,1),
img : atob("GBiBAAMAAAeAAA/AAA/AAA/gAA/gwAfh4AfD4APD4AOH4AAH4ADj4AHjwAHhwADgAAACAAAHgAAPAAAHAAgCEBgAGD///BgAGAgAEA==")
};},
run : function() {
lastSteps = (lastSteps>=Bangle.getHealthStatus("day").steps) ? 0 : Bangle.getHealthStatus("day").steps;
this.emit("redraw");
},
show : function() { Bangle.on("step", stepUpdateHandler); stepUpdateHandler(); },
hide : function() { Bangle.removeListener("step", stepUpdateHandler); }
};
return {
name: "Bangle",
items: [ distance ]
};
})

BIN
apps/clkinfodist/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,14 @@
{ "id": "clkinfodist",
"name": "Clockinfo Distance",
"version":"0.01",
"description": "Uses the 'My Profile' app's Stride Length to calculate distance travelled based on step count. Tap to reset for measuring distances.",
"icon": "app.png",
"screenshots": [{"url":"screenshot.png"}],
"type": "clkinfo",
"tags": "clkinfo,distance,steps,outdoors,tool",
"dependencies": {"myprofile":"app"},
"supports" : ["BANGLEJS2"],
"storage": [
{"name":"clkinfodist.clkinfo.js","url":"clkinfo.js"}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB