compact buttons

This commit is contained in:
tdgmcode 2023-03-19 18:08:35 -04:00
parent 4cfee771d1
commit 8f29503565
3 changed files with 10 additions and 8 deletions

View file

@ -1,13 +1,15 @@
<style> <style>
.button { .button {
padding: 0.5rem; padding: 0.35rem;
border: none; border: none;
border-bottom: solid var(--dark-3) 3px; border-bottom: solid var(--dark-3) 3px;
box-shadow: 0px 3px 5px 3px rgba(0,0,0,0.1); box-shadow: 0px 3px 5px 3px rgba(0,0,0,0.1);
font-family: 'Open Sans'; font-family: 'Open Sans';
margin-right: 0.2rem; margin: 0.2rem;
margin-top: 0.5rem;
margin-bottom: 0rem;
} }
.button a { .button a {

View file

@ -6,21 +6,21 @@
export let data, noRatings = false; export let data, noRatings = false;
</script> </script>
<p> <span>
{#if !noRatings} {#if !noRatings}
<Button clickFunc={() => { window.location.search = setLocation(window.location,'sort','hot')}}>Hot</Button> <Button clickFunc={() => { window.location.search = setLocation(window.location,'sort','hot')}}>Hot</Button>
<Button clickFunc={() => { window.location.search = setLocation(window.location,'sort','rating')}}>Top</Button> <Button clickFunc={() => { window.location.search = setLocation(window.location,'sort','rating')}}>Top</Button>
<Button clickFunc={() => { window.location.search = setLocation(window.location,'sort','time')}}>Recent</Button> <Button clickFunc={() => { window.location.search = setLocation(window.location,'sort','time')}}>Recent</Button>
{/if} {/if}
</p> </span>
<p> <span>
{#if data.id > 0} {#if data.id > 0}
<Button clickFunc={() => { window.location.search = setLocation(window.location,'page',((data.id)-1)) }} href='#'>Page {(data.id)-1}</Button> <Button clickFunc={() => { window.location.search = setLocation(window.location,'page',((data.id)-1)) }} href='#'>Page {(data.id)-1}</Button>
{/if} {/if}
<Button>Page {(data.id)}</Button> <Button>Page {(data.id)}</Button>
<Button clickFunc={() => { window.location.search = setLocation(window.location,'page',((data.id)+1)) }} href='#'>Page {(data.id)+1}</Button> <Button clickFunc={() => { window.location.search = setLocation(window.location,'page',((data.id)+1)) }} href='#'>Page {(data.id)+1}</Button>
</p> </span>
{#if data && data.postJson && data.postJson.data} {#if data && data.postJson && data.postJson.data}
{#each data.postJson.data as post} {#each data.postJson.data as post}

View file

@ -7,9 +7,9 @@
export let data; export let data;
</script> </script>
<p> <span>
<Button clickFunc={() => { window.location.search = setLocation(window.location,'type',('all')) }}>All users</Button> <Button clickFunc={() => { window.location.search = setLocation(window.location,'type',('all')) }}>All users</Button>
<Button clickFunc={() => { window.location.search = setLocation(window.location,'type',('follow')) }}>Following only</Button> <Button clickFunc={() => { window.location.search = setLocation(window.location,'type',('follow')) }}>Following only</Button>
</p> </span>
<PostList data={data} /> <PostList data={data} />