diff --git a/client/comment.js b/client/comment.js index ba53870..db44cc9 100644 --- a/client/comment.js +++ b/client/comment.js @@ -7,7 +7,6 @@ let db = await initDb(); let main = new Route([auth], async function (req, res, input) { let {route} = req.params; let {id} = req.query; - let { username } = input; let comments = await db.all('SELECT * FROM comment WHERE targetType = ? AND targetId = ? ORDER BY date DESC', [ route, diff --git a/client/e404.js b/client/e404.js index 9f76fa6..f650a01 100644 --- a/client/e404.js +++ b/client/e404.js @@ -2,9 +2,8 @@ import Route from "../route.js"; import auth from "../form/auth.js"; let main = new Route([auth], async function (req, res, input) { - let { username } = input; return res.render('404', { - username + ...input }); }); diff --git a/client/login.js b/client/login.js index 4a4a099..b9cc184 100644 --- a/client/login.js +++ b/client/login.js @@ -3,7 +3,6 @@ import auth from "../form/auth.js"; // TODO: rewrite let main = new Route([auth], async function (req, res, input) { - let { username } = input; return res.render('form', { data: [ { label: "Username", type: "text", name: "user" }, @@ -11,7 +10,7 @@ let main = new Route([auth], async function (req, res, input) { ], 'route': '/api/form/login?redirect=' + req.query.redirect, 'title': 'Login', - username + ...input }); }); diff --git a/client/main.js b/client/main.js index c15c5f4..772bb79 100644 --- a/client/main.js +++ b/client/main.js @@ -12,7 +12,7 @@ let main = new Route([auth], async function (req, res, input) { username ]); return res.render('main', { - username, + ...input, videos, videosFollow }); diff --git a/client/player.js b/client/player.js index db86e0f..ab198cf 100644 --- a/client/player.js +++ b/client/player.js @@ -12,7 +12,8 @@ let main = new Route([comment], async function (req, res, input) { videoData = videoData[0]; return res.render('player', { ...input, - videoData + videoData, + ogType: 'video' }); }); diff --git a/client/settings.js b/client/settings.js index 5a99989..bc27265 100644 --- a/client/settings.js +++ b/client/settings.js @@ -3,7 +3,6 @@ import auth from "../form/auth.js"; // TODO: rewrite let main = new Route([auth], async function (req, res, input) { - let { username } = input; return res.render('form', { data: [ { label: "Description", type: "textarea", name: "desc" }, @@ -11,7 +10,7 @@ let main = new Route([auth], async function (req, res, input) { ], 'route': '/api/upload/settings', 'title': 'User Settings', - username + ...input }); /* todo: form in not a file */ }); diff --git a/client/tou.js b/client/tou.js index 9c3453e..06e6a37 100644 --- a/client/tou.js +++ b/client/tou.js @@ -2,9 +2,8 @@ import Route from "../route.js"; import auth from "../form/auth.js"; let main = new Route([auth], async function (req, res, input) { - let { username } = input; return res.render('guidelines', { - username + ...input }); }); diff --git a/client/upload.js b/client/upload.js index f21f555..000276f 100644 --- a/client/upload.js +++ b/client/upload.js @@ -3,7 +3,6 @@ import auth from "../form/auth.js"; // TODO: rewrite let main = new Route([auth], async function (req, res, input) { - let { username } = input; return res.render('form', { data: [ { label: "Video file", type: "file", name: "file" }, @@ -12,7 +11,7 @@ let main = new Route([auth], async function (req, res, input) { ], 'route': '/api/upload/upload', 'title': 'Upload Content', - username + ...input }); }); diff --git a/client/user.js b/client/user.js index cceca23..12584e7 100644 --- a/client/user.js +++ b/client/user.js @@ -28,7 +28,8 @@ let main = new Route([comment], async function (req, res, input) { videos, followers, following, - user + user, + icon: `${process.env.URL}/pfp/${id}.png` }); }); diff --git a/form/auth.js b/form/auth.js index 62410a1..ffe8752 100644 --- a/form/auth.js +++ b/form/auth.js @@ -4,6 +4,9 @@ import initDb from "../db.js"; let db = await initDb(); let main = new Route([], async function (req, res, input) { + let {route} = req.params; + let {id} = req.query; + let body = { ...req.cookies, ...req.body }; let { token } = body; @@ -20,7 +23,11 @@ let main = new Route([], async function (req, res, input) { return { username, - valid: valid[0] ? valid[0].valid : 'noexist' + valid: valid[0] ? valid[0].valid : 'noexist', + url: `${process.env.URL}/client/${route}?id=${id || ''}`, + icon: `${process.env.URL}/static/img/logo.png`, + rootUrl: process.env.URL, + ogType: 'website' }; }); diff --git a/static/img/logo.png b/static/img/logo.png new file mode 100644 index 0000000..8fe969c Binary files /dev/null and b/static/img/logo.png differ diff --git a/static/img/logo.svg b/static/img/logo.svg index b10aea4..8edf55b 100644 --- a/static/img/logo.svg +++ b/static/img/logo.svg @@ -9,6 +9,9 @@ id="svg1" inkscape:version="1.4 (e7c3feb100, 2024-10-09)" sodipodi:docname="logo.svg" + inkscape:export-filename="logo.png" + inkscape:export-xdpi="452.63" + inkscape:export-ydpi="452.63" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -24,7 +27,7 @@ inkscape:deskcolor="#d1d1d1" inkscape:document-units="mm" inkscape:zoom="1" - inkscape:cx="112.5" + inkscape:cx="112" inkscape:cy="86.5" inkscape:window-width="1918" inkscape:window-height="1056" diff --git a/views/header.ejs b/views/header.ejs index 9ca8160..ecbcbed 100644 --- a/views/header.ejs +++ b/views/header.ejs @@ -2,12 +2,16 @@
-