mirror of https://github.com/espruino/BangleApps
Add files via upload
parent
de5b976d4f
commit
fedf2d3190
|
@ -65,6 +65,8 @@ Report bugs or request a feature at [github.com/naden](https://github.com/naden)
|
||||||
## Roadmap
|
## Roadmap
|
||||||
* add a seconds coundown layout; mimic a classic regatta chronograph
|
* add a seconds coundown layout; mimic a classic regatta chronograph
|
||||||
* add recording of gps course and race time
|
* add recording of gps course and race time
|
||||||
|
* add icons for light mode
|
||||||
|
* add flag icons
|
||||||
|
|
||||||
## Created by
|
## Created by
|
||||||
© 2021 - 2024 [naden.de](https://naden.de)
|
© 2021 - 2024 [naden.de](https://naden.de)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("mEw4n/8H/BAWlsEI0ExkFj0H34GcgHnwGUsHO4H/kEhkGl4He8HeI8dgCyvTiM0ruABxNoxAACwwIC4MRAAMUkAWHgoNCAAMdBIVBBAccuAXGsIXIwtEmIxD0AXFhgXIAAMI6oZCnIXFh1VqtRC44AB2RkCqBiHC5UAhIxBip5KC5EA8gwIyMRiYXKgyWBjIIEhQgBpIXKgEEEwKSEA4MU3IXLhYwBoAHDuMRn8JC5cA8cRi4eDTIOQC5oNBjgFChoFChEx4wXKgApB6BeDiQEBxVgC5chMAeBiM7CZYAD2cRjAEB6L3JAA7oBNwVRJgYANOQMVAgKtBwAXPhDRBAgMxiYDBylEB4lk+C3D6gnBCYYbDrAnFrngIgeUDoKoBgEGC4dHyxWEqgXDXAIXBLYNgC4ldykAhWoIwNk8EL1TIBC4pHEBYOAgV+gFV6mbg13C4hHCMYcGqEMd4fXuhOEC4R3DU4eUpLPFL4kFwCnEa6/RiNQC58FiMdAgOBiM7C5+ziMYMwURiQXPkMRoAEBgURjgXPUwJyDAoOQCxsJFIOwAwVxiM+C5vjiMXY4itBaoYAIgzRBLwQABhUxA4oAHE4MT0AIEyIwMFwRGEYwcRpwXJ8gNBdA9RHIKSIhJVBir3JTIMrBQuyWoIuIAAOTBgMTruAA4MI6otBiM3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nton = function(scale) {
|
||||||
|
|
||||||
function Regattatimer() {
|
function Regattatimer() {
|
||||||
return {
|
return {
|
||||||
icons: {
|
|
||||||
"satellite": function() {
|
|
||||||
return hs.decompress(atob("jEYxH+AH4Ab6QIIBJAfNAAQtSC4gxSCwgYHHBYYMC6IYPC5AZOC8QYMC5YYLC5inSDH4waVbAYJCpgA/AAI="));
|
|
||||||
},
|
|
||||||
"battery": function() {
|
|
||||||
return hs.decompress(atob("jEYxH+AHHSAAgXmCgoaRC/4X/C/4X/C/4X/C64Ap"));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
layout: undefined,
|
layout: undefined,
|
||||||
/*
|
/*
|
||||||
layouts: {
|
layouts: {
|
||||||
|
@ -51,6 +43,33 @@ function Regattatimer() {
|
||||||
countdown: 300, // 5 minutes
|
countdown: 300, // 5 minutes
|
||||||
counter: undefined,
|
counter: undefined,
|
||||||
interval: undefined,
|
interval: undefined,
|
||||||
|
theme: null,
|
||||||
|
themes: {
|
||||||
|
"Light": {
|
||||||
|
"fgColor": "#000000",
|
||||||
|
"bgColor": "#FFFF00",
|
||||||
|
"icons": {
|
||||||
|
"satellites": function() {
|
||||||
|
return hs.decompress(atob("jEYxH+AH4Ab6QIIBJAfNAAQtSC4gxSCwgYHHBYYMC6IYPC5AZOC8QYMC5YYLC5inSDH4waVbAYJCpgA/AAI="));
|
||||||
|
},
|
||||||
|
"battery": function() {
|
||||||
|
return hs.decompress(atob("jEYxH+AHHSAAgXmCgoaRC/4X/C/4X/C/4X/C64Ap"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Dark": {
|
||||||
|
"fgColor": "#FFFF00",
|
||||||
|
"bgColor": "#000000",
|
||||||
|
"icons": {
|
||||||
|
"satellites": function() {
|
||||||
|
return hs.decompress(atob("jEYxH+AH4Ab6QIIBJAfNAAQtSC4gxSCwgYHHBYYMC6IYPC5AZOC8QYMC5YYLC5inSDH4waVbAYJCpgA/AAI="));
|
||||||
|
},
|
||||||
|
"battery": function() {
|
||||||
|
return hs.decompress(atob("jEYxH+AHHSAAgXmCgoaRC/4X/C/4X/C/4X/C64Ap"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
settings: Object.assign({
|
settings: Object.assign({
|
||||||
"debug": false,
|
"debug": false,
|
||||||
"buzzer": true,
|
"buzzer": true,
|
||||||
|
@ -58,8 +77,6 @@ function Regattatimer() {
|
||||||
"gps": true,
|
"gps": true,
|
||||||
"record": false,
|
"record": false,
|
||||||
"theme": "Dark",
|
"theme": "Dark",
|
||||||
"fgColor": "#FFFF00",
|
|
||||||
"bgColor": "#000000"
|
|
||||||
}, require('Storage').readJSON("regattatimer.json", true) || {}),
|
}, require('Storage').readJSON("regattatimer.json", true) || {}),
|
||||||
|
|
||||||
translations: Object.assign({
|
translations: Object.assign({
|
||||||
|
@ -79,14 +96,7 @@ function Regattatimer() {
|
||||||
this.countdown = 1;
|
this.countdown = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.settings.theme == "Dark") {
|
this.theme = this.themes[this.settings.theme];
|
||||||
this.settings.fgColor = "#FFFF00";
|
|
||||||
this.settings.bgColor = "#000000";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.settings.fgColor = "#000000";
|
|
||||||
this.settings.bgColor = "#FFFF00";
|
|
||||||
}
|
|
||||||
|
|
||||||
Bangle.setLCDPower(1);
|
Bangle.setLCDPower(1);
|
||||||
Bangle.setLCDTimeout(0);
|
Bangle.setLCDTimeout(0);
|
||||||
|
@ -202,7 +212,7 @@ function Regattatimer() {
|
||||||
this.interval = undefined;
|
this.interval = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(settings.buzzer) {
|
if(this.settings.buzzer) {
|
||||||
Bangle.buzz();
|
Bangle.buzz();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,13 +242,13 @@ function Regattatimer() {
|
||||||
|
|
||||||
this.layout = new Layout({
|
this.layout = new Layout({
|
||||||
type: "v",
|
type: "v",
|
||||||
bgCol: this.settings.bgColor,
|
bgCol: this.theme.bgColor,
|
||||||
c: [
|
c: [
|
||||||
{
|
{
|
||||||
type: "v",
|
type: "v",
|
||||||
c: [
|
c: [
|
||||||
{type: "txt", font: "Anton", label: "5", col: this.settings.fgColor, id: "minutes", fillx: 1, filly: 1},
|
{type: "txt", font: "Anton", label: "5", col: this.theme.fgColor, id: "minutes", fillx: 1, filly: 1},
|
||||||
{type: "txt", font: "20%", label: "--:--", col: this.settings.fgColor, id: "daytime", fillx: 1, filly: 1}
|
{type: "txt", font: "20%", label: "--:--", col: this.theme.fgColor, id: "daytime", fillx: 1, filly: 1}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]}, {lazy: true});
|
]}, {lazy: true});
|
||||||
|
@ -256,13 +266,13 @@ function Regattatimer() {
|
||||||
|
|
||||||
this.layout = new Layout({
|
this.layout = new Layout({
|
||||||
type: "v",
|
type: "v",
|
||||||
bgCol: this.settings.bgColor,
|
bgCol: this.theme.bgColor,
|
||||||
c: [
|
c: [
|
||||||
{
|
{
|
||||||
type: "h",
|
type: "h",
|
||||||
c: [
|
c: [
|
||||||
{type: "txt", font: "Anton", label: "4", col: this.settings.fgColor, id: "minutes", fillx: 1, filly: 1},
|
{type: "txt", font: "Anton", label: "4", col: this.theme.fgColor, id: "minutes", fillx: 1, filly: 1},
|
||||||
{type: "txt", font: "Anton", label: "59", col: this.settings.fgColor, id: "seconds", fillx: 1, filly: 1},
|
{type: "txt", font: "Anton", label: "59", col: this.theme.fgColor, id: "seconds", fillx: 1, filly: 1},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]}, {lazy: true}
|
]}, {lazy: true}
|
||||||
|
@ -273,9 +283,9 @@ function Regattatimer() {
|
||||||
|
|
||||||
this.layout = new Layout({
|
this.layout = new Layout({
|
||||||
type: "v",
|
type: "v",
|
||||||
bgCol: this.settings.bgColor,
|
bgCol: this.theme.bgColor,
|
||||||
c:[
|
c:[
|
||||||
{type: "txt", font: "Anton", label: "", fillx: true, filly: true, col: this.settings.fgColor, id: "seconds"},
|
{type: "txt", font: "Anton", label: "", fillx: true, filly: true, col: this.theme.fgColor, id: "seconds"},
|
||||||
]}, {lazy: true});
|
]}, {lazy: true});
|
||||||
},
|
},
|
||||||
setLayoutRace: function() {
|
setLayoutRace: function() {
|
||||||
|
@ -283,23 +293,23 @@ function Regattatimer() {
|
||||||
|
|
||||||
this.layout = new Layout({
|
this.layout = new Layout({
|
||||||
type: "v",
|
type: "v",
|
||||||
bgCol: this.settings.bgColor,
|
bgCol: this.theme.bgColor,
|
||||||
c: [
|
c: [
|
||||||
{type: "txt", font: "20%", label: "00:00:00", col: this.settings.fgColor, pad: 4, filly: 1, fillx: 1, id: "racetime"},
|
{type: "txt", font: "20%", label: "00:00:00", col: this.theme.fgColor, pad: 4, filly: 1, fillx: 1, id: "racetime"},
|
||||||
{type: "txt", font: "15%", label: "-", col: this.settings.fgColor, pad: 4, filly:1, fillx:1, id: "daytime"},
|
{type: "txt", font: "15%", label: "-", col: this.theme.fgColor, pad: 4, filly:1, fillx:1, id: "daytime"},
|
||||||
// horizontal
|
// horizontal
|
||||||
{type: "h", c: [
|
{type: "h", c: [
|
||||||
{type: "txt", font: "10%", label: this.translate("speed"), col: this.settings.fgColor, pad:4, fillx:1, filly:1},
|
{type: "txt", font: "10%", label: this.translate("speed"), col: this.theme.fgColor, pad:4, fillx:1, filly:1},
|
||||||
{type: "txt", font: "20%", label: "0", col: this.settings.fgColor, pad:4, fillx:1, filly:1, id: "speed"},
|
{type: "txt", font: "20%", label: "0", col: this.theme.fgColor, pad:4, fillx:1, filly:1, id: "speed"},
|
||||||
{type: "txt", font: "10%", label: this.translate("speed_unit"), col: this.settings.fgColor, pad:4, fillx:1, filly:1},
|
{type: "txt", font: "10%", label: this.translate("speed_unit"), col: this.theme.fgColor, pad:4, fillx:1, filly:1},
|
||||||
]},
|
]},
|
||||||
{type: "h", c: [
|
{type: "h", c: [
|
||||||
{type:"img", pad: 2, src: this.icons.satellite()},
|
{type:"img", pad: 2, src: this.theme["icons"].satellites()},
|
||||||
{type: "txt", font: "10%", label: "0", col: this.settings.fgColor, pad: 2, filly:1, id: "satellites"},
|
{type: "txt", font: "10%", label: "0", col: this.theme.fgColor, pad: 2, filly:1, id: "satellites"},
|
||||||
// hacky, use empty element with fillx to push the other elments to the left an right side
|
// hacky, use empty element with fillx to push the other elments to the left an right side
|
||||||
{type: undefined, pad: 2, fillx: 1},
|
{type: undefined, pad: 2, fillx: 1},
|
||||||
{type:"img", pad: 2, src: this.icons.battery()},
|
{type:"img", pad: 2, src: this.theme["icons"].battery()},
|
||||||
{type: "txt", font: "10%", label: "-", col: this.settings.fgColor, pad: 2, filly: 1, id: "battery"},
|
{type: "txt", font: "10%", label: "-", col: this.theme.fgColor, pad: 2, filly: 1, id: "battery"},
|
||||||
]}
|
]}
|
||||||
]}, {lazy: true});
|
]}, {lazy: true});
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -4,7 +4,5 @@
|
||||||
"dial": "Numeric",
|
"dial": "Numeric",
|
||||||
"gps": true,
|
"gps": true,
|
||||||
"record": false,
|
"record": false,
|
||||||
"theme": "Dark",
|
"theme": "Dark"
|
||||||
"fgColor": "#FFFF00",
|
|
||||||
"bgColor": "#000000"
|
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -15,8 +15,6 @@
|
||||||
"gps": true,
|
"gps": true,
|
||||||
"record": false,
|
"record": false,
|
||||||
"theme": "Dark",
|
"theme": "Dark",
|
||||||
"fgColor": "#FFFF00",
|
|
||||||
"bgColor": "#000000"
|
|
||||||
}, storage.readJSON(file, true) || {});
|
}, storage.readJSON(file, true) || {});
|
||||||
|
|
||||||
function save(key, value) {
|
function save(key, value) {
|
||||||
|
@ -77,4 +75,4 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
})
|
})(load)
|
||||||
|
|
Loading…
Reference in New Issue