diff --git a/index.js b/index.js
index c9327a7..04652c2 100644
--- a/index.js
+++ b/index.js
@@ -45,7 +45,7 @@ app.post("/api/register", async (req, res) => {
}
const passwordHash = await bcrypt.hash(password, 10);
const id = users.length;
- const user = { id, username, password: passwordHash };
+ const user = { id, username, passwordHash };
users.push(user);
return res.status(200).json({ ok: true, user });
});
@@ -59,7 +59,7 @@ app.post("/api/login", async (req, res) => {
if (user === undefined) {
return res.status(400).json({ ok: false, error: "wrong username/password" });
}
- if (!await bcrypt.compare(password, user.password)) {
+ if (!await bcrypt.compare(password, user.passwordHash)) {
return res.status(400).json({ ok: false, error: "wrong username/password" });
}
sessions = sessions.filter(session => session.userId !== user.id);
diff --git a/public/header.js b/public/header.js
index 90f7a86..dcbcfe7 100644
--- a/public/header.js
+++ b/public/header.js
@@ -26,10 +26,16 @@ function displayHeader() {
document.querySelector("h1").outerHTML = `
- MaoTube
-
+
+ MaoTube
+
+
+
`
}
diff --git a/public/index.html b/public/index.html
index 02aed75..6663d75 100644
--- a/public/index.html
+++ b/public/index.html
@@ -7,11 +7,6 @@
MaoTube
-
diff --git a/public/login/index.html b/public/login/index.html
index 934d7a0..2963991 100644
--- a/public/login/index.html
+++ b/public/login/index.html
@@ -11,7 +11,7 @@
-
+
diff --git a/public/register/index.html b/public/register/index.html
index 8b69018..de6461c 100644
--- a/public/register/index.html
+++ b/public/register/index.html
@@ -11,7 +11,7 @@
-
+
diff --git a/public/style.css b/public/style.css
index e43ef4e..221d5e6 100644
--- a/public/style.css
+++ b/public/style.css
@@ -9,9 +9,11 @@
body {
margin: 0 auto;
- padding: 2rem;
+ padding: 0;
text-align: center;
font-family: system-ui, sans-serif;
+ background-color: #dff3f1;
+ color: black;
}
.mao-error {
@@ -33,7 +35,7 @@ body {
text-transform: uppercase;
font-weight: bold;
font-family: "Impact", "Bebas", "League Gothic", "Oswald", "Coluna", "Ubuntu Condensed", system-ui, sans-serif;
- text-shadow:
+ text-shadow:
3px 3px 0 black,
-3px -3px 0 black,
3px -3px 0 black,
@@ -58,3 +60,42 @@ ul#video-list {
#video-player {
max-height: 80vh;
}
+
+header {
+ display: flex;
+ align-items: center;
+ gap: 30px;
+ background-image: linear-gradient(to bottom, #c51e0e, #FF5722);
+ padding: 20px;
+ box-shadow: 0 15px 15px rgba(0, 0, 0, 0.2);
+ color: #fcf4c8;
+}
+
+#app-name {
+ padding-right: 20px;
+ margin: 0;
+}
+
+a {
+ color: #fcf4c8;
+ text-decoration: none;
+}
+
+#search {
+ border: none;
+ outline: none;
+ padding: 10px;
+ background-color: rgba(0, 0, 0, 0.2);
+ transition-duration: 100ms;
+ color: white;
+}
+
+#search:hover {
+ background-color: rgba(0, 0, 0, 0.3);
+}
+
+#search:focus {
+ background-color: white;
+ color: black;
+}
+