summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob L. Kreuze <zerodaysfordays@sdf.org>2025-07-19 17:38:10 -0400
committerJakob L. Kreuze <zerodaysfordays@sdf.org>2025-07-19 17:38:10 -0400
commit13d5d2a8773d8800eb1b5be59db921b11b6661a2 (patch)
tree6c75c0b69e952bf1d8d6b6776a4b17f69ec61143
parente47dd1eae351aed5a434645ad90d7c4a57f26c85 (diff)
Support for mobile
-rw-r--r--flashcards.html1
-rw-r--r--script.js5
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 @@
<html lang="en">
<head>
<meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flashcard</title>
<link rel="stylesheet" href="style.css">
</head>
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") {