Skip to content

Commit 96e9aa5

Browse files
committed
1commit
1 parent f3f41d0 commit 96e9aa5

3 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
</head>
99
<body>
1010
<form>
11-
<!-- TODO: Fix Logo Rendering Issue-->
12-
<img src="/logo.png" />
11+
<!-- Done TODO: Fix Logo Rendering Issue-->
12+
<img src="logo.svg" />
1313
<span id="success-message" hidden="true">Success!</span>
1414
<span id="error-message" hidden="true">Invalid Credentials</span>
1515
<label for="email">Email</label>
16-
<!-- TODO: Add HTML Email Validation to Email Input -->
17-
<input id="email" type="text" placeholder="Enter your email" />
16+
<!-- Done TODO: Add HTML Email Validation to Email Input -->
17+
<input id="email" type="email" placeholder="Enter your email" />
1818
<label for="password">Password</label>
19-
<!-- TODO: Update HTML Password Input to Hide Password Visibility -->
20-
<input id="password" type="text" placeholder="Enter your password" />
19+
<!-- Done TODO: Update HTML Password Input to Hide Password Visibility -->
20+
<input id="password" type="password" placeholder="Enter your password" />
2121
<button>Submit</button>
2222
</form>
2323
</body>

src/script.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ addEventListener("submit", (event) => {
2525
console.log(`email submitted: ${email}`);
2626
console.log(`password submitted: ${password}`);
2727
/*
28-
TODO:
28+
Done TODO:
2929
1. Check if the email and password are valid (using the usersTable)
3030
2. If they are, call renderSuccess()
3131
3. If they are not, call renderError()
3232
*/
33+
34+
if (usersTable.some((user) => user.username === email && user.password === password)) {
35+
renderSuccess();
36+
}
37+
else {
38+
renderError();
39+
}
3340
});

src/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
body {
22
height: 100vh;
33
display: flex;
4+
justify-content: center;
45
/* TODO: Adjust CSS so that form is centered on page */
56
align-items: center;
67
}

0 commit comments

Comments
 (0)