widget hand wash timer
parent
22d93ef884
commit
bdfcea2bf7
|
|
@ -956,7 +956,7 @@
|
||||||
"name": "Hand Wash Timer",
|
"name": "Hand Wash Timer",
|
||||||
"icon": "widget.png",
|
"icon": "widget.png",
|
||||||
"version":"0.01",
|
"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",
|
"tags": "widget,tool",
|
||||||
"type":"widget",
|
"type":"widget",
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
(() => {
|
(() => {
|
||||||
var icon = require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA=="));
|
var icon = require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA=="));
|
||||||
var color = 0x4A69;
|
var color = 0x4A69;
|
||||||
|
var isActive = false;
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
g.reset().setColor(color).drawImage(icon, this.x + 1, 0);
|
g.reset().setColor(color).drawImage(icon, this.x + 1, 0);
|
||||||
|
|
@ -9,14 +10,18 @@
|
||||||
|
|
||||||
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
|
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
|
||||||
|
|
||||||
Bangle.on('swipe', function() {
|
Bangle.on('twist', function() {
|
||||||
color = 0x41f;
|
if (!isActive) {
|
||||||
Bangle.buzz();
|
isActive = true;
|
||||||
Bangle.drawWidgets();
|
color = 0x41f;
|
||||||
setTimeout(() => {
|
Bangle.buzz();
|
||||||
color = 0x4A69;
|
|
||||||
Bangle.buzz(1E3, 1);
|
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
}, 35E3);
|
setTimeout(() => {
|
||||||
|
color = 0x4A69;
|
||||||
|
Bangle.buzz(1E3, 1);
|
||||||
|
Bangle.drawWidgets();
|
||||||
|
setTimeout(() => { isActive = false; }, 1E10);
|
||||||
|
}, 35E3);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
Loading…
Reference in New Issue