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.01: First release
|
||||||
0.02: Improve battery life, sprite resolution, fix launcher issue and unaligned text bug
|
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.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
|
A simple watchface design with hiragana and katakana
|
||||||
cards for learning.
|
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
|
## Author
|
||||||
|
|
||||||
Written by pancake in 2022, powered by insomnia
|
Written by pancake in 2022, powered by insomnia
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
|
@ -127,6 +127,18 @@ function next () {
|
||||||
updateWatch(ohhmm);
|
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 () {
|
function prev () {
|
||||||
let oldk = '';
|
let oldk = '';
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
@ -233,6 +245,7 @@ function tickWatch () {
|
||||||
}
|
}
|
||||||
const hhmm = zpad(now.getHours()) + ':' + zpad(now.getMinutes());
|
const hhmm = zpad(now.getHours()) + ':' + zpad(now.getMinutes());
|
||||||
if (hhmm !== ohhmm) {
|
if (hhmm !== ohhmm) {
|
||||||
|
randKana();
|
||||||
updateWatch(hhmm);
|
updateWatch(hhmm);
|
||||||
ohhmm = hhmm;
|
ohhmm = hhmm;
|
||||||
}
|
}
|
||||||
|
@ -257,3 +270,4 @@ setInterval(tickWatch, 1000 * 60);
|
||||||
|
|
||||||
// show launcher when button pressed
|
// show launcher when button pressed
|
||||||
Bangle.setUI('clock');
|
Bangle.setUI('clock');
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "kanawatch",
|
"id": "kanawatch",
|
||||||
"name": "Kanawatch",
|
"name": "Kanawatch",
|
||||||
"shortName": "Kanawatch",
|
"shortName": "Kanawatch",
|
||||||
"version": "0.03",
|
"version": "0.04",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"description": "Learn Hiragana and Katakana",
|
"description": "Learn Hiragana and Katakana",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
Loading…
Reference in New Issue