Flashcards is a lightweight HTML5 study tool for Japanese vocabulary. The layout follows a two-column workflow with a card stage on the left and a control panel on the right, keeping navigation and deck selection close to the content.
A live version of the app is available here.
The deck list file defines each deck entry with a stable identifier, a display name, and the JSON path to the cards.
{
"decks": [
{
"id": "animals",
"name": "Animals",
"path": "/data/json/apps/sandbox/flashcards/decks-1.min.json"
},
{
"id": "places",
"name": "Places",
"path": "/data/json/apps/sandbox/flashcards/decks-2.min.json"
}
]
}
Each deck file contains a list of cards with a front label, translation, and optional reading.
{
"id": "animals",
"name": "Animals",
"cards": [
{ "id": "cat", "front": "猫", "back": "cat", "reading": "ねこ" },
{ "id": "dog", "front": "犬", "back": "dog", "reading": "いぬ" }
]
}
Local storage keys are used to keep the current deck and card position between sessions.
flashcardsActiveDeckflashcardsCardIndex_<deckId>The card face flip is handled by toggling a class and updating the visible text fields.
flashcard.addEventListener("click", () => {
revealed = !revealed;
updateCard();
});
flashcard.classList.toggle("is-revealed", revealed);