improve style
All checks were successful
/ Push website to server (push) Successful in 8s

This commit is contained in:
Daniella / Tove 2024-06-25 01:24:57 +02:00
parent 3498815d8f
commit 84d073976b
Signed by: TudbuT
GPG key ID: B3CF345217F202D3
4 changed files with 16 additions and 13 deletions

View file

@ -11,11 +11,11 @@ server.use(cookieParser())
server.use(bodyParser.urlencoded({ extended: true })) server.use(bodyParser.urlencoded({ extended: true }))
server.use(handle) server.use(handle)
const sbstart = '<div style="position: absolute; bottom: 0; left: 0; padding: 5px; width: calc(100vw - 10px); display: block; background-color: #402060">' const sbstart = '<div style="position: fixed; top: 0; left: 0; padding: 5px; width: calc(100vw - 10px); display: block; background-color: #402060; text-align: center;">'
const sbdashboard = '<a class=btn href="/dashboard">Dashboard</a>' const sbbasic = '<a class=btn href="/"> Home </a><a class=btn href="/dashboard"> Dashboard </a>'
const logoutBtn = '<a class=btn href="/logout">Log out</a>' const sblogout = '<a class=btn href="/logout"> Log&nbsp;out </a>'
const sbend = "</div>" const sbend = "</div>"
const indexSidebar = sbstart + sbdashboard + sbend const indexSidebar = sbstart + sbbasic + sbend
async function handle_other(req, res) { async function handle_other(req, res) {
if(req.method === "POST" && req.path === "/login" && req.body.username && req.body.password) { if(req.method === "POST" && req.path === "/login" && req.body.username && req.body.password) {
@ -43,7 +43,7 @@ async function handle(req, res) {
if(req.path == "/dashboard") { if(req.path == "/dashboard") {
let user = await getUser(req.cookies.token) let user = await getUser(req.cookies.token)
if(user) { if(user) {
res.render("dashboard", {sidebar: sbstart + sbdashboard + logoutBtn + sbend, user}) res.render("dashboard", {sidebar: sbstart + sbbasic + sblogout + sbend, user})
} }
else { else {
res.status(401).redirect("/login") res.status(401).redirect("/login")

View file

@ -8,7 +8,7 @@ body {
margin: auto; margin: auto;
display: block; display: block;
width: min(700px, 90vw); width: min(700px, 90vw);
margin-top: 5vh; margin-top: min(10em, 30vh);
margin-bottom: 20vh; margin-bottom: 20vh;
} }
a { a {
@ -17,9 +17,10 @@ a {
a.btn { a.btn {
background-color: #603060; background-color: #603060;
display: block; display: inline-block;
width: fit-content; width: 10em;
min-width: 10em; max-width: calc(100vw - 30px);
min-width: fit-content;
padding: 10px; padding: 10px;
margin: 0; margin: 0;
text-decoration: none; text-decoration: none;

View file

@ -5,6 +5,9 @@
<link rel="stylesheet" href="/style.css"> <link rel="stylesheet" href="/style.css">
</head> </head>
<body> <body>
<%- sidebar %>
<h1> BaseBand </h1> <h1> BaseBand </h1>
A strong client modification for Minecraft. A strong client modification for Minecraft.
<br> <br>
@ -14,7 +17,5 @@
<br> <br>
<a class=btn href="/features">Features</a> <a class=btn href="/features">Features</a>
<%- sidebar %>
</body> </body>
</html> </html>

View file

@ -5,6 +5,9 @@
<link rel="stylesheet" href="/style.css"> <link rel="stylesheet" href="/style.css">
</head> </head>
<body> <body>
<%- sidebar %>
<h1> Login </h1> <h1> Login </h1>
<% if(error) { %> <% if(error) { %>
@ -21,8 +24,6 @@
You may reset your password on <a href="https://discord.com/channels/@me/1249758016958496859">Discord</a>. You may reset your password on <a href="https://discord.com/channels/@me/1249758016958496859">Discord</a>.
<%- sidebar %>
</body> </body>
</html> </html>