diff --git a/apps/macwatch/ChangeLog b/apps/macwatch/ChangeLog new file mode 100644 index 000000000..221d3fb57 --- /dev/null +++ b/apps/macwatch/ChangeLog @@ -0,0 +1 @@ +0.01: Created my first BangleJS app! diff --git a/apps/macwatch/README.md b/apps/macwatch/README.md new file mode 100644 index 000000000..1b7add3e5 --- /dev/null +++ b/apps/macwatch/README.md @@ -0,0 +1,26 @@ +# MacWatch + +A very simple clock using big numbers in the original Macintosh Chicago font. + +Touch the screen to show the date in numerical format. + +Touch the screen again to revert to the time. + +Time updates every 15 seconds. + +## In dark mode + +![](screenshot-dark-time.png) +![](screenshot-dark-date.png) + +## In light mode + +![](screenshot-light-time.png) +![](screenshot-light-date.png) + +## The watch in use +![](photo-watch-in-use.jpg) + +## Creator + +Written by Giles Booth | [twitter](https://twitter.com/blogmywiki) | [blog](http://www.suppertime.co.uk/blogmywiki/) diff --git a/apps/macwatch/app-icon.js b/apps/macwatch/app-icon.js new file mode 100644 index 000000000..f4592b508 --- /dev/null +++ b/apps/macwatch/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwkBIf4AOh//AggADC8YRCBIwXlI4oX/C5QWOC74WPC/4X/C6AA/AH4AmXwK5DAobBNC60P+DqHFxwXWCJAWRC44vUPwouRJKQXWBxAXlOAIgQbBDeLFxAXXAAa/RC64A/AH4AKA==")) diff --git a/apps/macwatch/app.js b/apps/macwatch/app.js new file mode 100644 index 000000000..fb9712a36 --- /dev/null +++ b/apps/macwatch/app.js @@ -0,0 +1,54 @@ +var font = atob("f3/gMB/7+AAAACA///AAAAAAQcHhsZ+LhAAAgUhsPh38eAAADAoJCI///BAA8XhkMhn8eAAAPz/0Mhn4eAAAgEAh8f+HgAAAb3/kMh/7eAAAeH5hML/z8AAAAAADYbAAAAAA"); + +function draw() { + g.reset(); + g.setFontCustom(font, 48, 8, 1801); + g.setFontAlign(0, -1, 0); + if (showDate) { + if (g.theme.dark) { + g.setColor("#00ffff"); // cyan date numbers for dark mode + } + else { + g.setColor("#0000ff"); // blue date numbers for light mode + } + line1 = ("0"+(new Date()).getDate()).substr(-2); + line2 = ("0"+((new Date()).getMonth()+1)).substr(-2); + } + else { + if (g.theme.dark) { + g.setColor(1,1,1); // white time numbers for dark mode + } + else { + g.setColor(0); // black time numbers for light mode + } + var d = new Date(); + var da = d.toString().split(" "); + line1 = da[4].substr(0,2); + line2 = da[4].substr(3,2); + } + g.drawString(line1, 95, 30, true); + g.drawString(line2, 95, 106, true); + } + +// handle switch display on by pressing BTN1 +Bangle.on('lcdPower', function(on) { + if (on) draw(); +}); + +Bangle.on('touch', function(on) { + if (on) { + showDate = !showDate; // toggle date mode on and off + draw(); + } +}); + +g.clear(); +var showDate = 0; +setInterval(draw, 15000); // refresh display every 15s +draw(); + +// Show launcher when button pressed +Bangle.setUI("clock"); + +Bangle.loadWidgets(); +Bangle.drawWidgets(); diff --git a/apps/macwatch/app.png b/apps/macwatch/app.png new file mode 100644 index 000000000..9618b8b50 Binary files /dev/null and b/apps/macwatch/app.png differ diff --git a/apps/macwatch/metadata.json b/apps/macwatch/metadata.json new file mode 100644 index 000000000..0a2558380 --- /dev/null +++ b/apps/macwatch/metadata.json @@ -0,0 +1,17 @@ +{ "id": "macwatch", + "name": "MacWatch", + "shortName":"MacWatch", + "icon": "app.png", + "version":"0.01", + "description": "Simple clock with classic Mac font", + "type": "clock", + "tags": "clock", + "supports": ["BANGLEJS2"], + "screenshots": [{"url":"screenshot-dark-date.png"}], + "readme": "README.md", + "allow_emulator": true, + "storage": [ + {"name":"macwatch.app.js","url":"app.js"}, + {"name":"macwatch.img","url":"app-icon.js","evaluate":true} + ] +} diff --git a/apps/macwatch/photo-watch-in-use.jpg b/apps/macwatch/photo-watch-in-use.jpg new file mode 100644 index 000000000..16ae57c3e Binary files /dev/null and b/apps/macwatch/photo-watch-in-use.jpg differ diff --git a/apps/macwatch/screenshot-dark-date.png b/apps/macwatch/screenshot-dark-date.png new file mode 100644 index 000000000..68d1d80f9 Binary files /dev/null and b/apps/macwatch/screenshot-dark-date.png differ diff --git a/apps/macwatch/screenshot-dark-time.png b/apps/macwatch/screenshot-dark-time.png new file mode 100644 index 000000000..dc9e32df2 Binary files /dev/null and b/apps/macwatch/screenshot-dark-time.png differ diff --git a/apps/macwatch/screenshot-light-date.png b/apps/macwatch/screenshot-light-date.png new file mode 100644 index 000000000..e4bee235f Binary files /dev/null and b/apps/macwatch/screenshot-light-date.png differ diff --git a/apps/macwatch/screenshot-light-time.png b/apps/macwatch/screenshot-light-time.png new file mode 100644 index 000000000..45abff84a Binary files /dev/null and b/apps/macwatch/screenshot-light-time.png differ diff --git a/apps/macwatch2/ChangeLog b/apps/macwatch2/ChangeLog new file mode 100644 index 000000000..a60193ba7 --- /dev/null +++ b/apps/macwatch2/ChangeLog @@ -0,0 +1,3 @@ +0.01: Created first version of the app with numeric date, only works in light mode +0.02: New icon, shimmied date right a bit +0.03: Incorporated improvements from Peer David for accuracy, fix dark mode, widgets run in background diff --git a/apps/macwatch2/IMG_3782 crop.JPG b/apps/macwatch2/IMG_3782 crop.JPG new file mode 100644 index 000000000..2c0bc375a Binary files /dev/null and b/apps/macwatch2/IMG_3782 crop.JPG differ diff --git a/apps/macwatch2/README.md b/apps/macwatch2/README.md new file mode 100644 index 000000000..217807e9b --- /dev/null +++ b/apps/macwatch2/README.md @@ -0,0 +1,19 @@ +# MacWatch2 + +A clock inspired by Susan Kare's original 1984 Macintosh desktop design. + +Ideas for development: +- [x] fix dark mode either by forcing black on white or doing proper inverse display and text +- [] date in text format +- [] tap to load different info in window +- [] unlock to show seconds, perhaps flip time and date? +- [] incorporate widgets somehow either by leaving space or adding Chicago font widgets of my own in top bar + +![](screenshot.png) + +![](IMG_3782%20crop.JPG) + +## Creator + +Written by Giles Booth | [twitter](https://twitter.com/blogmywiki) | [blog](http://www.suppertime.co.uk/blogmywiki/) +Improvements for accuracy, dark mode and widgets running in background by [Peer David](https://gist.github.com/peerdavid) diff --git a/apps/macwatch2/app-icon.js b/apps/macwatch2/app-icon.js new file mode 100644 index 000000000..be7d5e060 --- /dev/null +++ b/apps/macwatch2/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwgn/AH4A/AH4AfdIoX/C/4X4CIwYQC6wPIDBwX/C6IYNC7TVFC9IEFO6YX/VBQWPC7CmDVIoX/C/4X2AH4A/ADwA==")) diff --git a/apps/macwatch2/app.js b/apps/macwatch2/app.js new file mode 100644 index 000000000..3b78d5baf --- /dev/null +++ b/apps/macwatch2/app.js @@ -0,0 +1,64 @@ +// 68k Mac Finder desktop themed clock +// by Giles Booth @blogmywiki +// improvements by Peer David + +var img = require("heatshrink").decompress(atob("2GwgP4C6cf8AVTg/ACqcDwADBDCMBCoICCCqACEj8zAwXwmcYgEGswYHhxwBjEDGocwCoVgQxHwCoMzjwVBwPzngrCnlmDAsfNoIVBIQMBwZBEAAIVIjwVD8YVNIIc/FY9+CpcwCo9gCo0PQYUzmIVGo1is1ACokGNoaDC+PzhkAg+Gnl/aiIA/AD//AClVACmqACgr/Fd2vVqP+FYNUbKMNFYOsCqMOFa+t/f/35LC/AODK43uFYUCgGACAUB/IFDFZP6gArEsArTgFhz9w+ArRsOZzOYFaQVCFan4FaiFHFZuIFaeYQZbbVf5LbK1gVRhwrX15MGABX+K/4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Ff4r/Fe+v/4AQ/wrBq4VR/orBAClVACgr/Ff4r/AAmr6or/q/6Fae/A=")); + +var font = atob("f3/gMB/7+AAAACA///AAAAAAQcHhsZ+LhAAAgUhsPh38eAAADAoJCI///BAA8XhkMhn8eAAAPz/0Mhn4eAAAgEAh8f+HgAAAb3/kMh/7eAAAeH5hML/z8AAAAAADYbAAAAAA"); + +var drawTimeout; + +// schedule a draw for the next minute +function queueDraw() { + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = setTimeout(function() { + drawTimeout = undefined; + draw(); + }, 60000 - (Date.now() % 60000)); +} + + +function draw() { + queueDraw(); + + // Fix theme to "light" + g.setTheme({bg:"#fff", fg:"#000", dark:false}).clear(); + g.reset(); + g.drawImage(img,0,0); + + g.setFontCustom(font, 48, 8, 1033); + g.setFontAlign(0, -1, 0); + g.setColor(0,0,0); + var d = new Date(); + var da = d.toString().split(" "); + hh = da[4].substr(0,2); + mi = da[4].substr(3,2); + dd = ("0"+(new Date()).getDate()).substr(-2); + mo = ("0"+((new Date()).getMonth()+1)).substr(-2); + yy = ("0"+((new Date()).getFullYear())).substr(-2); + g.drawString(hh, 52, 65, true); + g.drawString(mi, 132, 65, true); + g.drawString(':', 93,65); + g.setFontCustom(font, 48, 8, 521); + g.drawString(dd + ':' + mo + ':' + yy, 88, 120, true); + + // Hide widgets + for (let wd of WIDGETS) {wd.draw=()=>{};wd.area="";} +} + + +// handle switch display on by pressing BTN1 +Bangle.on('lcdPower',on=>{ + if (on) { + draw(); // draw immediately, queue redraw + } else { // stop draw timer + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = undefined; + } +}); + + +// Load widgets but hide them +Bangle.loadWidgets(); +draw(); +Bangle.setUI("clock"); diff --git a/apps/macwatch2/app.png b/apps/macwatch2/app.png new file mode 100644 index 000000000..efcdead19 Binary files /dev/null and b/apps/macwatch2/app.png differ diff --git a/apps/macwatch2/metadata.json b/apps/macwatch2/metadata.json new file mode 100644 index 000000000..09ec01e06 --- /dev/null +++ b/apps/macwatch2/metadata.json @@ -0,0 +1,17 @@ +{ "id": "macwatch2", + "name": "MacWatch2", + "shortName":"MacWatch2", + "icon": "app.png", + "version":"0.03", + "description": "Classic Mac Finder clock", + "type": "clock", + "tags": "clock", + "supports": ["BANGLEJS2"], + "screenshots": [{"url":"screenshot.png"}], + "readme": "README.md", + "allow_emulator": true, + "storage": [ + {"name":"macwatch2.app.js","url":"app.js"}, + {"name":"macwatch2.img","url":"app-icon.js","evaluate":true} + ] +} diff --git a/apps/macwatch2/screenshot.png b/apps/macwatch2/screenshot.png new file mode 100644 index 000000000..732b29d7f Binary files /dev/null and b/apps/macwatch2/screenshot.png differ