diff --git a/apps/aiclock/ChangeLog b/apps/aiclock/ChangeLog index 68f77be10..31c55aef1 100644 --- a/apps/aiclock/ChangeLog +++ b/apps/aiclock/ChangeLog @@ -1,2 +1,3 @@ 0.01: New app! -0.02: Design improvements and fixes. \ No newline at end of file +0.02: Design improvements and fixes. +0.03: Indicate battery level through line occurrence. \ No newline at end of file diff --git a/apps/aiclock/README.md b/apps/aiclock/README.md index a3855a166..9e23de3a6 100644 --- a/apps/aiclock/README.md +++ b/apps/aiclock/README.md @@ -8,14 +8,16 @@ The original output of stable diffusion is shown here: ![](orig.png) -And my implementation is shown here: +My implementation is shown below. Note that horizontal lines occur randomly, but the +probability is correlated with the battery level. So if your screen contains only +a few lines its time to charge your bangle again ;) ![](impl.png) # Thanks to -The great open source community: I used an open source diffusion model (https://github.com/CompVis/stable-diffusion) -to generate a watch face for the open source smartwatch BangleJs. +The great open-source community: I used an open-source diffusion model (https://github.com/CompVis/stable-diffusion) +to generate a watch face for the open-source smartwatch BangleJs. ## Creator - [David Peer](https://github.com/peerdavid). \ No newline at end of file diff --git a/apps/aiclock/aiclock.app.js b/apps/aiclock/aiclock.app.js index ecac5f2dc..dbd053f2c 100644 --- a/apps/aiclock/aiclock.app.js +++ b/apps/aiclock/aiclock.app.js @@ -37,8 +37,15 @@ function drawBackground() { g.setFontAlign(0,0); g.setColor(g.theme.fg); - y = 0; + var bat = E.getBattery() / 100.0; + var y = 0; while(y < H){ + // Show less lines in case of small battery level. + if(Math.random() > bat){ + y += 5; + continue; + } + y += 3 + Math.floor(Math.random() * 10); g.drawLine(0, y, W, y); g.drawLine(0, y+1, W, y+1); @@ -103,7 +110,7 @@ function drawDate(){ g.setFontAlign(0,0); g.setFontGochiHand(); - var text = ("0"+date.getDate()).substr(-2) + "/" + ("0"+date.getMonth()).substr(-2); + var text = ("0"+date.getDate()).substr(-2) + "/" + ("0"+(date.getMonth()+1)).substr(-2); var w = g.stringWidth(text); g.setColor(g.theme.bg); g.fillRect(cx-w/2-4, 20, cx+w/2+4, 40+12); diff --git a/apps/aiclock/metadata.json b/apps/aiclock/metadata.json index 5ab0c5bb3..2124b1b7e 100644 --- a/apps/aiclock/metadata.json +++ b/apps/aiclock/metadata.json @@ -3,7 +3,7 @@ "name": "AI Clock", "shortName":"AI Clock", "icon": "aiclock.png", - "version":"0.02", + "version":"0.03", "readme": "README.md", "supports": ["BANGLEJS2"], "description": "A watch face that was designed by an AI (stable diffusion) and implemented by a human.",