mirror of https://github.com/espruino/BangleApps
Update kanawatch 0.04 with a random character every minute
parent
3f14b0dc8f
commit
f36e2ff8cf
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||

|
||||

|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue