From 8adfb4af267e420ce80d0d5d037accf12fff9ec1 Mon Sep 17 00:00:00 2001 From: Saida H Date: Wed, 22 May 2024 12:14:29 +0000 Subject: [PATCH] All bugs fixed --- src/index.html | 6 +++--- src/script.js | 11 ++++++++++- src/styles.css | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/index.html b/src/index.html index e7c4417..ca6b9f7 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..d2dd928 100644 --- a/src/script.js +++ b/src/script.js @@ -30,4 +30,13 @@ addEventListener("submit", (event) => { 2. If they are, call renderSuccess() 3. If they are not, call renderError() */ -}); + for (let user of usersTable) { + if (email === user.username && password === user.password) { + console.log('Valid credentials. email:', email, 'password:', password); + renderSuccess(); + } else if(email !== user.username && password !== user.password){ + console.log('Invalid credentials. email:', email, 'password:', password); + 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 {