From 568cc69303f2507fc66a0aa02aa426c8dd2bef1b Mon Sep 17 00:00:00 2001 From: kagu1990 Date: Fri, 26 Apr 2024 21:42:45 +0530 Subject: [PATCH 1/2] Fixed image, email validation, password hidden and centering form issue --- src/index.html | 6 +++--- src/script.js | 1 + src/styles.css | 1 + 3 files changed, 5 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 @@
- + - + - +
diff --git a/src/script.js b/src/script.js index 4e3be16..1f09330 100644 --- a/src/script.js +++ b/src/script.js @@ -24,6 +24,7 @@ addEventListener("submit", (event) => { console.log(`email submitted: ${email}`); console.log(`password submitted: ${password}`); + /* 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..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 { From 44f2c7fbc723097a6210f67b245b70179e78f6e5 Mon Sep 17 00:00:00 2001 From: kagu1990 Date: Sat, 27 Apr 2024 19:54:15 +0530 Subject: [PATCH 2/2] Fixed success and fail message --- src/script.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/script.js b/src/script.js index 1f09330..0d3ad63 100644 --- a/src/script.js +++ b/src/script.js @@ -25,6 +25,16 @@ addEventListener("submit", (event) => { console.log(`email submitted: ${email}`); console.log(`password submitted: ${password}`); + const userFound = usersTable.filter((currentUserCreds) => { + if(currentUserCreds.username === email && currentUserCreds.password === password){ + renderSuccess(); + return currentUserCreds; + } + }); + + if(userFound.length == 0){ + renderError(); + } /* TODO: 1. Check if the email and password are valid (using the usersTable)