diff --git a/apps/measuretime/ChangeLog b/apps/measuretime/ChangeLog index 81fba8e15..d0ac21aac 100644 --- a/apps/measuretime/ChangeLog +++ b/apps/measuretime/ChangeLog @@ -1 +1,2 @@ -0.1: Initial release \ No newline at end of file +0.1: Initial release +0.2: Draw line for 3d effect, fix number alignment diff --git a/apps/measuretime/README.md b/apps/measuretime/README.md index 78d04f30d..f672457f4 100644 --- a/apps/measuretime/README.md +++ b/apps/measuretime/README.md @@ -1,7 +1,9 @@ # Measure Time Measure time in a fancy way. Inspired by a Watchface I had on my first Pebble Watch. +Icon from [Flaticon created by Smartline]("https://www.flaticon.com/free-icons/scale") -Written by [prefectAtEarth](https://www.github.com/prefectAtEarth/) +Watchface written by [prefectAtEarth](https://www.github.com/prefectAtEarth/) -![](measuretime.png) \ No newline at end of file +![](screenshot_light.png) +![](screenshot_dark.png) diff --git a/apps/measuretime/measuretime-icon.js b/apps/measuretime/measuretime-icon.js index 4592548a7..635e88152 100644 --- a/apps/measuretime/measuretime-icon.js +++ b/apps/measuretime/measuretime-icon.js @@ -1 +1 @@ -require("heatshrink").decompress(atob("mEw4n/AAIHB/fe8EHrvv333xVS221jnnlFC7//9NP997zXWjHGn+EGJsu9wAC0AHBgugq99C5d0kUq1WtoAHBgnaw8nC5d9mdwgEN7QHBxvQ5nhGwQXNiQHB19A41xC5dy3YXCwAHBwkqx3tI5d3AAV8L4UIDYRkBogADpTOQhWqAAZOLAAuoxAABfyYXXI4pKRO4oACqBHl0QXWAC8IF4QABwpHRkUilALHgutvwvMBY8NoEHKakCqtHR5gAH1FY7wUFcYS/LI5Fwd4r7IqXuJ4uUAYMK1QABKhEKIAQAC1kW7SnDAAUlPxnBiN9xEnu93vx6KAAeHyMdI5wAGox3OS5GAU4oAEoAXJhTXGfigAWhAvWX6QvcT5nog5HJF5QXLX5AAC0levwXId5cNoAvJhWqAAILHgVAhxHMQaZfFwoXQI5YALO5ZHPC6bXDAAmADqYARhBHXkUilC/oA=")) \ No newline at end of file +require("heatshrink").decompress(atob("mEwgX/6AHCh////hAQIAB4ALCg4GBwF/BZH+gEfBYXBAYQLB/AbDBY3ggEBBZGAqFAGAQLE/0B6HgGAXB1WrBYP4g/QAQJHDgYLB/kf6H+BY//v/Q/+fEYwGBBYJHIBdJHBBcJTvR5anFBaKz/Wf6zhv4LBz4LG/kf6H+DgQjE/EH6ACBHY3+gPQ8EfI4+AqFAv4LH8EAgJfI/EAFwRHCAAIHB/0AFwQLGGAIuCOAILCh4GB8IKC")) diff --git a/apps/measuretime/measuretime.app.js b/apps/measuretime/measuretime.app.js index c7865bffe..97b56c710 100644 --- a/apps/measuretime/measuretime.app.js +++ b/apps/measuretime/measuretime.app.js @@ -1,7 +1,5 @@ { require("Font7x11Numeric7Seg").add(Graphics); - g.setFont("7x11Numeric7Seg"); - g.setFontAlign(0, 0); const centerY = g.getHeight() / 2; //88 const lineStart = 25; @@ -27,10 +25,10 @@ var steps = [0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; var stepsReversed = steps.slice(); stepsReversed.reverse(); - var polyLeftTop = []; - var polyLeftBottom = []; - var polyRightTop = []; - var polyRightBottom = []; + var polyLeftTop = [0, 0]; + var polyLeftBottom = [0, g.getHeight()]; + var polyRightTop = [g.getWidth() - 1, 0]; + var polyRightBottom = [g.getWidth() - 1, g.getHeight()]; let xL = 0; let xR = g.getWidth() - 1; let yT = centerY - 13; @@ -70,6 +68,16 @@ g.fillPolyAA(polyRightBottom, true); }; + let hourStringXOffset = function (hour) { + if (hour == 1) { + return lineEndFull - 5; + } + if (hour < 10 || hour >= 20) { + return lineEndFull + 5; + } + return lineEndFull - 5; + }; + let drawTime = function () { g.clear(); var d = new Date(); @@ -86,19 +94,19 @@ var lineEnd = lineEndDefault; g.setFont("7x11Numeric7Seg", 2); - g.setFontAlign(0, 0); + g.setFontAlign(-1, 0); // gone do { switch (yTopLines - 88 + mins) { case -60: lineEnd = lineEndFull; - g.drawString(d.getHours() - 1, lineEnd + 10, yTopLines, true); + g.drawString(d.getHours()-1, hourStringXOffset(d.getHours()-1), yTopLines, true); break; case 0: case 60: lineEnd = lineEndFull; - g.drawString(d.getHours(), lineEnd + 10, yTopLines, true); + g.drawString(d.getHours(), hourStringXOffset(d.getHours()), yTopLines, true); break; case 45: case -45: @@ -128,11 +136,11 @@ case 0: case 60: lineEnd = lineEndFull; - g.drawString(d.getHours() + 1, lineEnd + 10, yBottomLines, true); + g.drawString(d.getHours() + 1, hourStringXOffset(d.getHours()+1), yBottomLines, true); break; case 120: lineEnd = lineEndFull; - g.drawString(d.getHours() + 2, lineEnd + 10, yBottomLines, true); + g.drawString(d.getHours() + 2, hourStringXOffset(d.getHours()+2), yBottomLines, true); break; case 15: case 75: diff --git a/apps/measuretime/measuretime.png b/apps/measuretime/measuretime_icon.png similarity index 56% rename from apps/measuretime/measuretime.png rename to apps/measuretime/measuretime_icon.png index 67425e1dc..94d295aee 100644 Binary files a/apps/measuretime/measuretime.png and b/apps/measuretime/measuretime_icon.png differ diff --git a/apps/measuretime/metadata.json b/apps/measuretime/metadata.json index 4c0db8b32..6ba022dc0 100644 --- a/apps/measuretime/metadata.json +++ b/apps/measuretime/metadata.json @@ -1,10 +1,13 @@ { "id": "measuretime", "name": "Measure Time", - "version": "0.1", + "version": "0.2", "description": "Measure Time in a fancy way.", - "icon": "small_measuretime.png", - "screenshots": [{ "url": "measuretime.png" }], + "icon": "measuretime_icon.png", + "screenshots": [ + { "url": "screenshot_light.png" }, + { "url": "screenshot_dark.png" } + ], "type": "clock", "tags": "clock", "supports": ["BANGLEJS2"], diff --git a/apps/measuretime/screenshot_dark.png b/apps/measuretime/screenshot_dark.png new file mode 100644 index 000000000..c9f41e464 Binary files /dev/null and b/apps/measuretime/screenshot_dark.png differ diff --git a/apps/measuretime/screenshot_light.png b/apps/measuretime/screenshot_light.png new file mode 100644 index 000000000..c6a0a10e2 Binary files /dev/null and b/apps/measuretime/screenshot_light.png differ diff --git a/apps/measuretime/small_measuretime.png b/apps/measuretime/small_measuretime.png deleted file mode 100644 index 74f476dad..000000000 Binary files a/apps/measuretime/small_measuretime.png and /dev/null differ