Merge pull request #180 from MaBecker/widget_30sec_hand_wash

widget hand wash timer
pull/184/head^2^2
Gordon Williams 2020-04-02 12:47:39 +01:00 committed by GitHub
commit 91971a74b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 0 deletions

View File

@ -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"}
]
}
]

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