mirror of https://github.com/espruino/BangleApps
Merge pull request #3382 from jt-nti/thunder-themes
thunder: show lightning image in dark themespull/3387/head
commit
e9d99a21ac
|
@ -1,2 +1,3 @@
|
|||
0.01: New App!
|
||||
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:"h", c: [
|
||||
{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() }
|
||||
]},
|
||||
]
|
||||
|
@ -79,21 +79,27 @@ const renderIntervalCallback = function() {
|
|||
updateTimeAndDistance();
|
||||
};
|
||||
|
||||
const flash = function() {
|
||||
Bangle.buzz(50, 0.5);
|
||||
|
||||
startTime = startTime = Date.now();
|
||||
updateTimeAndDistance();
|
||||
renderIntervalId = setInterval(renderIntervalCallback, 100);
|
||||
};
|
||||
|
||||
const boom = function() {
|
||||
const flashAndBoom = function() {
|
||||
Bangle.buzz(50, 0.5);
|
||||
|
||||
if (renderIntervalId !== undefined) {
|
||||
clearInterval(renderIntervalId);
|
||||
renderIntervalId = undefined;
|
||||
}
|
||||
};
|
||||
|
||||
const flash = function() {
|
||||
flashAndBoom();
|
||||
|
||||
startTime = undefined;
|
||||
updateTimeAndDistance();
|
||||
|
||||
startTime = Date.now();
|
||||
renderIntervalId = setInterval(renderIntervalCallback, 100);
|
||||
};
|
||||
|
||||
const boom = function() {
|
||||
flashAndBoom();
|
||||
|
||||
updateTimeAndDistance();
|
||||
startTime = undefined;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ "id": "thunder",
|
||||
"name": "Come on Thunder",
|
||||
"shortName":"Thunder",
|
||||
"version":"0.02",
|
||||
"version":"0.03",
|
||||
"description": "Simple timer to calculate how far away lightning is",
|
||||
"icon": "app.png",
|
||||
"tags": "tool,weather",
|
||||
|
|
Loading…
Reference in New Issue