From ff4ff0e4b27baf1a7e6a832bce4ad55b95f98e95 Mon Sep 17 00:00:00 2001 From: Anne Chaiyato Date: Wed, 29 Nov 2023 20:38:47 -0800 Subject: [PATCH] fixed logo rendering issue, added email and password input validation, centered form, and validated user credential. --- src/index.html | 8 ++++---- src/script.js | 13 +++++++++++++ src/styles.css | 1 + 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/index.html b/src/index.html index e7c4417..8383839 100644 --- a/src/index.html +++ b/src/index.html @@ -9,15 +9,15 @@
- + - + - + - +
diff --git a/src/script.js b/src/script.js index 4e3be16..f86e2d8 100644 --- a/src/script.js +++ b/src/script.js @@ -30,4 +30,17 @@ addEventListener("submit", (event) => { 2. If they are, call renderSuccess() 3. If they are not, call renderError() */ + var userFound = false; + usersTable.forEach((user) => { + if(user.username === email && user.password == password) { + userFound = true; + } + }); + + if(userFound){ + renderSuccess(); + } else { + renderError(); + } + }); diff --git a/src/styles.css b/src/styles.css index 25969e5..6d006f0 100644 --- a/src/styles.css +++ b/src/styles.css @@ -3,6 +3,7 @@ body { display: flex; /* TODO: Adjust CSS so that form is centered on page */ align-items: center; + justify-content: center; } form {