commit
4606d1a4ae
|
|
@ -39,16 +39,15 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
// offsets and incerments
|
// offsets and incerments
|
||||||
const xs = 30;
|
const xs = 35;
|
||||||
const ys = 20;
|
const ys = 31;
|
||||||
const dy = 22;
|
const dy = 22;
|
||||||
const dx = 25;
|
const dx = 25;
|
||||||
|
|
||||||
// font size and color
|
// font size and color
|
||||||
const wordFontSize = 20;
|
const fontSize = 3; // "6x8"
|
||||||
const timeFontSize = 30;
|
const passivColor = 0x3186 /*grey*/ ;
|
||||||
const passivColor = 0x3186/*grey*/;
|
const activeColor = 0xF800 /*red*/ ;
|
||||||
const activeColor = 0xF800/*red*/;
|
|
||||||
|
|
||||||
function drawWordClock() {
|
function drawWordClock() {
|
||||||
|
|
||||||
|
|
@ -60,9 +59,9 @@
|
||||||
|
|
||||||
var hidx;
|
var hidx;
|
||||||
var midx;
|
var midx;
|
||||||
var midxA=[];
|
var midxA = [];
|
||||||
|
|
||||||
g.setFontVector(wordFontSize);
|
g.setFont("6x8",fontSize);
|
||||||
g.setColor(passivColor);
|
g.setColor(passivColor);
|
||||||
g.setFontAlign(0, -1, 0);
|
g.setFontAlign(0, -1, 0);
|
||||||
|
|
||||||
|
|
@ -79,7 +78,6 @@
|
||||||
y += dy;
|
y += dy;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// calc indexes
|
// calc indexes
|
||||||
midx = Math.round(m / 5);
|
midx = Math.round(m / 5);
|
||||||
hidx = h % 12;
|
hidx = h % 12;
|
||||||
|
|
@ -98,8 +96,6 @@
|
||||||
|
|
||||||
// write hour in active color
|
// write hour in active color
|
||||||
g.setColor(activeColor);
|
g.setColor(activeColor);
|
||||||
g.setFontVector(wordFontSize);
|
|
||||||
|
|
||||||
hours[hidx][0].split('').forEach((c, pos) => {
|
hours[hidx][0].split('').forEach((c, pos) => {
|
||||||
x = xs + (hours[hidx][pos + 1] / 10 | 0) * dx;
|
x = xs + (hours[hidx][pos + 1] / 10 | 0) * dx;
|
||||||
y = ys + (hours[hidx][pos + 1] % 10) * dy;
|
y = ys + (hours[hidx][pos + 1] % 10) * dy;
|
||||||
|
|
@ -118,9 +114,8 @@
|
||||||
|
|
||||||
// display digital time
|
// display digital time
|
||||||
g.setColor(activeColor);
|
g.setColor(activeColor);
|
||||||
g.setFontVector(timeFontSize);
|
g.clearRect(0, 215, 240, 240);
|
||||||
g.clearRect(0,200,240,240);
|
g.drawString(time, 120, 215);
|
||||||
g.drawString(time, 120, 200);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Bangle.on('lcdPower', function(on) {
|
Bangle.on('lcdPower', function(on) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue