The probability of horizontal lines is correlated with the battery level.

pull/2190/head
David Peer 2022-10-23 15:43:55 +02:00
parent a77ee255f8
commit 1b066ac83e
4 changed files with 17 additions and 7 deletions

View File

@ -1,2 +1,3 @@
0.01: New app!
0.02: Design improvements and fixes.
0.02: Design improvements and fixes.
0.03: Indicate battery level through line occurrence.

View File

@ -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).

View File

@ -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);

View File

@ -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.",