diff --git a/src/lib/components/Area.svelte b/src/lib/components/Area.svelte index a12904c..a8aaf62 100644 --- a/src/lib/components/Area.svelte +++ b/src/lib/components/Area.svelte @@ -25,6 +25,8 @@ #main { min-height: 250px; + max-height: 500px; + overflow-y: scroll; } #main.tiny { diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte new file mode 100644 index 0000000..40b5f31 --- /dev/null +++ b/src/lib/components/Button.svelte @@ -0,0 +1,27 @@ + + + + + \ No newline at end of file diff --git a/src/lib/components/FileUpload.svelte b/src/lib/components/FileUpload.svelte new file mode 100644 index 0000000..568613b --- /dev/null +++ b/src/lib/components/FileUpload.svelte @@ -0,0 +1,55 @@ + + + + +
+ {#if preview} + Image preview + {:else} + Image preview + {/if} + getBase64(files[0])}/> +

+ +

+
\ No newline at end of file diff --git a/src/lib/components/Post.svelte b/src/lib/components/Post.svelte index 516d4e0..5952384 100644 --- a/src/lib/components/Post.svelte +++ b/src/lib/components/Post.svelte @@ -1,13 +1,11 @@ + + + + + {#each contentSplit as line} + {#if line && line.type == 'img'} + Image preview + {:else} +

{line}

+ {/if} + {/each} +
\ No newline at end of file diff --git a/src/lib/components/PostButton.svelte b/src/lib/components/PostButton.svelte new file mode 100644 index 0000000..73da573 --- /dev/null +++ b/src/lib/components/PostButton.svelte @@ -0,0 +1,31 @@ + + + + + + + Vote button + + + {data} + + \ No newline at end of file diff --git a/src/lib/util.js b/src/lib/util.js index 45a1604..8341f94 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -81,11 +81,16 @@ let formatPost = function(post) { return post; } +function block(bool) { + return (bool) ? 'block' : 'inline'; +} + export { checkLength, checkRegex, calcVote, handleSubmit, calcVoteUser, - formatPost + formatPost, + block }; \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 2aa42db..7a7b020 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -2,6 +2,7 @@ :global(:root) { --dark-1: #1a1b1d; --dark-2: #22242b; + --dark-3: #5d606b; --light-1: #ffffff; @@ -83,9 +84,6 @@ Create - - Create file - {:else} Log in / Register diff --git a/src/routes/new_file/+page.svelte b/src/routes/new_file/+page.svelte deleted file mode 100644 index ad9b48e..0000000 --- a/src/routes/new_file/+page.svelte +++ /dev/null @@ -1,75 +0,0 @@ - - - - - -

- Upload File -

-
- {#if preview} - Image preview - {:else} - Image preview - {/if} - getBase64(files[0])}/> -

- fileInput.click() }>Upload -

-
-

- {#if form?.success} - {#if form?.href} - {form?.success} - {:else} - {form?.success} - {/if} - {/if} - Create an image for the world to see. -

- \ No newline at end of file diff --git a/src/routes/new_post/+page.svelte b/src/routes/new_post/+page.svelte index 57f99e4..291d0f5 100644 --- a/src/routes/new_post/+page.svelte +++ b/src/routes/new_post/+page.svelte @@ -1,10 +1,30 @@

Create Post

-
form = JSON.parse(await handleSubmit(e)) }> -

- -

-

- -

-
+
+
form = JSON.parse(await handleSubmit(e)) } + > + + + {#if currentState == 'editor'} +

+ +

+ {:else if currentState == 'visual'} + + {:else} + + {/if} +
+
+ + + + +

{#if form?.success} {#if form?.href} diff --git a/src/routes/post/[post]/+page.svelte b/src/routes/post/[post]/+page.svelte index 96e8adf..e047106 100644 --- a/src/routes/post/[post]/+page.svelte +++ b/src/routes/post/[post]/+page.svelte @@ -11,4 +11,5 @@ content={data.content} upvotes={data.upvotes} downvotes={data.downvotes} + id={data.id} > \ No newline at end of file