widget hand wash timer
parent
22d93ef884
commit
bdfcea2bf7
|
|
@ -956,7 +956,7 @@
|
|||
"name": "Hand Wash Timer",
|
||||
"icon": "widget.png",
|
||||
"version":"0.01",
|
||||
"description": "Any swip will start your personal Bangle.js hand wash timer for 35 sec. Start washing after the short buzz and stop after the long buzz.",
|
||||
"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": [
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
(() => {
|
||||
var icon = require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA=="));
|
||||
var color = 0x4A69;
|
||||
var isActive = false;
|
||||
|
||||
function draw() {
|
||||
g.reset().setColor(color).drawImage(icon, this.x + 1, 0);
|
||||
|
|
@ -9,7 +10,9 @@
|
|||
|
||||
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
|
||||
|
||||
Bangle.on('swipe', function() {
|
||||
Bangle.on('twist', function() {
|
||||
if (!isActive) {
|
||||
isActive = true;
|
||||
color = 0x41f;
|
||||
Bangle.buzz();
|
||||
Bangle.drawWidgets();
|
||||
|
|
@ -17,6 +20,8 @@
|
|||
color = 0x4A69;
|
||||
Bangle.buzz(1E3, 1);
|
||||
Bangle.drawWidgets();
|
||||
setTimeout(() => { isActive = false; }, 1E10);
|
||||
}, 35E3);
|
||||
}
|
||||
});
|
||||
})();
|
||||
Loading…
Reference in New Issue