mirror of https://github.com/espruino/BangleApps
Merge pull request #2431 from alainsaas/master
a_clock_timer v0.02 : shows night time on the clock's map ; a_speech_timer v0.02: forces light themepull/2448/head^2
commit
a236909ab7
|
@ -1 +1,2 @@
|
|||
0.01: Beta version for Bangle 2 (2021/11/28)
|
||||
0.02: Shows night time on the map (2022/12/28)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* Other time zones
|
||||
* Currently hardcoded to Paris and Tokyo (this will be customizable in a future version)
|
||||
* World Map
|
||||
* The yellow line shows the position of the sun
|
||||
* The map shows day and night on Earth and the position of the Sun (yellow line)
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -102,13 +102,24 @@ function queueNextDraw() {
|
|||
function draw() {
|
||||
g.reset().clearRect(0,24,g.getWidth(),g.getHeight()-IMAGEHEIGHT);
|
||||
g.drawImage(getImg(),0,g.getHeight()-IMAGEHEIGHT);
|
||||
|
||||
|
||||
var x_sun = 176 - (getGmt().getHours() / 24 * 176 + 4);
|
||||
g.setColor('#ff0').drawLine(x_sun, g.getHeight()-IMAGEHEIGHT, x_sun, g.getHeight());
|
||||
g.reset();
|
||||
|
||||
var x_night_start = 176 - (((getGmt().getHours()-6)%24) / 24 * 176 + 4);
|
||||
var x_night_end = 176 - (((getGmt().getHours()+6)%24) / 24 * 176 + 4);
|
||||
for (let x = x_night_start; x < 176; x+=2) {
|
||||
g.setColor('#000').drawLine(x, g.getHeight()-IMAGEHEIGHT, x, g.getHeight());
|
||||
}
|
||||
if (x_night_end < x_night_start) {
|
||||
for (let x = 0; x < x_night_end; x+=2) {
|
||||
g.setColor('#000').drawLine(x, g.getHeight()-IMAGEHEIGHT, x, g.getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
var locale = require("locale");
|
||||
|
||||
|
||||
var date = new Date();
|
||||
g.setFontAlign(0,0);
|
||||
g.setFont("Michroma36").drawString(locale.time(date,1), g.getWidth()/2, 46);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "a_clock_timer",
|
||||
"name": "A Clock with Timer",
|
||||
"version": "0.01",
|
||||
"version": "0.02",
|
||||
"description": "A Clock with Timer, Map and Time Zones",
|
||||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -1,2 +1,3 @@
|
|||
1.00: Release (2021/12/01)
|
||||
1.01: Grey font when timer is frozen (2021/12/04)
|
||||
1.02: Force light theme, since the app is not designed for dark theme (2022/12/28)
|
||||
|
|
|
@ -166,6 +166,7 @@ function draw() {
|
|||
g.drawRect(88+8,138-24, 176-10, 138+22);
|
||||
}
|
||||
|
||||
g.setTheme({bg:"#fff",fg:"#000",dark:false}).clear();
|
||||
require("FontHaxorNarrow7x17").add(Graphics);
|
||||
g.clear();
|
||||
Bangle.loadWidgets();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"id":"a_speech_timer",
|
||||
"name":"Speech Timer",
|
||||
"icon": "app.png",
|
||||
"version":"1.01",
|
||||
"version":"1.02",
|
||||
"description": "A timer designed to help keeping your speeches and presentations to time.",
|
||||
"tags": "tool,timer",
|
||||
"readme":"README.md",
|
||||
|
|
Loading…
Reference in New Issue