Updates kanagsec clock, adds new screenshot and readme
parent
78c85f6556
commit
2e04964092
|
|
@ -1,4 +1,14 @@
|
||||||
# Kanagawa clock
|
# Kanagawa clock
|
||||||
|
|
||||||

|
This clock displays the great wave of kanagawa in the background.
|
||||||
|
|
||||||
|
It also displays:
|
||||||
|
- Hours, minutes and seconds.
|
||||||
|
- Seconds are only displayed when screen is unlocked.
|
||||||
|
- Years, monts and day as in numbers.
|
||||||
|
- Name representation of the current day.
|
||||||
|
- Current temperature from weather, if available.
|
||||||
|
- Battery level in percent.
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
@ -25,15 +25,13 @@ Graphics.prototype.setFontDarumadropOneRegular_small = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const storage = require('Storage');
|
const storage = require('Storage');
|
||||||
|
|
||||||
//require("FontHaxorNarrow7x17").add(Graphics);
|
|
||||||
require("Font8x16").add(Graphics);
|
require("Font8x16").add(Graphics);
|
||||||
|
|
||||||
var IMAGEWIDTH = 176;
|
var IMAGEWIDTH = 176;
|
||||||
var IMAGEHEIGHT = 176;
|
var IMAGEHEIGHT = 176;
|
||||||
var energySave = false;
|
var energySave = false;
|
||||||
var batteryLvl=E.getBattery()+"%";
|
var batteryLvl= E.getBattery()+"%";
|
||||||
var temperature="";
|
var temperature= getTemperature();
|
||||||
|
|
||||||
// timeout used to update every minute
|
// timeout used to update every minute
|
||||||
var drawTimeout;
|
var drawTimeout;
|
||||||
|
|
@ -60,8 +58,6 @@ function draw()
|
||||||
//draw main background image
|
//draw main background image
|
||||||
g.drawImage(getKanagawa(),0,0);
|
g.drawImage(getKanagawa(),0,0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// only update the batterylvl and temperature every 30 seconds
|
// only update the batterylvl and temperature every 30 seconds
|
||||||
if (date.getSeconds() % 30==0)
|
if (date.getSeconds() % 30==0)
|
||||||
{
|
{
|
||||||
|
|
@ -83,7 +79,7 @@ function draw()
|
||||||
|
|
||||||
var dateStr = require("locale").date(new Date(), 1);
|
var dateStr = require("locale").date(new Date(), 1);
|
||||||
dateStr = dateStr.replace(new RegExp('/', 'g'), '.');
|
dateStr = dateStr.replace(new RegExp('/', 'g'), '.');
|
||||||
|
|
||||||
var nameOfCurrentDay = require("locale").dow(date,0).toUpperCase();
|
var nameOfCurrentDay = require("locale").dow(date,0).toUpperCase();
|
||||||
|
|
||||||
//---Hour and minute---
|
//---Hour and minute---
|
||||||
|
|
@ -130,7 +126,7 @@ function getTemperature(){
|
||||||
|
|
||||||
// Stop updates when LCD is off, restart when on
|
// Stop updates when LCD is off, restart when on
|
||||||
Bangle.on('lock',on=>{
|
Bangle.on('lock',on=>{
|
||||||
if (!on)
|
if (!on)
|
||||||
{
|
{
|
||||||
energySave=false;
|
energySave=false;
|
||||||
queueDraw();
|
queueDraw();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "kanagsec",
|
"id": "kanagsec",
|
||||||
"name": "Kanagawa clock",
|
"name": "Kanagawa clock",
|
||||||
"shortName":"kanagawa",
|
"shortName":"kanagawa",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "A clock that displays the great wave of kanagawa (image from wikipedia) with seconds in active mode.",
|
"description": "A clock that displays the great wave of kanagawa (image from wikipedia) with seconds in active mode.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "clock, kanagawa, wave",
|
"tags": "clock, kanagawa, wave",
|
||||||
|
|
@ -17,6 +17,7 @@
|
||||||
],
|
],
|
||||||
"screenshots" :
|
"screenshots" :
|
||||||
[
|
[
|
||||||
{ "url":"screenshot.png" }
|
{ "url":"screenshot.png" },
|
||||||
|
{ "url":"screenshot2.png" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 919 KiB |
Loading…
Reference in New Issue