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