mirror of https://github.com/espruino/BangleApps
Merge branch 'master' of git://github.com/espruino/BangleApps into espruino-master
commit
5f5b5c0dc2
21
apps.json
21
apps.json
|
@ -3502,7 +3502,7 @@
|
||||||
{"name":"widclkbttm.wid.js","url":"widclkbttm.wid.js"}
|
{"name":"widclkbttm.wid.js","url":"widclkbttm.wid.js"}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{ "id": "schoolCalender",
|
{ "id": "schoolCalender",
|
||||||
"name": "School Calendar",
|
"name": "School Calendar",
|
||||||
"shortName":"SCalender",
|
"shortName":"SCalender",
|
||||||
"icon": "CalenderLogo.png",
|
"icon": "CalenderLogo.png",
|
||||||
|
@ -3514,6 +3514,23 @@
|
||||||
"data": [
|
"data": [
|
||||||
{"name":"app.json"}
|
{"name":"app.json"}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{ "id": "pastel",
|
||||||
|
"name": "Pastel Clock",
|
||||||
|
"shortName": "Pastel",
|
||||||
|
"icon": "pastel.png",
|
||||||
|
"version":"0.01",
|
||||||
|
"description": "A Configurable clock with custom fonts and background",
|
||||||
|
"tags": "clock,b2",
|
||||||
|
"type":"clock",
|
||||||
|
"readme": "README.md",
|
||||||
|
"storage": [
|
||||||
|
{"name":"pastel.app.js","url":"pastel.app.js"},
|
||||||
|
{"name":"pastel.img","url":"pastel.icon.js","evaluate":true},
|
||||||
|
{"name":"pastel.settings.js","url":"pastel.settings.js"}
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
{"name":"pastel.json"}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
0.01: First release
|
|
@ -0,0 +1,17 @@
|
||||||
|
# Pastel Clock - a configurable clock with custom fonts and background
|
||||||
|
|
||||||
|
* Designed specifically for Bangle 1 and Bangle 2
|
||||||
|
* A choice of 5 different custom fonts
|
||||||
|
* Supports the Light and Dark themes
|
||||||
|
* Has a settings menu, change font, enable/disable the grid and the date display
|
||||||
|
|
||||||
|
|
||||||
|
I came up with the name Pastel due to the shade of the grid background.
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
||||||
|
require("heatshrink").decompress(atob("mEwxH+AH4A1PYIqqAAUqp0kGMopCuVOvHHAAV4GEcAFQgAFuQwhLoIuJAAMqGEEAzovL44vgkguM49OGD0ApwvNzovfdpSQjF+FyEwskewyPFgAADX7kkA414EwIqCp14zmcuUkGJ5FEkgnFpwHHFgXBTQ0kFhpSBvAABD4KHHEY0ATAw7EFpTnHRA8Azg2FFxIvMCxGcHI0qG4kAlQuJF5gXJcIIwEvARDlSVGfZAwJuQWKSQwuCRpQAB4IvK/0kC5K0BGAouHzucvAIFL5bvHvAbCGAMkEAQuEzi0BAAZ9FX5QuH48kDgILB4IFCAAPB4IsCklySZIvKUxWdLYYABpyhBuUkIxAADHoJfSJI140SOBzgTNFxQwPQ4QuBAgK1FOoyiCF5QwBpwaIzgZBzlydgT2BCZGcHwMrmMHGJjnDAAd4JAImCvDRDGAIKBvF4uTJBA4MrrtjrljrowOAAIZCEQPBFQTuBHgpXBCYkGnBcCmVjsaTOJYOcFgZ+BeAXHkiRBAAprBrkxFAM4MAMyMgIvMkjaGKQICBMQUqfxInBlZ+DMIIGBF5QgGgAHBWQLCGAAnBgC5BFIUrR4KQNF4wGCki+DgCQHBwMySQNcFQMHSQKPTFQ4vJlS/BrhaBMgIwBd5ofHXwYALXALuCGQcxHAIvLznBD4q6JX41jmIvCdoKOBMB0ASQtyTJIADp0GdIVjgwvBMYQvMGISzEL5ucRIQAIg4vOzmdzpdBM4NOZA1OlUqBoUrFIZeCAAUrF5qSCAAIGDlSIEBgoNBGAVdBQMGmJoBgwvOG5JZBFgoNFLoIMCJgwxXO5wpYAH4A/AH4A/ABwA="))
|
|
@ -0,0 +1,7 @@
|
||||||
|
require("Storage").write("pastel.info",{
|
||||||
|
"id":"pastel",
|
||||||
|
"name":"Configurable clock with custom fonts and background",
|
||||||
|
"src":"pastel.app.js",
|
||||||
|
"icon":"pastel.img",
|
||||||
|
"type":"clock"
|
||||||
|
});
|
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
|
@ -0,0 +1,56 @@
|
||||||
|
(function(back) {
|
||||||
|
const SETTINGS_FILE = "pastel.json";
|
||||||
|
|
||||||
|
// initialize with default settings...
|
||||||
|
let s = {
|
||||||
|
'grid': false,
|
||||||
|
'date': false,
|
||||||
|
'font': "Lato"
|
||||||
|
}
|
||||||
|
|
||||||
|
// ...and overwrite them with any saved values
|
||||||
|
// This way saved values are preserved if a new version adds more settings
|
||||||
|
const storage = require('Storage')
|
||||||
|
let settings = storage.readJSON(SETTINGS_FILE, 1) || {}
|
||||||
|
const saved = settings || {}
|
||||||
|
for (const key in saved) {
|
||||||
|
s[key] = saved[key]
|
||||||
|
}
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
settings = s
|
||||||
|
storage.write(SETTINGS_FILE, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
var font_options = ["Lato","Architect","GochiHand","CabinSketch","Orbitron"];
|
||||||
|
|
||||||
|
E.showMenu({
|
||||||
|
'': { 'title': 'Pastel Clock' },
|
||||||
|
'Font': {
|
||||||
|
value: 0 | font_options.indexOf(s.font),
|
||||||
|
min: 0, max: 4,
|
||||||
|
format: v => font_options[v],
|
||||||
|
onchange: v => {
|
||||||
|
s.font = font_options[v];
|
||||||
|
save();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'Show Grid': {
|
||||||
|
value: s.grid,
|
||||||
|
format: () => (s.grid ? 'Yes' : 'No'),
|
||||||
|
onchange: () => {
|
||||||
|
s.grid = !s.grid
|
||||||
|
save()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'Show Date': {
|
||||||
|
value: s.date,
|
||||||
|
format: () => (s.date ? 'Yes' : 'No'),
|
||||||
|
onchange: () => {
|
||||||
|
s.date = !s.date
|
||||||
|
save()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'< Back': back,
|
||||||
|
})
|
||||||
|
})
|
Binary file not shown.
After Width: | Height: | Size: 37 KiB |
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
|
@ -0,0 +1,6 @@
|
||||||
|
const SETTINGS_FILE = "pastel.json";
|
||||||
|
let settings = {"grid":false, "date":false, "font":"Lato"}
|
||||||
|
|
||||||
|
require("Storage").write(SETTINGS_FILE, settings);
|
||||||
|
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{};
|
||||||
|
console.log(settings);
|
|
@ -187,7 +187,7 @@ Layout.prototype.render = function (l) {
|
||||||
var cb = {
|
var cb = {
|
||||||
"":function(){},
|
"":function(){},
|
||||||
"txt":function(l){
|
"txt":function(l){
|
||||||
g.setFont(l.font,l.fsz).setFontAlign(0,0,l.r).drawString(l.label, l.x+(l.w>>1), l.y+(l.h>>1), true/*solid bg*/);
|
g.setFont(l.font,l.fsz).setFontAlign(0,0,l.r).drawString(l.label, l.x+(l.w>>1), l.y+(l.h>>1));
|
||||||
}, "btn":function(l){
|
}, "btn":function(l){
|
||||||
var poly = [
|
var poly = [
|
||||||
l.x,l.y+4,
|
l.x,l.y+4,
|
||||||
|
|
Loading…
Reference in New Issue