From 04bc84c8adab8efa071a294a07e16e267fb9c87a Mon Sep 17 00:00:00 2001 From: tdgmcode Date: Sat, 18 Mar 2023 20:36:08 -0400 Subject: [PATCH] UI improvements --- src/lib/components/Button.svelte | 9 ++--- src/lib/components/Post.svelte | 15 +++++--- src/lib/components/PostButton.svelte | 9 +++-- src/lib/components/PostList.svelte | 16 ++++----- src/lib/util.js | 1 + static/delete.svg | 35 ++++++++++-------- static/downvote.svg | 38 ++++++++++---------- static/reply.svg | 54 ++++++++++++++++++++++++++++ static/upvote.svg | 36 +++++++++++-------- static/view.svg | 40 ++++++++++----------- 10 files changed, 163 insertions(+), 90 deletions(-) create mode 100644 static/reply.svg diff --git a/src/lib/components/Button.svelte b/src/lib/components/Button.svelte index 8e2f6c2..c49b5a2 100644 --- a/src/lib/components/Button.svelte +++ b/src/lib/components/Button.svelte @@ -1,19 +1,16 @@ diff --git a/src/lib/components/Post.svelte b/src/lib/components/Post.svelte index 03418a4..e551081 100644 --- a/src/lib/components/Post.svelte +++ b/src/lib/components/Post.svelte @@ -78,6 +78,11 @@ font-style: italic; font-weight: normal; } + + .votes { + display: flex; + + } {#if success} @@ -108,7 +113,7 @@ - + vote('up')} data={upvotes * 1} @@ -122,21 +127,21 @@ {#if isAuthor} deletePost()} - data={'Delete'} + data={''} icon='/delete.svg' /> {/if} {#if id} {/if} diff --git a/src/lib/components/PostButton.svelte b/src/lib/components/PostButton.svelte index 2f9da3a..77c3e43 100644 --- a/src/lib/components/PostButton.svelte +++ b/src/lib/components/PostButton.svelte @@ -2,9 +2,12 @@ .votes { font-weight: bold; font-size: 0.9rem; + margin-left: 5px; } .vote-area { - margin-right: 30px; + margin-right: 15px; + display: flex; + align-items: center; } .button { @@ -25,7 +28,7 @@ Vote button - +
{data} - +
\ No newline at end of file diff --git a/src/lib/components/PostList.svelte b/src/lib/components/PostList.svelte index c39203e..8014d44 100644 --- a/src/lib/components/PostList.svelte +++ b/src/lib/components/PostList.svelte @@ -14,6 +14,14 @@ {/if}

+

+ {#if data.id > 0} + { window.location.search = setLocation(window.location,'page',((data.id)-1)) }} href='#'>← Page {(data.id)-1} + {/if} + Page {(data.id)} + { window.location.search = setLocation(window.location,'page',((data.id)+1)) }} href='#'>Page {(data.id)+1} → +

+ {#if data && data.postJson && data.postJson.data} {#each data.postJson.data as post} {/each} {/if} - -

- {#if data.id > 0} - { window.location.search = setLocation(window.location,'page',((data.id)-1)) }} href='#'>← Page {(data.id)-1} - {/if} - Page {(data.id)} - { window.location.search = setLocation(window.location,'page',((data.id)+1)) }} href='#'>Page {(data.id)+1} → -

\ No newline at end of file diff --git a/src/lib/util.js b/src/lib/util.js index d0f5b46..c60d805 100644 --- a/src/lib/util.js +++ b/src/lib/util.js @@ -190,6 +190,7 @@ let safePath = function(path) { let setLocation = function(location, key, value) { var loc = new URL(location).searchParams; + loc.set('page',0); loc.set(key,value); return loc.toString(); } diff --git a/static/delete.svg b/static/delete.svg index 218d0fe..54b7aef 100644 --- a/static/delete.svg +++ b/static/delete.svg @@ -2,12 +2,12 @@ + transform="translate(-41.538108,-132.67761)"> + sodipodi:nodetypes="ccc" /> + diff --git a/static/downvote.svg b/static/downvote.svg index 4ef8081..f768ecd 100644 --- a/static/downvote.svg +++ b/static/downvote.svg @@ -2,12 +2,12 @@ + transform="translate(-48.865981,-130.90513)"> + style="fill:none;fill-opacity:1;stroke:#aaaaaa;stroke-width:7.93753;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 52.834746,146.97237 11.093647,11.9262 11.09365,-11.9262" + id="path3462" + sodipodi:nodetypes="ccc" /> + style="fill:#002368;stroke:#aaaaaa;stroke-width:7.93801;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="M 63.928394,151.30806 V 134.87414" + id="path610" + sodipodi:nodetypes="cc" /> diff --git a/static/reply.svg b/static/reply.svg new file mode 100644 index 0000000..fa4fa9a --- /dev/null +++ b/static/reply.svg @@ -0,0 +1,54 @@ + + + + + + + + + + + diff --git a/static/upvote.svg b/static/upvote.svg index 8e113b7..3bfbe58 100644 --- a/static/upvote.svg +++ b/static/upvote.svg @@ -2,12 +2,12 @@ + transform="translate(-48.865981,-130.90513)"> + style="fill:none;fill-opacity:1;stroke:#aaaaaa;stroke-width:7.93753;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 52.834746,146.79991 11.093647,-11.9262 11.09365,11.9262" + id="path3462" + sodipodi:nodetypes="ccc" /> + diff --git a/static/view.svg b/static/view.svg index c181cc3..d76ddfa 100644 --- a/static/view.svg +++ b/static/view.svg @@ -2,13 +2,13 @@ - + transform="translate(-82.346018,-104.91266)"> + cy="118.47242" + r="5.4154248" /> +