From e5b1d28ab737281a5f5e49016d22729bbf428a51 Mon Sep 17 00:00:00 2001 From: neshanth <59483685+neshanth@users.noreply.github.com> Date: Sat, 27 Jan 2024 19:04:54 +0530 Subject: [PATCH] fixed all issues --- src/index.html | 6 +++--- src/script.js | 13 +++++++++++++ src/styles.css | 5 +++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/index.html b/src/index.html index e7c4417..d5031a0 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..6525fe3 100644 --- a/src/script.js +++ b/src/script.js @@ -24,6 +24,19 @@ addEventListener("submit", (event) => { console.log(`email submitted: ${email}`); console.log(`password submitted: ${password}`); + + const validUser = usersTable.some((user) => { + if (user.username === email && user.password === password) { + return true; + } + }) + + if (validUser) { + renderSuccess(); + } else { + renderError(); + } + /* TODO: 1. Check if the email and password are valid (using the usersTable) diff --git a/src/styles.css b/src/styles.css index 25969e5..d8c6bf3 100644 --- a/src/styles.css +++ b/src/styles.css @@ -11,9 +11,10 @@ form { border: 1px solid black; padding: 2rem; border-radius: 2rem; + margin: 0 auto } -form > img { +form>img { margin: auto; } @@ -37,4 +38,4 @@ button { #error-message { color: red; -} +} \ No newline at end of file