From ec51398ef3b35c7c6660808689022e0e586f83f5 Mon Sep 17 00:00:00 2001 From: noobejby Date: Wed, 6 Nov 2024 12:58:53 +0100 Subject: [PATCH 1/5] init --- apps/bttfclock/BackToTheFuture.app.js | 234 ++++++++++++++++++++++++++ apps/bttfclock/ChangeLog.log | 1 + apps/bttfclock/README.md | 0 apps/bttfclock/bttf_clock_icon.js | 1 + apps/bttfclock/bttf_icon.png | Bin 0 -> 6644 bytes apps/bttfclock/bttf_screenshot.png | Bin 0 -> 4142 bytes apps/bttfclock/metadata.json | 16 ++ 7 files changed, 252 insertions(+) create mode 100644 apps/bttfclock/BackToTheFuture.app.js create mode 100644 apps/bttfclock/ChangeLog.log create mode 100644 apps/bttfclock/README.md create mode 100644 apps/bttfclock/bttf_clock_icon.js create mode 100644 apps/bttfclock/bttf_icon.png create mode 100644 apps/bttfclock/bttf_screenshot.png create mode 100644 apps/bttfclock/metadata.json diff --git a/apps/bttfclock/BackToTheFuture.app.js b/apps/bttfclock/BackToTheFuture.app.js new file mode 100644 index 0000000000..d250931bef --- /dev/null +++ b/apps/bttfclock/BackToTheFuture.app.js @@ -0,0 +1,234 @@ +require("Font8x16").add(Graphics); +require("Font7x11Numeric7Seg").add(Graphics); +require("Font5x7Numeric7Seg").add(Graphics); +require("Font5x9Numeric7Seg").add(Graphics); +require("Font4x5").add(Graphics); + + +const width = g.getWidth(); +const height = g.getHeight(); +const timeTextY = 4; +const timeDataY = timeTextY+19; +const DateTextY = 48; +const DateDataY = DateTextY+19; +const stepGoalBatTextY = 100; +const stepGoalBatdataY = stepGoalBatTextY+19; +const statusTextY = 140; +const statusDataY = statusTextY+19; +let stepGoal = 7000; +let steps = 0; + + +let bOn = require("heatshrink").decompress(atob("iEQwYROg3AAokYAgUMg0DAoUBwwFDgE2CIYdHAogREDoopFGoodGABI=")); + +let bOff = require("heatshrink").decompress(atob("iEQwYLIgwFF4ADBgYFBjAKCsEGBAIABhgFEgOA7AdDmApKmwpCC4OGFIYjFGoVgIIkMEZAAD")); + + + +//the following 2 sections are used from waveclk to schedule minutely updates +// timeout used to update every minute +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 getSteps() { + steps = Bangle.getHealthStatus("day").steps; +} + +function drawBackground() { + //g.setBgColor(1,1,1); + g.setBgColor('#555555'); + g.setColor(1,1,1); + g.clear(); + //g.drawImage(imgBg,0,0); + g.reset(); +} +function drawBlackBox() { + g.reset(); + g.setBgColor(1,0,0); + g.setColor(0,0,0); + + //Hour, Min and Sec + g.fillRect(50, timeDataY,50+33,timeDataY+22); + g.fillRect(90, timeDataY,90+33, timeDataY+22); + g.fillRect(128, timeDataY+8,130+24, timeDataY+8+14); + //Day, Month, Day and Year + g.fillRect(9, DateDataY,9+24, DateDataY+15); + g.fillRect(42, DateDataY,42+40, DateDataY+15); + g.fillRect(91, DateDataY,91+24, DateDataY+15); + g.fillRect(124, DateDataY,124+43, DateDataY+15); + //Present day + g.fillRect(60, 86,60+47, 86+7); + //Middle line + g.drawLine(0,95,176,95); + //Step and bat + g.fillRect(3, stepGoalBatdataY-1, 62, stepGoalBatdataY+15); + g.fillRect(121, stepGoalBatdataY-1, 150, stepGoalBatdataY+15); + + //Status + g.fillRect(62, statusDataY-1, 62+49, statusDataY+15); +} +function drawGoal() { + var goal = stepGoal <= steps; + g.reset(); + g.setColor(0,0,0); + + g.fillRect(84, stepGoalBatdataY-1, 92, stepGoalBatdataY+15); + + if (goal){ + g.reset(); + g.setColor(0,1,0); + g.fillRect(84, stepGoalBatdataY, 92, stepGoalBatdataY+7); + } else { + g.reset(); + g.setColor(1,0,0); + g.fillRect(84, stepGoalBatdataY+7, 92, stepGoalBatdataY+14); + } +} +function drawRedkBox() { + g.reset(); + g.setBgColor(1,0,0); + g.setColor(1,0,0); + //Hour, Min and Sec + g.fillRect(50, timeTextY,50+33,timeTextY+15); + g.fillRect(90, timeTextY,90+33, timeTextY+15); + g.fillRect(128, timeTextY+8,130+24, timeTextY+8+15); + //Day, Month, Day and Year + g.fillRect(9, DateTextY,9+24, DateTextY+15); + g.fillRect(42, DateTextY,42+40, DateTextY+15); + g.fillRect(91, DateTextY,91+24, DateTextY+15); + g.fillRect(124, DateTextY,124+43, DateTextY+15); + //Step, Goal and Bat + g.fillRect(2, stepGoalBatTextY,2+61, stepGoalBatTextY+15); + g.fillRect(70, stepGoalBatTextY,72+33, stepGoalBatTextY+15); + g.fillRect(120, stepGoalBatTextY,120+31, stepGoalBatTextY+15); + //Status + g.fillRect(62, statusTextY,62+49, statusTextY+15); +} + +function draw(){ + drawBackground(); + getSteps(); + drawBlackBox(); + drawRedkBox(); + drawGoal(); + var date = new Date(); + var h = date.getHours(), m = date.getMinutes(), s = date.getSeconds(); + var d = date.getDate(), w = date.getDay(), y = date.getFullYear(); + + if (h<10) { + h = ("0"+h).substr(-2); + } + if (m<10) { + m = ("0"+m).substr(-2); + } + if (s<10) { + s = ("0"+s).substr(-2); + } + if (d<10) { + d = ("0"+d).substr(-2); + } + + g.reset(); + g.setBgColor(1,0,0); + g.setColor(1,1,1); + //Draw text + //g.drawRect(x1, y1, x2, y2); + g.setFont("8x16"); + g.drawString('HOUR', 51, timeTextY+1); + g.drawString('MIN', 96, timeTextY+1); + g.drawString('SEC', 130, timeTextY+9); + + g.drawString('DAY', 10, DateTextY+1); + g.drawString('MONTH', 43, DateTextY+1); + g.drawString('DAY', 92, DateTextY+1); + g.drawString(' YEAR ', 125, DateTextY+1); + + g.drawString('STEPS', 15, stepGoalBatTextY+1); + g.drawString('GOAL', 72, stepGoalBatTextY+1); + g.drawString(' BAT ', 120, stepGoalBatTextY+1); + g.drawString('STATUS', 64, statusTextY+1); + + //time + g.reset(); + g.setBgColor(0,0,0); + g.setColor(1,0,0); + g.setFont("5x7Numeric7Seg",2); + g.drawString(s, 131, timeDataY+8); + g.setFont("7x11Numeric7Seg",2); + g.drawString(h, 53, timeDataY); + g.drawString(m, 93, timeDataY); + //Date + g.reset(); + g.setBgColor(0,0,0); + g.setColor(0,1,0); + g.setFont("5x7Numeric7Seg",2); + g.drawString(d, 13, DateDataY); + g.drawString(y, 127, DateDataY); + g.setFont("8x16"); + g.drawString(require("locale").month(new Date(), 2).toUpperCase(), 52, DateDataY); + g.drawString(require("locale").dow(new Date(), 2).toUpperCase(), 92, DateDataY); + + + //status + g.reset(); + g.setBgColor(0,0,0); + g.setColor(1,1,0); + g.setFont("5x7Numeric7Seg",2); + var step = steps; + var stepl = steps.toString().length; + var stepdDrawX = 4+(36-(stepl*6))+(4*(6-stepl)); + g.drawString(step, stepdDrawX, stepGoalBatdataY); + var bat = E.getBattery(); + var batl = bat.toString().length; + var batDrawX = 122+(18-(batl*6))+(4*(3-batl)); + g.drawString(bat, batDrawX, stepGoalBatdataY); + + //status + var b = bOff; + if (NRF.getSecurityStatus().connected){ + b = bOn; + } + g.drawImage(b, 64, statusDataY); + + + g.reset(); + g.setBgColor(0,0,0); + g.setColor(1,1,1); + g.setFont("4x5"); + g.drawString('Present day', 62, 88); + + queueDraw(); +} + +/** + * This watch is mostly dark, it does not make sense to respect the + * light theme as you end up with a white strip at the top for the + * widgets and black watch. So set the colours to the dark theme. + * + */ +g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear(); +//draw(); + +//the following section is also from waveclk +Bangle.on('lcdPower',on=>{ + if (on) { + draw(); // draw immediately, queue redraw + } else { // stop draw timer + if (drawTimeout) clearTimeout(drawTimeout); + drawTimeout = undefined; + } +}); +Bangle.setUI("clock"); +// Load widgets, but don't show them +Bangle.loadWidgets(); +require("widget_utils").swipeOn(); // hide widgets, make them visible with a swipe +g.clear(1); +draw(); \ No newline at end of file diff --git a/apps/bttfclock/ChangeLog.log b/apps/bttfclock/ChangeLog.log new file mode 100644 index 0000000000..c9fd425102 --- /dev/null +++ b/apps/bttfclock/ChangeLog.log @@ -0,0 +1 @@ +0.01: Back to the future clock first version \ No newline at end of file diff --git a/apps/bttfclock/README.md b/apps/bttfclock/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/apps/bttfclock/bttf_clock_icon.js b/apps/bttfclock/bttf_clock_icon.js new file mode 100644 index 0000000000..f2d2f8aeda --- /dev/null +++ b/apps/bttfclock/bttf_clock_icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwyEAhN0AMF1AIl2AKAXFH8Jbny4BKu5j/LZWWJ4W4AIXYhPZAJAPDzBnIMc3GjABFLZBZB25XDgP5gUaAIU7AJUbgP6AIRnB3JlEMYw/KLbAjIGIJbBWIJZDrcCvkCzkC3oBMzsCvsCrkCnhnDZomXH6BfU9HkAIIfGLoP4gU6LYRZB7sC/sDj0DnwBCrwBEBIYPBj0C7xnCMoZjD3I/QLqwhJLYpJCKIOege/gffAIX/AIwJBB4IBBv8Dn5lEZYNcH6ZfPDo4hHLYl+I4X/gkfgk/glfAJgPBAIMfM4WfgdfMYW+H6ZffW4W+LI1/gmfAKATBAIIZBMYLNBMYM/L8bfPToJbYMpZjD74/TL5ZhLBIv9vJdCLbpjJn4tBH58JupfTAJP+oJhCLsYBCFIItBH55fOBoIBBywbHF4YBDMMotJLZGYhN3L6GWhO3gUagWcgcdgeegkfGYvvmxhhEIIlBRY0fgefgcegV+gUcgO6L4V2MJhfD7ECrcC3sDr0D/8Er43FAIZhdEplfHIMDr8C70CnsB7bBCL5YJBAIO3hP5gV7gX9XocEv47JTIhdYcYaDIGoLBCgX+gV9gP8hO5YIRfLNoO4gUagWcb4MD78En4/LfYxdWDp0/HoMDn8Cz0CjkB3RfOy0J7ECncC3sDrzjBc4JDPUJBdMbYZ7Or49BgdfgW+gU9gPbhOYWYRfNrcC7pfPI4oBDMJoVVL6DBHA4OXhPZL4l+gkfgl/VKKrDJZLVDLqQBBv5fE70CrpfS/JfXJ4oBDJ4oNNL9C/FrwhBL6JTHL5ZdSAINfL4m+gU9L4WZL6E7gW9L4lfHKRVC982AIIFBA44jTL/ZhFL4pdWL4ffgc/gWeL4mYL5gLB3ECjcCzsDnwhBgk/HqzDID61/HIMD38Dj5fCjsB3cJvBfPgP7gV9gX+gYnBj4pCL+sfHoMC/8Cv0B/pfSy8B7UCrkC70DcYP/c4JfX/1BAIJfYHIQ9BgW/gVegP8gOaL5wBBy8J3MCjcCzsDjzBZL7i9EgcfgWegUdgPchOZhN3KohfFYIu4gP7gVdYInfgk/MKZfaFoM/GoMDn69E/sB3a9ML4+XgPagUcgV9gX+MK5ZB982AIJfSFIIxB/41BgX/gV+XocBzS9CL54BBCYOYgPbgU9cIQrBv5hTL6y7DGIRdCz8Cny9KL5bBFMIO5gP8MIyRB38Ej6XBMZZfSXIQlBRYK7ELoNeLomZXqDBHCoLBB3RhISoOfS4LFCMZBZB/1BAIJfILYa5DEoJdGgUdgPcgOaXqhhHPIJhB3ZhEv0CSoKZBYoJjDY4JlDr5fIBYS3ELYO/EIUfFIJdMIYJdTMIp5BDoN4MIkdGIQ1BMY4HBMoRfHK4QBBCIK3CLYm/RYU+gP9LoW6Loi9DLqZhL3QtBMIU+HIQ9BIIJNBn5LCr/GjABFBYQPBn4VBW4l/EoS5BLoO8LsRhLzTFCMYrHBMoOfLY4BHLIlfDoUeXIgrBzJdkMI5jDzDFCMYQ/BMoZVF9HkAIJfGLIf+LY2aLZBdhMIrFGhOZY4pdJMJMB7sB3gbC3UJvJduMI5jHvD7BLpZhHW4hbLLtJjPu5fTLIhb3MZxPDMJINFLIRb9MZhhJLoxZFLf4BIKooBJJ/5jbI/4B/AP4B/AP4BLA")) \ No newline at end of file diff --git a/apps/bttfclock/bttf_icon.png b/apps/bttfclock/bttf_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..e33ad3e84014529dee111a728b4c414a3d2222e0 GIT binary patch literal 6644 zcmeHKc{r5o`=9I-g=8riV<~mU?95EYI+iITYjhB^GML58$d(96qLMY)E6P%*jZ;2pZoLN_vgN!=X&46jt;i+avE|V z5J;Y6M|1|RaM2+n1)SZ*J{|%t%@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=*g#MjpEXHuK8Fv-ovINQpLA{VhtP`nigw6T^_9 z-wsEGEFohO5WeZ$$8F|nfGaYYRkJr1F(|JS1~2%9a8k@}U73NbC7 z4dlj8Il{h%^&Zv%!P_w<7jD_MU2aXW_F7+ZHMHZyOj1x5HTTtgb$H%(3Y|(G_VhjY+mkA< zHh*ehqb*Z5`>CUIj-`C>TH0>O^{V%&do7dC$rac1J`=h^2+u3TwP&BzQ2bhsRh+Mt za&UUQPOS`;LhdiTRHN-Q=}Bzq~`<`ldm8qC74=12Y=X z|LU1x>@D-O+r;5DrOkJUknp$6W+Oqyjy?YUUQeaYSAD=_q~11Y*YHsE*j8}_m7Ef6 z<-gUwp;m@SJ{UYvlpjzwWV0`gvK<8)Dn(dx zh>pt<*E2Z1CGL-SA$IX(@RU@Ha@*sMhwRda>IV+oc>_n&DpG>cCGtgi0frZKs>Yaq zW`$)egias)HHM}7RByQX<*rkh(@>4GjoD%}nV^SvUz|aKmda;KrZ#p&D(^dxOU{&o zYuj%;xvGR|f7Z$7bdbyhQGg@$mK`D|80;CB9KdV+u78DfT<({iH<#1r&Q*my+o)prqW4Y~->n=r~S$NRli+{x^ zy7Z3@CtQLogfM32Sy+FY%)EDKcWC#vDq zl+)q1-ZQ6GKYbu=lql~UcR|}*Fj1w)VcB{qqp;1oT zmPC2=1PNO9hns(5U<(RSOfa*51=@j(rCtSBscBuQ+;9^wtKyx*rBGVJ5%}4ey6SE$W$J&(y0IeC!7b@2YBKVi>OAM|yv4`a`azAD&lk^rO1)?n0s1VRogeR{ UVX(mkczXkptR09KEPZ4D2XEk%$N&HU literal 0 HcmV?d00001 diff --git a/apps/bttfclock/bttf_screenshot.png b/apps/bttfclock/bttf_screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..c756bffca33c030152916ec3b967eef946f4b00e GIT binary patch literal 4142 zcmV+}5Yg|6P)Px^=t)FDRCr$Po$Z>dDh!3&`@iV!M|bH^nq(~?2x|79b7tftgvCpYjyxZa$LkUQ z!UHG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metadata.json b/apps/bttfclock/metadata.json new file mode 100644 index 0000000000..e739f362f8 --- /dev/null +++ b/apps/bttfclock/metadata.json @@ -0,0 +1,16 @@ +{ + "id": "bttfclock", + "name": "Back To The Future", + "version": "0.01", + "description": "My favorit Garmin watchface", + "icon": "bttf_clock.png", + "screenshots": [{"url":"bttf_screenshot.png"}], + "type": "clock", + "tags": "clock", + "supports": ["BANGLEJS2"], + "allow_emulator": true, + "storage": [ + {"name":"BackToTheFuture.app.js","url":"BackToTheFuture.app.js"}, + {"name":"bttfclock.img","url":"bttf_clock_icon.js","evaluate":true} + ] +} \ No newline at end of file From e730eceaf50e157575551f24b3456a0b92f563e0 Mon Sep 17 00:00:00 2001 From: noobejby Date: Wed, 6 Nov 2024 13:26:40 +0100 Subject: [PATCH 2/5] cleanup and updated readme --- apps/bttfclock/BackToTheFuture.app.js | 4 +-- apps/bttfclock/README.md | 35 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/apps/bttfclock/BackToTheFuture.app.js b/apps/bttfclock/BackToTheFuture.app.js index d250931bef..6132adde5b 100644 --- a/apps/bttfclock/BackToTheFuture.app.js +++ b/apps/bttfclock/BackToTheFuture.app.js @@ -1,7 +1,6 @@ require("Font8x16").add(Graphics); require("Font7x11Numeric7Seg").add(Graphics); require("Font5x7Numeric7Seg").add(Graphics); -require("Font5x9Numeric7Seg").add(Graphics); require("Font4x5").add(Graphics); @@ -140,7 +139,6 @@ function draw(){ g.setBgColor(1,0,0); g.setColor(1,1,1); //Draw text - //g.drawRect(x1, y1, x2, y2); g.setFont("8x16"); g.drawString('HOUR', 51, timeTextY+1); g.drawString('MIN', 96, timeTextY+1); @@ -217,7 +215,7 @@ function draw(){ g.setTheme({bg:"#000",fg:"#fff",dark:true}).clear(); //draw(); -//the following section is also from waveclk +//the following section is from waveclk Bangle.on('lcdPower',on=>{ if (on) { draw(); // draw immediately, queue redraw diff --git a/apps/bttfclock/README.md b/apps/bttfclock/README.md index e69de29bb2..ee9b03c3d3 100644 --- a/apps/bttfclock/README.md +++ b/apps/bttfclock/README.md @@ -0,0 +1,35 @@ +# Back to the future Clock + + + +A watchface inspierd by this garmin watchface.
+ +## Todo + +- Improving quality of Fonts. +- More status icons. +- A way to change step golas. +- Improving bangle app performances (using functions for images and specialized array). + +## Functionalities + +- Current time +- Current day and month +- Steps +- Battery +- Step goal + +## Screenshots +Clock:
+ + +## Usage + + +## Links +### code ispired by +advCasioBangleClock https://github.com/dotgreg/advCasioBangleClock +93dub https://github.com/espruino/BangleApps/tree/master/apps/93dub + +### Creator +https://github.com/NoobEjby \ No newline at end of file From 848e62bd8fef46b2a43febfee177087485399812 Mon Sep 17 00:00:00 2001 From: NoobEjby Date: Wed, 6 Nov 2024 13:31:21 +0100 Subject: [PATCH 3/5] Update README.md --- apps/bttfclock/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/bttfclock/README.md b/apps/bttfclock/README.md index ee9b03c3d3..9d61acf9c1 100644 --- a/apps/bttfclock/README.md +++ b/apps/bttfclock/README.md @@ -1,6 +1,6 @@ # Back to the future Clock - +![](bttf_screenshot.png) A watchface inspierd by this garmin watchface.
@@ -17,7 +17,8 @@ A watchface inspierd by https://github.com/dotgreg/advCasioBangleClock + 93dub https://github.com/espruino/BangleApps/tree/master/apps/93dub ### Creator -https://github.com/NoobEjby \ No newline at end of file +https://github.com/NoobEjby From 33f5a908cd99f740710ec10c779bc70a257d5f61 Mon Sep 17 00:00:00 2001 From: noobejby Date: Fri, 8 Nov 2024 16:26:04 +0100 Subject: [PATCH 4/5] Updated file names to match review comment --- apps/bttfclock/{ChangeLog.log => ChangeLog} | 0 apps/bttfclock/README.md | 1 - apps/bttfclock/{bttf_clock_icon.js => app-icon.js} | 0 apps/bttfclock/{BackToTheFuture.app.js => app.js} | 0 apps/bttfclock/{bttf_icon.png => app.png} | Bin apps/bttfclock/metadata.json | 11 ++++++----- .../{bttf_screenshot.png => screenshot.png} | Bin 7 files changed, 6 insertions(+), 6 deletions(-) rename apps/bttfclock/{ChangeLog.log => ChangeLog} (100%) rename apps/bttfclock/{bttf_clock_icon.js => app-icon.js} (100%) rename apps/bttfclock/{BackToTheFuture.app.js => app.js} (100%) rename apps/bttfclock/{bttf_icon.png => app.png} (100%) rename apps/bttfclock/{bttf_screenshot.png => screenshot.png} (100%) diff --git a/apps/bttfclock/ChangeLog.log b/apps/bttfclock/ChangeLog similarity index 100% rename from apps/bttfclock/ChangeLog.log rename to apps/bttfclock/ChangeLog diff --git a/apps/bttfclock/README.md b/apps/bttfclock/README.md index ee9b03c3d3..c4269819d0 100644 --- a/apps/bttfclock/README.md +++ b/apps/bttfclock/README.md @@ -1,6 +1,5 @@ # Back to the future Clock - A watchface inspierd by this garmin watchface.
diff --git a/apps/bttfclock/bttf_clock_icon.js b/apps/bttfclock/app-icon.js similarity index 100% rename from apps/bttfclock/bttf_clock_icon.js rename to apps/bttfclock/app-icon.js diff --git a/apps/bttfclock/BackToTheFuture.app.js b/apps/bttfclock/app.js similarity index 100% rename from apps/bttfclock/BackToTheFuture.app.js rename to apps/bttfclock/app.js diff --git a/apps/bttfclock/bttf_icon.png b/apps/bttfclock/app.png similarity index 100% rename from apps/bttfclock/bttf_icon.png rename to apps/bttfclock/app.png diff --git a/apps/bttfclock/metadata.json b/apps/bttfclock/metadata.json index e739f362f8..01c885318e 100644 --- a/apps/bttfclock/metadata.json +++ b/apps/bttfclock/metadata.json @@ -2,15 +2,16 @@ "id": "bttfclock", "name": "Back To The Future", "version": "0.01", - "description": "My favorit Garmin watchface", - "icon": "bttf_clock.png", - "screenshots": [{"url":"bttf_screenshot.png"}], + "description": "The watch of Marty McFly", + "readme": "README.md", + "icon": "app.png", + "screenshots": [{"url":"screenshot.png"}], "type": "clock", "tags": "clock", "supports": ["BANGLEJS2"], "allow_emulator": true, "storage": [ - {"name":"BackToTheFuture.app.js","url":"BackToTheFuture.app.js"}, - {"name":"bttfclock.img","url":"bttf_clock_icon.js","evaluate":true} + {"name":"bttfclock.app.js","url":"app.js"}, + {"name":"bttfclock.img","url":"app-icon.js","evaluate":true} ] } \ No newline at end of file diff --git a/apps/bttfclock/bttf_screenshot.png b/apps/bttfclock/screenshot.png similarity index 100% rename from apps/bttfclock/bttf_screenshot.png rename to apps/bttfclock/screenshot.png From 44ef05891e79e57a2c217fd9bccbcd12ba3cb6a4 Mon Sep 17 00:00:00 2001 From: noobejby Date: Fri, 8 Nov 2024 16:40:05 +0100 Subject: [PATCH 5/5] removed unused values --- apps/bttfclock/app.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/bttfclock/app.js b/apps/bttfclock/app.js index 6132adde5b..a23e06edf6 100644 --- a/apps/bttfclock/app.js +++ b/apps/bttfclock/app.js @@ -3,9 +3,6 @@ require("Font7x11Numeric7Seg").add(Graphics); require("Font5x7Numeric7Seg").add(Graphics); require("Font4x5").add(Graphics); - -const width = g.getWidth(); -const height = g.getHeight(); const timeTextY = 4; const timeDataY = timeTextY+19; const DateTextY = 48; @@ -120,7 +117,7 @@ function draw(){ drawGoal(); var date = new Date(); var h = date.getHours(), m = date.getMinutes(), s = date.getSeconds(); - var d = date.getDate(), w = date.getDay(), y = date.getFullYear(); + var d = date.getDate(), y = date.getFullYear();//, w = date.getDay(); if (h<10) { h = ("0"+h).substr(-2);