user page, meta fixes, css updates

This commit is contained in:
biglyderv 2024-11-25 14:12:43 -05:00
parent 016f8b91b1
commit 2f0b0fb39f
6 changed files with 47 additions and 6 deletions

View file

@ -7,7 +7,6 @@ let db = await initDb();
let main = new Route([auth], async function (req, res, input) {
let { username } = input;
let videos = await db.all('SELECT * FROM video ORDER BY date DESC', [
req.query.id
]);
return res.render('main', {
username,

20
client/user.js Normal file
View file

@ -0,0 +1,20 @@
import Route from "../route.js";
import auth from "../form/auth.js";
import initDb from "../db.js";
let db = await initDb();
let main = new Route([auth], async function (req, res, input) {
let { id } = req.query;
let { username } = input;
let videos = await db.all('SELECT * FROM video WHERE username = ? ORDER BY date DESC', [
req.query.id
]);
return res.render('user', {
username,
id,
videos
});
});
export default main;

View file

@ -1,12 +1,14 @@
import main from "./client/main.js";
import auth from "./form/auth.js";
import login from "./client/login.js";
import register from "./client/register.js";
import upload from "./client/upload.js";
import player from "./client/player.js";
import user from "./client/user.js";
import loginB from "./form/login.js";
import registerB from "./form/register.js";
import uploadB from "./form/upload.js";
import auth from "./form/auth.js";
const routes = {
get: {},
@ -19,7 +21,8 @@ routes.client = {
login,
register,
upload,
video: player
video: player,
user
}
routes.get = {
};

View file

@ -14,12 +14,11 @@ body {
:root {
--dark-1: #2f2b36;
--dark-2: #d8d8d8;
--dark-3: rgb(209, 73, 236);
--light-1: #ffffff;
--light-2: #ffa9d8;
--hyperlink: rgb(255, 72, 240);
--hyperlink: rgb(109, 119, 255);
--shadow-1: 0px 0px 2px 2px var(--dark-2);
@ -37,7 +36,8 @@ textarea,
.area,
form,
.video,
.controls {
.controls,
.user {
border: solid var(--dark-2) 3px;
border-radius: 5px;
@ -91,6 +91,7 @@ form {
background-color: var(--hyperlink);
font-weight: bold;
width: 150px;
display: inline-block;
}
.header {

View file

@ -15,6 +15,7 @@
<%if (username=='!nobody' ) { %>
<div class="button"><a href="/client/register">Join</a></div>
<% } %>
<div class="button"><a href="https://discord.gg/7JJBYySY">Chat</a></div>
</div>
<div class='area'>
<h1>Recent Videos</h1>

17
views/user.ejs Normal file
View file

@ -0,0 +1,17 @@
<%- include('header.ejs') -%>
<div class='area'>
<h1>User</h1>
<div class='user'>
<p>
<b>@<%= id %></b>
</p>
</div>
</div>
<div class='area'>
<h1>Uploaded Videos</h1>
<div class=' videos'>
<%- include('videos.ejs') -%>
</div>
</div>
<%- include('footer.ejs') -%>