Update kanawatch 0.04 with a random character every minute

pull/2050/head
pancake 2022-07-18 17:39:02 +02:00
parent 3f14b0dc8f
commit f36e2ff8cf
4 changed files with 24 additions and 2 deletions

View File

@ -1,3 +1,4 @@
0.01: First release
0.02: Improve battery life, sprite resolution, fix launcher issue and unaligned text bug
0.03: Reduce code size, refresh once a minute and faster refresh
0.04: Show a random kana every minute to improve learning

View File

@ -3,10 +3,17 @@
A simple watchface design with hiragana and katakana
cards for learning.
## Changelog
0.01: First release
0.02: Improve battery life, sprite resolution, fix launcher issue and unaligned text bug
0.03: Reduce code size, refresh once a minute and faster refresh
0.04: Show a random kana every minute to improve learning
## Author
Written by pancake in 2022, powered by insomnia
## Screenshots
![hiragana and katakana](screenshot.jpg)
![hiragana and katakana](screenshot.png)

View File

@ -127,6 +127,18 @@ function next () {
updateWatch(ohhmm);
}
function randKana() {
try {
const keys = Object.keys(katakana);
const total = keys.length;
let index = 0 | (Math.random() * total);
curkana = keys[index];
kana = hiramode ? hiragana[curkana] : katakana[curkana];
} catch (e) {
randKana();
}
}
function prev () {
let oldk = '';
let count = 0;
@ -233,6 +245,7 @@ function tickWatch () {
}
const hhmm = zpad(now.getHours()) + ':' + zpad(now.getMinutes());
if (hhmm !== ohhmm) {
randKana();
updateWatch(hhmm);
ohhmm = hhmm;
}
@ -257,3 +270,4 @@ setInterval(tickWatch, 1000 * 60);
// show launcher when button pressed
Bangle.setUI('clock');

View File

@ -2,7 +2,7 @@
"id": "kanawatch",
"name": "Kanawatch",
"shortName": "Kanawatch",
"version": "0.03",
"version": "0.04",
"type": "clock",
"description": "Learn Hiragana and Katakana",
"icon": "app.png",