[thunder] Show lightning image in dark themes
Signed-off-by: James Taylor <jt-git@nti.me.uk>master
parent
7a3e0d2e7e
commit
c7099bc34a
|
|
@ -1,2 +1,3 @@
|
||||||
0.01: New App!
|
0.01: New App!
|
||||||
0.02: Use locale module to display distance
|
0.02: Use locale module to display distance
|
||||||
|
0.03: Fix lightning image and flash button
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ var layout = new Layout( {
|
||||||
{type:"txt", pad:8, font:"20%", label:"", id:"distance", fillx:1},
|
{type:"txt", pad:8, font:"20%", label:"", id:"distance", fillx:1},
|
||||||
{type:"h", c: [
|
{type:"h", c: [
|
||||||
{type:"btn", font:"6x8:2", label:"Flash", cb: l=>flash() },
|
{type:"btn", font:"6x8:2", label:"Flash", cb: l=>flash() },
|
||||||
{type:"img", pad:4, src:require("heatshrink").decompress(atob("h0awkBiMQBAQFBAxwdDAoIGKCYQGGFBQTCAyIAPgIGGIAoFCAxITDAxIFDAxATEJwIMEAw4TEAwo")) },
|
{type:"img", pad:4, src:atob("DhoBH+B/gf4P8D/A/gP4H+B/AfwH8B//////7/+A/APwD4A+APADwA4AcAHABgAYAA==") },
|
||||||
{type:"btn", font:"6x8:2", label:"Boom", cb: l=>boom() }
|
{type:"btn", font:"6x8:2", label:"Boom", cb: l=>boom() }
|
||||||
]},
|
]},
|
||||||
]
|
]
|
||||||
|
|
@ -79,21 +79,27 @@ const renderIntervalCallback = function() {
|
||||||
updateTimeAndDistance();
|
updateTimeAndDistance();
|
||||||
};
|
};
|
||||||
|
|
||||||
const flash = function() {
|
const flashAndBoom = function() {
|
||||||
Bangle.buzz(50, 0.5);
|
|
||||||
|
|
||||||
startTime = startTime = Date.now();
|
|
||||||
updateTimeAndDistance();
|
|
||||||
renderIntervalId = setInterval(renderIntervalCallback, 100);
|
|
||||||
};
|
|
||||||
|
|
||||||
const boom = function() {
|
|
||||||
Bangle.buzz(50, 0.5);
|
Bangle.buzz(50, 0.5);
|
||||||
|
|
||||||
if (renderIntervalId !== undefined) {
|
if (renderIntervalId !== undefined) {
|
||||||
clearInterval(renderIntervalId);
|
clearInterval(renderIntervalId);
|
||||||
renderIntervalId = undefined;
|
renderIntervalId = undefined;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const flash = function() {
|
||||||
|
flashAndBoom();
|
||||||
|
|
||||||
|
startTime = undefined;
|
||||||
|
updateTimeAndDistance();
|
||||||
|
|
||||||
|
startTime = Date.now();
|
||||||
|
renderIntervalId = setInterval(renderIntervalCallback, 100);
|
||||||
|
};
|
||||||
|
|
||||||
|
const boom = function() {
|
||||||
|
flashAndBoom();
|
||||||
|
|
||||||
updateTimeAndDistance();
|
updateTimeAndDistance();
|
||||||
startTime = undefined;
|
startTime = undefined;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "thunder",
|
{ "id": "thunder",
|
||||||
"name": "Come on Thunder",
|
"name": "Come on Thunder",
|
||||||
"shortName":"Thunder",
|
"shortName":"Thunder",
|
||||||
"version":"0.02",
|
"version":"0.03",
|
||||||
"description": "Simple timer to calculate how far away lightning is",
|
"description": "Simple timer to calculate how far away lightning is",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool,weather",
|
"tags": "tool,weather",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue