From 685b98dad4c2d61481a40af49e258b551bd36524 Mon Sep 17 00:00:00 2001 From: Millner Philipp Date: Fri, 12 Jan 2024 12:09:59 +0100 Subject: [PATCH 1/3] fixed index.html --- src/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.html b/src/index.html index e7c4417..672e976 100644 --- a/src/index.html +++ b/src/index.html @@ -9,15 +9,15 @@
- + - + - +
From 711dca8339750f29f8546c617108829b8ec4a96f Mon Sep 17 00:00:00 2001 From: Millner Philipp Date: Fri, 12 Jan 2024 12:15:26 +0100 Subject: [PATCH 2/3] fixed script.js --- src/script.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/script.js b/src/script.js index 4e3be16..2403e94 100644 --- a/src/script.js +++ b/src/script.js @@ -19,15 +19,29 @@ addEventListener("submit", (event) => { event.preventDefault(); resetMessage(); - let email = document.getElementById("email").value; - let password = document.getElementById("password").value; + let emailInput = document.getElementById("email").value; + let passwordInput = document.getElementById("password").value; - console.log(`email submitted: ${email}`); - console.log(`password submitted: ${password}`); + console.log(`email submitted: ${emailInput}`); + console.log(`password submitted: ${passwordInput}`); /* TODO: 1. Check if the email and password are valid (using the usersTable) 2. If they are, call renderSuccess() 3. If they are not, call renderError() */ + + for(const {username, password} of usersTable) + { + if(emailInput === username && passwordInput === password) + { + renderSuccess() + break + } + else + { + renderError() + break + } + } }); From be475c81c44d7a9f1667d8e6d9ad6ab84df38974 Mon Sep 17 00:00:00 2001 From: Millner Philipp Date: Fri, 12 Jan 2024 12:17:06 +0100 Subject: [PATCH 3/3] fixed styles.css --- src/styles.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/styles.css b/src/styles.css index 25969e5..22a4fac 100644 --- a/src/styles.css +++ b/src/styles.css @@ -2,6 +2,7 @@ body { height: 100vh; display: flex; /* TODO: Adjust CSS so that form is centered on page */ + justify-content: center; align-items: center; }