diff --git a/.gitignore b/.gitignore index 42e5a50..302c996 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ node_modules vite.config.js.timestamp-* vite.config.ts.timestamp-* /db +/db-old \ No newline at end of file diff --git a/src/lib/components/Area.svelte b/src/lib/components/Area.svelte index 6a857fb..825f7b3 100644 --- a/src/lib/components/Area.svelte +++ b/src/lib/components/Area.svelte @@ -29,7 +29,6 @@ } #header { - border-bottom: var(--dark-2) solid 2px; width: calc(100% - 30px); } diff --git a/src/lib/components/Form.svelte b/src/lib/components/Form.svelte new file mode 100644 index 0000000..3f3241a --- /dev/null +++ b/src/lib/components/Form.svelte @@ -0,0 +1,28 @@ + + + + + {name} + + + + + +
+ {#if form?.success} +
{form?.success}
+ {/if} + By using the Sanifae service, you agree to the Terms of Service. + + \ No newline at end of file diff --git a/src/lib/components/Post.svelte b/src/lib/components/Post.svelte index 11069e0..03418a4 100644 --- a/src/lib/components/Post.svelte +++ b/src/lib/components/Post.svelte @@ -70,6 +70,7 @@ width: 50px; height: 50px; margin-right: 10px; + border-radius: 100%; } .date { @@ -94,7 +95,7 @@ {:else} -- {#if form?.success} -
{form?.success}
- {/if} + \ No newline at end of file diff --git a/src/routes/account/register/+page.svelte b/src/routes/account/register/+page.svelte index dfdce60..af03f2a 100644 --- a/src/routes/account/register/+page.svelte +++ b/src/routes/account/register/+page.svelte @@ -1,38 +1,18 @@ - - - Register - - - -- {#if form?.success} -
{form?.success}
- {/if} - By using the Sanifae service, you agree to the Terms of Service. + \ No newline at end of file diff --git a/src/routes/img/[img]/+server.js b/src/routes/img/[dir]/[img]/+server.js similarity index 64% rename from src/routes/img/[img]/+server.js rename to src/routes/img/[dir]/[img]/+server.js index f315280..d5619ef 100644 --- a/src/routes/img/[img]/+server.js +++ b/src/routes/img/[dir]/[img]/+server.js @@ -1,14 +1,23 @@ -import { backend, backendProxy } from '../../../lib/db/db.js'; +import { backend, backendProxy } from '../../../../lib/db/db.js'; import { readFile, writeFile } from 'node:fs/promises'; +const FILE_DIRS = [ + 'upload', + 'pfp' +] + /** @type {import('./$types').RequestHandler} */ export async function GET({ url, cookies, params }) { var imgName = params['img']; imgName = imgName.replace(/(\s+)/g, '\\$1'); - var res = await readFile(`${process.cwd()}/db/post-${imgName}`); + var dir = params['dir']; + + if (FILE_DIRS.indexOf(dir) == -1) dir = FILE_DIRS[0]; + + var res = await readFile(`${process.cwd()}/db/files/${dir}/${imgName}`); var response = new Response(res); var extension = imgName.split('.').pop(); diff --git a/src/routes/pfp/[img]/+server.js b/src/routes/pfp/[img]/+server.js deleted file mode 100644 index d442b67..0000000 --- a/src/routes/pfp/[img]/+server.js +++ /dev/null @@ -1,24 +0,0 @@ -import { VALID_EXTENSIONS } from '../../../lib/db/db.js'; - -import { readFile } from 'node:fs/promises'; - -/** @type {import('./$types').RequestHandler} */ -export async function GET({ url, cookies, params }) { - var imgName = params['img']; - - imgName = imgName.replace(/(\s+)/g, '\\$1'); - - var res; - - var res = await readFile(`${process.cwd()}/db/pfp-${imgName}`); - - var response = new Response(res); - var extension = imgName.split('.').pop(); - - if (extension == 'svg') { - response = new Response(res, {'headers': { - 'Content-Type': 'image/png' - }}); - } - return response; -} diff --git a/src/routes/users/[user]/+page.svelte b/src/routes/users/[user]/+page.svelte index ab7901c..dfd6b90 100644 --- a/src/routes/users/[user]/+page.svelte +++ b/src/routes/users/[user]/+page.svelte @@ -10,7 +10,6 @@ let uploadForm = {}; let userData = data.postJsonUser.data; - let userBio = data.postJsonUserBio.data; let following = data.postJsonUser.following; let followers = data.postJsonUser.followers; @@ -37,67 +36,106 @@ } .pfp { - width: 50px; - height: 50px; - margin-right: 10px; + width: 100px; + height: 100px; + border-radius: 100%; + } + + .pfp-small { + width: 45px; + height: 45px; + border-radius: 100%; } #header { display: flex; + justify-content: space-between; + width: 100%; + } + + .sections { + display: grid; + grid-template-columns: 1fr 1fr; + } + + .sections div { + text-align: right; + } + + .sections div:nth-child(1) { + text-align: left; + } + + .profile { align-items: center; + flex-direction: column; + display: flex; } {#if userData} -- Reputation: {userData.reputation} +
+ + {userData.reputation} Reputation + + + {userData.upvotes} Upvotes + + + {userData.downvotes} Downvotes +
-- Upvotes: {userData.upvotes} -
-- Downvotes: {userData.downvotes} -
-- {#if userBio && userBio.rolesArr} - {#each userBio.rolesArr as role} - {role} + + {#if userData.rolesArr} +
+ {#each userData.rolesArr as role} + {role} {/each} - {/if} -
+ + {/if} -