mirror of https://github.com/espruino/BangleApps
patch - text alignment + twist acceleration
parent
6da9121f24
commit
704ef33761
|
@ -5066,7 +5066,7 @@
|
||||||
{
|
{
|
||||||
"id": "sonicclk",
|
"id": "sonicclk",
|
||||||
"name": "Sonic Clock",
|
"name": "Sonic Clock",
|
||||||
"version": "1.00",
|
"version": "1.01",
|
||||||
"description": "A classic sonic clock featuring run, stop and wait animations.",
|
"description": "A classic sonic clock featuring run, stop and wait animations.",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"screenshots": [{"url":"screenshot.png"}],
|
"screenshots": [{"url":"screenshot.png"}],
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
1.00 Added sonic clock app
|
1.00 Added sonic clock app
|
||||||
|
1.01 Fixed text alignment issue; Increased acceleration required to activate twist;
|
|
@ -106,11 +106,12 @@ const timeout = 200;
|
||||||
let currentSpeed = 0;
|
let currentSpeed = 0;
|
||||||
let currentSonic = -1;
|
let currentSonic = -1;
|
||||||
|
|
||||||
let drawTimeout, drawInterval;
|
let drawTimeout, drawInterval, waitTimeout;
|
||||||
let bgScroll = [0, null];
|
let bgScroll = [0, null];
|
||||||
|
|
||||||
const start = () => {
|
const start = () => {
|
||||||
if (drawTimeout) clearTimeout(drawTimeout);
|
if (drawTimeout) clearTimeout(drawTimeout);
|
||||||
|
if (waitTimeout) clearTimeout(waitTimeout);
|
||||||
if (drawInterval) clearInterval(drawInterval);
|
if (drawInterval) clearInterval(drawInterval);
|
||||||
|
|
||||||
drawInterval = setInterval(() => {
|
drawInterval = setInterval(() => {
|
||||||
|
@ -147,7 +148,7 @@ const wait = () => {
|
||||||
|
|
||||||
drawInterval = setInterval(() => draw("wait"), timeout);
|
drawInterval = setInterval(() => draw("wait"), timeout);
|
||||||
|
|
||||||
setTimeout(() => {
|
waitTimeout = setTimeout(() => {
|
||||||
clearInterval(drawInterval);
|
clearInterval(drawInterval);
|
||||||
currentSonic = -1;
|
currentSonic = -1;
|
||||||
draw("reset");
|
draw("reset");
|
||||||
|
@ -215,7 +216,7 @@ const drawTime = () => {
|
||||||
const y = 24 + 25;
|
const y = 24 + 25;
|
||||||
|
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
const timeStr = require("locale").time(date, 1);
|
const timeStr = require("locale").time(date, 1).trim();
|
||||||
const dateStr = require("locale").date(date).toUpperCase();
|
const dateStr = require("locale").date(date).toUpperCase();
|
||||||
|
|
||||||
g.setColor("#000");
|
g.setColor("#000");
|
||||||
|
@ -266,6 +267,7 @@ Bangle.on("twist", () => wait());
|
||||||
Bangle.setOptions({
|
Bangle.setOptions({
|
||||||
lockTimeout: 10000,
|
lockTimeout: 10000,
|
||||||
backlightTimeout: 12000,
|
backlightTimeout: 12000,
|
||||||
|
twistThreshold: 1600,
|
||||||
});
|
});
|
||||||
|
|
||||||
Bangle.setUI("clock");
|
Bangle.setUI("clock");
|
||||||
|
|
Loading…
Reference in New Issue