mirror of https://github.com/espruino/BangleApps
Improvements
parent
840f6bfe3c
commit
d3bb100512
|
@ -1 +1,2 @@
|
||||||
0.01: New app!
|
0.01: New app!
|
||||||
|
0.02: Design improvements and fixes.
|
|
@ -57,6 +57,17 @@ function drawCircle(isLocked){
|
||||||
g.fillCircle(cx, cy, 6);
|
g.fillCircle(cx, cy, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toAngle(a){
|
||||||
|
if (a < 0){
|
||||||
|
return 360 + a;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(a > 360) {
|
||||||
|
return 360 - a;
|
||||||
|
}
|
||||||
|
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
function drawTime(){
|
function drawTime(){
|
||||||
var drawHourHand = g.drawRotRect.bind(g,8,12,R-38);
|
var drawHourHand = g.drawRotRect.bind(g,8,12,R-38);
|
||||||
|
@ -74,10 +85,10 @@ function drawTime(){
|
||||||
|
|
||||||
// Draw minute and hour bg
|
// Draw minute and hour bg
|
||||||
g.setColor(g.theme.bg);
|
g.setColor(g.theme.bg);
|
||||||
drawHourHand(Math.max(0, h - 2));
|
drawHourHand(toAngle(h-3));
|
||||||
drawHourHand(Math.min(360, h + 2));
|
drawHourHand(toAngle(h+3));
|
||||||
drawMinuteHand(Math.max(0, m - 2));
|
drawMinuteHand(toAngle(m-2));
|
||||||
drawMinuteHand(Math.min(360, m + 2));
|
drawMinuteHand(toAngle(m+3));
|
||||||
|
|
||||||
// Draw minute and hour fg
|
// Draw minute and hour fg
|
||||||
g.setColor(g.theme.fg);
|
g.setColor(g.theme.fg);
|
||||||
|
@ -95,13 +106,15 @@ function drawDate(){
|
||||||
var text = ("0"+date.getDate()).substr(-2) + "/" + ("0"+date.getMonth()).substr(-2);
|
var text = ("0"+date.getDate()).substr(-2) + "/" + ("0"+date.getMonth()).substr(-2);
|
||||||
var w = g.stringWidth(text);
|
var w = g.stringWidth(text);
|
||||||
g.setColor(g.theme.bg);
|
g.setColor(g.theme.bg);
|
||||||
g.fillRect(cx-w/2-4, 20, cx+w/2+2, 40+12);
|
g.fillRect(cx-w/2-4, 20, cx+w/2+4, 40+12);
|
||||||
|
|
||||||
g.setColor(g.theme.fg);
|
g.setColor(g.theme.fg);
|
||||||
g.drawLine(cx+w/2+1, 20, cx+w/2+1, 40+12);
|
// Draw right line as designed by stable diffusion
|
||||||
g.drawLine(cx+w/2+2, 20, cx+w/2+2, 40+12);
|
g.drawLine(cx+w/2+5, 20, cx+w/2+5, 40+12);
|
||||||
g.drawLine(cx+w/2+3, 20, cx+w/2+3, 40+12);
|
g.drawLine(cx+w/2+6, 20, cx+w/2+6, 40+12);
|
||||||
g.drawLine(cx+w/2+4, 20, cx+w/2+4, 40+12);
|
g.drawLine(cx+w/2+7, 20, cx+w/2+7, 40+12);
|
||||||
|
|
||||||
|
// And finally the text
|
||||||
g.drawString(text, cx, 40);
|
g.drawString(text, cx, 40);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,13 +128,21 @@ function drawDigits(){
|
||||||
var text = ("0"+date.getHours()).substr(-2) + ":" + ("0"+date.getMinutes()).substr(-2); //Bangle.getHealthStatus("day").steps;
|
var text = ("0"+date.getHours()).substr(-2) + ":" + ("0"+date.getMinutes()).substr(-2); //Bangle.getHealthStatus("day").steps;
|
||||||
var w = g.stringWidth(text);
|
var w = g.stringWidth(text);
|
||||||
g.setColor(g.theme.bg);
|
g.setColor(g.theme.bg);
|
||||||
g.fillRect(cx-w/2-4, 120, cx+w/2+2, 140+20);
|
g.fillRect(cx-w/2-4, 120, cx+w/2+4, 140+20);
|
||||||
|
|
||||||
|
// Draw right line as designed by stable diffusion
|
||||||
|
g.setColor(g.theme.fg);
|
||||||
|
g.drawLine(cx+w/2+5, 120, cx+w/2+5, 140+20);
|
||||||
|
g.drawLine(cx+w/2+6, 120, cx+w/2+6, 140+20);
|
||||||
|
g.drawLine(cx+w/2+7, 120, cx+w/2+7, 140+20);
|
||||||
|
|
||||||
|
// And the 7set text
|
||||||
|
g.setColor("#999");
|
||||||
|
g.drawString("88:88", cx, 140);
|
||||||
|
g.drawString("88:88", cx+1, 140);
|
||||||
|
g.drawString("88:88", cx, 141);
|
||||||
|
|
||||||
g.setColor(g.theme.fg);
|
g.setColor(g.theme.fg);
|
||||||
g.drawLine(cx+w/2+1, 120, cx+w/2+1, 140+20);
|
|
||||||
g.drawLine(cx+w/2+2, 120, cx+w/2+2, 140+20);
|
|
||||||
g.drawLine(cx+w/2+3, 120, cx+w/2+3, 140+20);
|
|
||||||
g.drawLine(cx+w/2+4, 120, cx+w/2+4, 140+20);
|
|
||||||
g.drawString(text, cx, 140);
|
g.drawString(text, cx, 140);
|
||||||
g.drawString(text, cx+1, 140);
|
g.drawString(text, cx+1, 140);
|
||||||
g.drawString(text, cx, 141);
|
g.drawString(text, cx, 141);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
require("heatshrink").decompress(atob("mEwxH+lYACq2s64Ai1gqDFwgND6OswIABqwAUDAWsKIlWF4oKDFQI2BAA1XD4QAHCY4cBGQJhHBAZFEDAgAOlhCHAgInCwKNF2QtCFIMlkosPABQgCGAYJCwKMDHAMAFjQACDwIkCMAg1BRocACALsVAA0lGAYqCRwYvBLwaiB1gABAYYACxGIAQIBBeAeCCwogBgMBSAlQRwheDDoYcEGAmsw+HBguBq97C4ZgBF4QrDGYOzBAJeCBgIdDwRPCKYIIDG4umH4xgCkqQEwOzRwj2CDIwAP2QHGMAMrvbADMQOIZoQvBGgIAJroLKAA8rkgiBSAa+ETgJnCAChYBBAyDClgvFXwRfBLxJ0BVoIUBwClCeAQbBDA4kBQYVWIIa+CF4dXCQOBvYiCDQQWCAYOsb4QxDF5TwDF4oVCwWmwWCa4XXCoQvBLQhnCqxFBd42CGAQvGq0BLwIqDAAg5BH4QFBMISXDSYYAGYARCCdwg5CCo68ECoOCAgYCEC5IvJXwIWJACLjDAAYvD1YvGao4ASUQQeEQoQpBPgQvDVYRLHLh+HlcAgAuCFQQvGXwUkF5ClCCQQ0FA4YOBgErroJB6xdCL44vCL4J9IBgIgBQQQICRAZaBVIwkBEwQvIdwJRCJwQAEDYKACld0pIVBFgQVIPQgvD6wvDJYLXDSZAxCyWSLQbIKwQvGR4lQR5CVHkkkIgIAOqC/TDhEsCSEsF4pMCF4J4KADAnBF41Qkp7QACbmBF41WgNW1oHBAD5fE1gvEgBfB1mIIgoQCDooHHComCRwRfECwQ3BF4YAHCAIXBAQPXDIQdDI4QZILwINBF5LVICAIvBAIQHBAQIdBqwdBABGBEoQvFwMlBQI0BAApaBEgQBCIAJzCGIRNCAA0rEgOAF4wKCR5AgCF4VQP4QXBAYKPKEgRNCAASZCSBRfDSIZGCFwTvCRxEAlgvHYAMADoTvGFAToDCoQJCE4TuHEYSOC2QgDBYUrwTvIAYiICDIQDDHYKHBC4SDBgDuDQAiQDEgQAVF4YFCKQQnB2SMBSQTADSBAASrrKDRwYrCAgI7CSAhpBxCtCew4AJwOICgaOG65sBcIgODAAIZBcBILCAYWCwOHAoISCKAeAXwYvBSAgPCCAIACBAIARC4YeCEgIpDZgoVCCIQAJEAQjECJRdBRwqQDGAd7I4QvKKYoNHdQQuELwQwGB4QUCVAQAPCY7ZBEoQuEHoIKCBYLoDXyYxDFgIiEFwphFAAuyDAIAQDY6MFA="))
|
require("heatshrink").decompress(atob("mEwgP/ACfAEZU/ECZELIKhSR/+PAoWAv4FDhk/x/ggP+j0fx/AgP8n8PCIX8CwIFC/F/w4FBgP4gEHC4QFE//w//DC4QFB8YFC+P/8IdCAoYdBAoPxDoQAd+CiKh4dQwDhfAA4A="))
|
Binary file not shown.
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.5 KiB |
|
@ -3,7 +3,7 @@
|
||||||
"name": "AI Clock",
|
"name": "AI Clock",
|
||||||
"shortName":"AI Clock",
|
"shortName":"AI Clock",
|
||||||
"icon": "aiclock.png",
|
"icon": "aiclock.png",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"supports": ["BANGLEJS2"],
|
"supports": ["BANGLEJS2"],
|
||||||
"description": "A watch face that was designed by an AI (stable diffusion) and implemented by a human.",
|
"description": "A watch face that was designed by an AI (stable diffusion) and implemented by a human.",
|
||||||
|
|
Loading…
Reference in New Issue