From 811d4948b741c57687ede8538af7d32d3c7a05eb Mon Sep 17 00:00:00 2001 From: bernadette Date: Thu, 21 Mar 2024 14:24:39 +0100 Subject: [PATCH] added key enter function --- assets/css/stylesheet.css | 25 ++++++++++++++++--------- assets/js/script.js | 10 ++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/assets/css/stylesheet.css b/assets/css/stylesheet.css index 87c755a..802c15e 100644 --- a/assets/css/stylesheet.css +++ b/assets/css/stylesheet.css @@ -11,7 +11,7 @@ body { } .header-img { - height: 5.5rem; + height: 5.7rem; } .columns { @@ -38,13 +38,13 @@ body { font-family: LibreBaskerville; font-style: italic; line-height: 130%; - font-size: 20px; + font-size: 22px; } .command-bar { height: 40px; width: 70%; - font-size: 16px; + font-size: 20px; padding-left: 20px; border-radius: 30px; border: 1.7px solid black; @@ -92,6 +92,8 @@ body { #output { width: 80%; margin-top: 30px; + font-size: 20px; + line-height: 150%; } .quotationmark-up-container { @@ -126,8 +128,8 @@ body { width: 30%; align-items: center; text-align: center; + margin-top: 50px; margin-left: 30px; - margin-top: 40px; height: 50vh; } @@ -152,7 +154,7 @@ body { .flip-card-front { display: flex; flex-direction: column; - background-color: #d4d1d0; + background-color: #e6e6e6; color: black; border-radius: 30px; align-items: center; @@ -163,12 +165,13 @@ body { padding-left: 10px; padding-right: 10px; padding-top: 15px; - width: 90%; + width: 95%; } h1 { position: absolute; - top: 40%; + font-size: 3rem; + top: 42%; } .tendril-top { @@ -198,12 +201,16 @@ h1 { .flip-card-back { display: flex; align-items: center; - background-color: #d4d1d0; + background-color: #e6e6e6; color: black; border-radius: 30px; transform: rotateY(180deg); } .info_layer { - padding: 25px; + display: flex; + flex-direction: column; + padding: 30px; + line-height: 150%; + font-size: 20px; } \ No newline at end of file diff --git a/assets/js/script.js b/assets/js/script.js index 41a2ca3..f72f75e 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -122,6 +122,16 @@ function handleInput() { console.log("info_layer: " + response.info_layer); // Log info_layer content } +// Function to handle keypress event +function handleKeyPress(event) { + if (event.keyCode === 13) { // Check if Enter key is pressed + handleInput(); // Call handleInput function + } +} + +// Event listener for keypress event on the input field +document.getElementById("user_input").addEventListener("keypress", handleKeyPress); + function printing(input){ fetch("https://hub.xpub.nl/chopchop/cgi-bin/table.cgi?input=" + input);