1
0
Fork 0

Merge branch 'master' of github.com:espruino/BangleApps

master
Gordon Williams 2020-04-02 14:17:03 +01:00
commit c1a58c8471
6 changed files with 41 additions and 2 deletions

View File

@ -892,7 +892,7 @@
{ "id": "marioclock",
"name": "Mario Clock",
"icon": "marioclock.png",
"version":"0.03",
"version":"0.04",
"description": "Animated Mario clock, jumps to change the time!",
"tags": "clock,mario,retro",
"type": "clock",
@ -962,5 +962,16 @@
{"name":"chrono.app.js","url":"chrono.js"},
{"name":"chrono.img","url":"chrono-icon.js","evaluate":true}
]
},
{ "id": "widhwt",
"name": "Hand Wash Timer",
"icon": "widget.png",
"version":"0.01",
"description": "Swipe your wrist over the watch face to start your personal Bangle.js hand wash timer for 35 sec. Start washing after the short buzz and stop after the long buzz.",
"tags": "widget,tool",
"type":"widget",
"storage": [
{"name":"widhwt.wid.js","url":"widget.js"}
]
}
]

View File

@ -1,3 +1,4 @@
0.01: Create mario app
0.02: Fix day of the week and add padding
0.03: use short date format from locale, take timeout from settings
0.04: modify date to display to be more at the original idea but still localized

View File

@ -285,7 +285,10 @@ function drawTime() {
function drawDate() {
g.setFont("6x8");
g.setColor(LIGHTEST);
const dateStr = locale.date(new Date(), true);
let d = new Date();
let dateStr = locale.date(d, true);
dateStr = dateStr.replace(d.getFullYear(), "").trim().replace(/\/$/i,"");
dateStr = locale.dow(d, true) + " " + dateStr;
g.drawString(dateStr, (W - g.stringWidth(dateStr))/2, 0, true);
}

1
apps/widhwt/ChangeLog Normal file
View File

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

23
apps/widhwt/widget.js Normal file
View File

@ -0,0 +1,23 @@
/* jshint esversion: 6 */
(() => {
var icon = require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA=="));
var color = 0x4A69;
function draw() {
g.reset().setColor(color).drawImage(icon, this.x + 1, 0);
}
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
Bangle.on('swipe', function() {
color = 0x41f;
Bangle.buzz();
Bangle.drawWidgets();
setTimeout(() => {
color = 0x4A69;
Bangle.buzz(1E3, 1);
Bangle.drawWidgets();
}, 35E3);
});
})();

BIN
apps/widhwt/widget.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB