diff --git a/form/login.js b/form/login.js index 3b9a061..0ccd0b3 100644 --- a/form/login.js +++ b/form/login.js @@ -18,9 +18,9 @@ let main = new Route([], async function (req, res, input) { if (isExist.length < 1) return { 'success': false, 'message': 'Account does not exist' }; - let passHash = await compare(pass,isExist[0].password); + let passHash = await compare(pass, isExist[0].password); - if (!passHash) + if (!passHash) return { 'success': false, 'message': 'Incorrect password' }; let token = randomBytes(32).toString('hex'); @@ -30,9 +30,9 @@ let main = new Route([], async function (req, res, input) { token ]) - res.cookie('token',token); + res.cookie('token', token); - return {'success': true, 'message': 'Log in succeeded', 'redirect': (req.query.redirect + '?token=' + token) || '/', 'data': token}; + return { 'success': true, 'message': 'Log in succeeded', 'redirect': (req.query.redirect == 'undefined' ? '/' : req.query.redirect) + '?token=' + token, 'data': token }; }); export default main; \ No newline at end of file diff --git a/index.js b/index.js index 3cafab1..45b82c0 100644 --- a/index.js +++ b/index.js @@ -37,6 +37,10 @@ app.post('/api/upload/:route', upload.single('file'), async (req, res) => { res.send(await iterate(req, res, 'form')); }) +app.get('/pfp/*', (req,res) => { + res.redirect(301,'/static/img/logo.svg') +}) + app.listen(port, () => { console.log(`App listening on port ${port}`) }) \ No newline at end of file diff --git a/static/img/bg.svg b/static/img/bg.svg new file mode 100644 index 0000000..730db08 --- /dev/null +++ b/static/img/bg.svg @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/img/logo.svg b/static/img/logo.svg index 6262a19..b10aea4 100644 --- a/static/img/logo.svg +++ b/static/img/logo.svg @@ -7,7 +7,7 @@ viewBox="0 0 217.18312 217.18313" version="1.1" id="svg1" - inkscape:version="1.3.2 (091e20ef0f, 2023-11-25, custom)" + inkscape:version="1.4 (e7c3feb100, 2024-10-09)" sodipodi:docname="logo.svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" @@ -24,12 +24,12 @@ inkscape:deskcolor="#d1d1d1" inkscape:document-units="mm" inkscape:zoom="1" - inkscape:cx="113" - inkscape:cy="86.999998" - inkscape:window-width="1860" - inkscape:window-height="1004" - inkscape:window-x="30" - inkscape:window-y="46" + inkscape:cx="112.5" + inkscape:cy="86.5" + inkscape:window-width="1918" + inkscape:window-height="1056" + inkscape:window-x="0" + inkscape:window-y="22" inkscape:window-maximized="1" inkscape:current-layer="layer1" showgrid="false" /> @@ -41,7 +41,7 @@ id="layer1" transform="translate(47.661312,-32.274754)"> div { - background-color: var(--light-2); + background-color: var(--primary-dark); width: 40%; height: 20px; border-radius: 10px; @@ -197,29 +219,48 @@ form { } .video-wrapper.full { - background: rgba(0,0,0,0.5); + background: rgba(0, 0, 0, 0.5); width: 100vw; height: 100vh; position: absolute; top: 0; left: 0; } - -img.dark { - filter: invert(1); +.video img { + width: 180px; + height: 130px; } -pre { - white-space: pre-wrap; - overflow-x: auto; +.full video { + width: 100vw; + height: 80vh; + max-width: none; + max-height: none; + border: none; } -.pfp-wrapper { - display: flex; +.full .progressbar { + width: 95vw; + max-width: 95vw; + margin: auto; } -.avatar { - width: 50px; - height: 50px; - margin-right: 15px; +.controls { + + border: solid var(--gray) 3px; + border-radius: 5px; + background: var(--dark); + + font-size: 1rem; + padding: 0.5rem; + margin-bottom: 0.5rem; +} + +video { + border: solid var(--dark-2) 3px; + border-radius: 5px; + width: var(--elem-width); + height: auto; + max-height: 50vh; + max-width: 90vmin; } \ No newline at end of file diff --git a/views/comments.ejs b/views/comments.ejs index 3762ee7..5eaf1a5 100644 --- a/views/comments.ejs +++ b/views/comments.ejs @@ -1,18 +1,19 @@ -
-

Comments

+ +

Comments

- - + +
+ <% for (let comment of comments) { %>
-
- +
+
diff --git a/views/form.ejs b/views/form.ejs index fe0f734..b33ca4e 100644 --- a/views/form.ejs +++ b/views/form.ejs @@ -1,20 +1,19 @@ <%- include('header.ejs') -%> - +

<%= title %>

<% for (let elem of data) { %> - - <%= elem.label %> - - <% if (elem.type=='textarea' ) { %> - - <% } else { %> - + + <%= elem.label %> - <% } %> - <% } %> - + <% if (elem.type=='textarea' ) { %> + + <% } else { %> + + <% } %> + <% } %> + <%- include('footer.ejs') -%> \ No newline at end of file diff --git a/views/header_block.ejs b/views/header_block.ejs index af8b1b0..8569e5c 100644 --- a/views/header_block.ejs +++ b/views/header_block.ejs @@ -1,16 +1,16 @@
- - BiglyChat + + BiglyChat <%if (username=='!nobody' ) { %> - Login + Login <% } else { %> - + <%= username %> - + Upload - + Settings <% } %> diff --git a/views/main.ejs b/views/main.ejs index 730fb4c..1797be1 100644 --- a/views/main.ejs +++ b/views/main.ejs @@ -1,19 +1,22 @@ <%- include('header.ejs') -%> -
-

BiglyChat

-

Broadcast videos to your fanbase, while you and the owners feel part of the community. No more black box moderation.

-
- Guidelines - <%- include ('guidelines.ejs') -%> -
-

Signing up to upload content

- <%if (username=='!nobody' ) { %> - - <% } %> - - + -
+

Recent Videos

<%- include('videos.ejs') -%> diff --git a/views/player.ejs b/views/player.ejs index 2d8e393..f1e4341 100644 --- a/views/player.ejs +++ b/views/player.ejs @@ -1,5 +1,5 @@ <%- include('header.ejs') -%> -
+

Video

@@ -11,15 +11,15 @@
-
+

<%= videoData.title %> -

+

-
- +
+
- Created by + Created by @<%= videoData.username %> on @@ -27,7 +27,7 @@
-
<%= videoData.desc %>
+
<%= videoData.desc %>
<%- include('comments.ejs') -%> <%- include('footer.ejs') -%> \ No newline at end of file diff --git a/views/user.ejs b/views/user.ejs index 24bc7b2..75d8ed9 100644 --- a/views/user.ejs +++ b/views/user.ejs @@ -1,46 +1,43 @@ <%- include('header.ejs') -%> -
-

User

-
-
-
- + + + -
<%= user[0] ? user[0].bio : 'This user has not set a bio.' %>
-
-

Uploaded Videos

-
- <%- include('videos.ejs') -%> -
+

Uploaded Videos

+
+ <%- include('videos.ejs') -%>
<%- include('comments.ejs') -%> <%- include('footer.ejs') -%> \ No newline at end of file