From 13d5d2a8773d8800eb1b5be59db921b11b6661a2 Mon Sep 17 00:00:00 2001 From: "Jakob L. Kreuze" Date: Sat, 19 Jul 2025 17:38:10 -0400 Subject: Support for mobile --- flashcards.html | 1 + script.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/flashcards.html b/flashcards.html index 98df131..b936f46 100644 --- a/flashcards.html +++ b/flashcards.html @@ -2,6 +2,7 @@ + Flashcard diff --git a/script.js b/script.js index 1ff9fbb..d7f3890 100644 --- a/script.js +++ b/script.js @@ -337,7 +337,6 @@ function showToast(message, duration = 3000) { } window.addEventListener("load", (event) => { - document.getElementById('cards-input').addEventListener('change', function(event) { const file = event.target.files[0]; if (!file) return; @@ -360,10 +359,12 @@ window.addEventListener("load", (event) => { reader.readAsText(file); // Read the file as text }); + document.getElementById('flashcard').addEventListener('click', function(event) { + flipCard(); + }); }); window.addEventListener('keydown', (event) => { - // console.log(event.code); if (event.code === 'Space') { flipCard(); } else if (event.code === 'Digit1' || event.code === "Numpad1") { -- cgit v1.3