From 5520bce8558bf10b059828a75270ce07363d1d31 Mon Sep 17 00:00:00 2001 From: Reimar Date: Fri, 19 Jan 2024 21:56:47 +0100 Subject: [PATCH 1/2] Change design --- index.js | 4 ++-- public/header.js | 14 ++++++++---- public/index.html | 5 ----- public/login/index.html | 2 +- public/register/index.html | 2 +- public/style.css | 45 ++++++++++++++++++++++++++++++++++++-- 6 files changed, 57 insertions(+), 15 deletions(-) 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

-
- - - -

The chairman The chairman 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; +} + From 4293cb7b6d832c6ec027f27267f48f043da640b5 Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Fri, 19 Jan 2024 22:58:35 +0100 Subject: [PATCH 2/2] dark theme support --- public/style.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/style.css b/public/style.css index 221d5e6..a0a3bd3 100644 --- a/public/style.css +++ b/public/style.css @@ -13,7 +13,14 @@ body { text-align: center; font-family: system-ui, sans-serif; background-color: #dff3f1; - color: black; + color: #211; +} + +@media (prefers-color-scheme: dark) { + body { + background: #211; + color: #dff3f1; + } } .mao-error {