This commit is contained in:
parent
3498815d8f
commit
84d073976b
4 changed files with 16 additions and 13 deletions
10
index.js
10
index.js
|
@ -11,11 +11,11 @@ server.use(cookieParser())
|
|||
server.use(bodyParser.urlencoded({ extended: true }))
|
||||
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 sbdashboard = '<a class=btn href="/dashboard">Dashboard</a>'
|
||||
const logoutBtn = '<a class=btn href="/logout">Log out</a>'
|
||||
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 sbbasic = '<a class=btn href="/"> Home </a><a class=btn href="/dashboard"> Dashboard </a>'
|
||||
const sblogout = '<a class=btn href="/logout"> Log out </a>'
|
||||
const sbend = "</div>"
|
||||
const indexSidebar = sbstart + sbdashboard + sbend
|
||||
const indexSidebar = sbstart + sbbasic + sbend
|
||||
|
||||
async function handle_other(req, res) {
|
||||
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") {
|
||||
let user = await getUser(req.cookies.token)
|
||||
if(user) {
|
||||
res.render("dashboard", {sidebar: sbstart + sbdashboard + logoutBtn + sbend, user})
|
||||
res.render("dashboard", {sidebar: sbstart + sbbasic + sblogout + sbend, user})
|
||||
}
|
||||
else {
|
||||
res.status(401).redirect("/login")
|
||||
|
|
|
@ -8,7 +8,7 @@ body {
|
|||
margin: auto;
|
||||
display: block;
|
||||
width: min(700px, 90vw);
|
||||
margin-top: 5vh;
|
||||
margin-top: min(10em, 30vh);
|
||||
margin-bottom: 20vh;
|
||||
}
|
||||
a {
|
||||
|
@ -17,9 +17,10 @@ a {
|
|||
|
||||
a.btn {
|
||||
background-color: #603060;
|
||||
display: block;
|
||||
width: fit-content;
|
||||
min-width: 10em;
|
||||
display: inline-block;
|
||||
width: 10em;
|
||||
max-width: calc(100vw - 30px);
|
||||
min-width: fit-content;
|
||||
padding: 10px;
|
||||
margin: 0;
|
||||
text-decoration: none;
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%- sidebar %>
|
||||
|
||||
<h1> BaseBand </h1>
|
||||
A strong client modification for Minecraft.
|
||||
<br>
|
||||
|
@ -14,7 +17,5 @@
|
|||
<br>
|
||||
<a class=btn href="/features">Features</a>
|
||||
|
||||
<%- sidebar %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
<link rel="stylesheet" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<%- sidebar %>
|
||||
|
||||
<h1> Login </h1>
|
||||
|
||||
<% if(error) { %>
|
||||
|
@ -21,8 +24,6 @@
|
|||
|
||||
You may reset your password on <a href="https://discord.com/channels/@me/1249758016958496859">Discord</a>.
|
||||
|
||||
<%- sidebar %>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue