Merge branch 'master' of github.com:espruino/BangleApps
commit
c1a58c8471
13
apps.json
13
apps.json
|
|
@ -892,7 +892,7 @@
|
||||||
{ "id": "marioclock",
|
{ "id": "marioclock",
|
||||||
"name": "Mario Clock",
|
"name": "Mario Clock",
|
||||||
"icon": "marioclock.png",
|
"icon": "marioclock.png",
|
||||||
"version":"0.03",
|
"version":"0.04",
|
||||||
"description": "Animated Mario clock, jumps to change the time!",
|
"description": "Animated Mario clock, jumps to change the time!",
|
||||||
"tags": "clock,mario,retro",
|
"tags": "clock,mario,retro",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
|
|
@ -962,5 +962,16 @@
|
||||||
{"name":"chrono.app.js","url":"chrono.js"},
|
{"name":"chrono.app.js","url":"chrono.js"},
|
||||||
{"name":"chrono.img","url":"chrono-icon.js","evaluate":true}
|
{"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,3 +1,4 @@
|
||||||
0.01: Create mario app
|
0.01: Create mario app
|
||||||
0.02: Fix day of the week and add padding
|
0.02: Fix day of the week and add padding
|
||||||
0.03: use short date format from locale, take timeout from settings
|
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
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,10 @@ function drawTime() {
|
||||||
function drawDate() {
|
function drawDate() {
|
||||||
g.setFont("6x8");
|
g.setFont("6x8");
|
||||||
g.setColor(LIGHTEST);
|
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);
|
g.drawString(dateStr, (W - g.stringWidth(dateStr))/2, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
0.01: New Widget!
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
});
|
||||||
|
})();
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Loading…
Reference in New Issue