refactor: empty grid item

This commit is contained in:
Arman committed 2022-09-22 14:36:37 +02:00
1 parent b99230615b
commit 719b5cd16b
8 files changed
+18 -40

No files matched your search

+11
View File
@@ -1,5 +1,16 @@
<script lang="ts">
import { app } from '$lib/stores/app';
import EmptyLight from '$lib/images/empty-light.svg';
import EmptyDark from '$lib/images/empty-dark.svg';
</script>
<button on:click class="card is-border-dashed u-grid u-cross-center">
<div class="u-flex u-flex-vertical u-cross-center">
{#if $app.themeInUse === 'dark'}
<img src={EmptyDark} alt="create" aria-hidden="true" />
{:else}
<img src={EmptyLight} alt="create" aria-hidden="true" />
{/if}
<slot />
</div>
</button>
+1
View File
@@ -0,0 +1 @@
<svg width="148" height="105" fill="none" xmlns="http://www.w3.org/2000/svg"><g filter="url(#a)"><path d="M38.51 23.233a4.012 4.012 0 0 1 3.407-4.568l24.203-3.399a3.99 3.99 0 0 1 2.932.746l5.139 3.812a3.99 3.99 0 0 1 1.576 2.673l5.38 39.95a4.012 4.012 0 0 1-3.41 4.506l-28.033 3.995a3.988 3.988 0 0 1-4.508-3.355l-6.686-44.36Z" fill="#fff"/></g><path d="m43.643 23.837 23.556-3.523a3.988 3.988 0 0 1 4.549 3.445l1.943 15.343-27.278 3.888-2.77-19.153Z" fill="url(#b)"/><path d="m49.09 26.97 2.732-.358 1.666 12.379-2.73.358L49.09 26.97Z" fill="url(#c)"/><path d="m54.31 30.946 2.731-.358 1.06 7.835-2.73.359-1.06-7.836Z" fill="url(#d)"/><path d="m58.79 28.826 2.73-.359 1.148 9.366-2.73.358-1.149-9.365Z" fill="url(#e)"/><path d="m63.839 32.53 2.73-.358.688 4.966-2.73.359-.688-4.967Z" fill="url(#f)"/><path d="m68.395 22.448-.656-7.41 8.032 5.866-7.376 1.544Z" fill="#DFE1EE"/><path d="m76.953 83.571 30.488 6.946H35.578L.5 83.571h76.453Z" fill="url(#g)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M54.995 53.8c-.774-.608-1.715-.94-2.63-.928l-20.301.26c-2.172.029-3.526 1.927-2.886 4.046.536 1.775 2.302 3.089 4.121 3.065l20.3-.27c3.266-.044 4.162-4.004 1.396-6.173Zm53.289 9.991c-.051-2.388-2.297-4.507-4.743-4.475l-68.852.917c-2.417.032-3.917 2.153-3.19 4.51l6.938 22.468c.604 1.959 2.559 3.401 4.567 3.371l62.391-.934c1.975-.03 3.405-1.477 3.364-3.406l-.475-22.45Z" fill="#C4C6D7"/><path d="m76.92 24.531-2.066 27.784-6.884-.926-2.754-3.705 2.634-16.48a6 6 0 0 1 5.925-5.052h2.227l.918-1.62Z" fill="url(#h)" fill-opacity=".6"/><g filter="url(#i)"><path d="M71.955 27.705a3.975 3.975 0 0 1 4.343-3.602l28.228 2.718a4.024 4.024 0 0 1 3.616 4.369l-3.97 43.59a3.976 3.976 0 0 1-4.343 3.603l-28.228-2.718a4.025 4.025 0 0 1-3.616-4.369l3.97-43.59Z" fill="#fff"/></g><rect width="26.622" height="1.389" rx=".695" transform="rotate(4.056 -376.174 1105.033) skewX(.071)" fill="#E8E9F0"/><rect width="13.33" height="1.389" rx=".695" transform="rotate(4.056 -428.89 1100.632) skewX(.071)" fill="#E8E9F0"/><path d="m106.608 47.684-36.114-1.389-.459 4.4h36.573v-3.01Z" fill="url(#j)" fill-opacity=".5"/><path d="M60.826 41.236a1.83 1.83 0 0 0-1.46-.73H37.218c-1.014 0-1.836.83-1.836 1.853l3.672 46.306c0 1.023.822 1.852 1.836 1.852h67.01c1.014 0 1.836-.83 1.836-1.852l3.672-36.119a1.844 1.844 0 0 0-1.836-1.852H68.878a1.83 1.83 0 0 1-1.46-.73l-6.592-8.728Z" fill="url(#k)"/><ellipse cx="74.166" cy="85.655" rx="11.245" ry="11.345" fill="url(#l)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M74.395 81.997c.305 0 .551.249.551.556v2.778H77.7c.304 0 .55.249.55.556a.553.553 0 0 1-.55.555h-2.754v2.779a.553.553 0 0 1-.55.555.553.553 0 0 1-.551-.555v-2.779H71.09a.553.553 0 0 1-.551-.555c0-.307.247-.556.55-.556h2.755v-2.778c0-.307.246-.556.55-.556Z" fill="#FCFCFF"/><defs><linearGradient id="b" x1="44.102" y1="4.157" x2="36.884" y2="51.275" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#B4B6CA"/></linearGradient><linearGradient id="c" x1="50.491" y1="26.786" x2="52.116" y2="39.171" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="d" x1="55.7" y1="30.764" x2="56.729" y2="38.603" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="e" x1="60.125" y1="28.651" x2="61.353" y2="38.006" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="f" x1="65.227" y1="32.348" x2="65.88" y2="37.319" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="g" x1="90.689" y1="96.769" x2="24.23" y2="74.494" gradientUnits="userSpaceOnUse"><stop stop-color="#C4C6D7"/><stop offset=".992" stop-color="#C4C6D7" stop-opacity=".1"/></linearGradient><linearGradient id="h" x1="65.216" y1="47.453" x2="69.652" y2="17.597" gradientUnits="userSpaceOnUse"><stop stop-color="#A3A8BD"/><stop offset="1" stop-color="#A3A8BD" stop-opacity="0"/></linearGradient><linearGradient id="j" x1="98.951" y1="-33.583" x2="84.242" y2="51.577" gradientUnits="userSpaceOnUse"><stop stop-color="#C4C6D7"/><stop offset="1" stop-color="#C4C6D7" stop-opacity=".37"/></linearGradient><linearGradient id="k" x1="4.171" y1="9.482" x2="114.21" y2="101.365" gradientUnits="userSpaceOnUse"><stop stop-color="#C4C6D7"/><stop offset="1" stop-color="#F2F2F8"/></linearGradient><linearGradient id="l" x1="58.561" y1="78.246" x2="77.573" y2="100.538" gradientUnits="userSpaceOnUse"><stop stop-color="#A3A8BD"/><stop offset="1" stop-color="#C4C6D7"/></linearGradient><filter id="a" x="15.465" y="4.227" width="74.718" height="87.761" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127Line truncated

After

Width:  |  Height:  |  Size: 6.3 KiB

+1
View File
@@ -0,0 +1 @@
<svg width="148" height="105" fill="none" xmlns="http://www.w3.org/2000/svg"><g filter="url(#a)"><path d="M38.51 23.233a4.012 4.012 0 0 1 3.407-4.568l24.203-3.399a3.99 3.99 0 0 1 2.932.746l5.139 3.812a3.99 3.99 0 0 1 1.576 2.673l5.38 39.95a4.012 4.012 0 0 1-3.41 4.506l-28.033 3.995a3.988 3.988 0 0 1-4.508-3.355l-6.686-44.36Z" fill="#fff"/></g><path d="m43.643 23.837 23.556-3.523a3.988 3.988 0 0 1 4.549 3.445l1.943 15.343-27.278 3.888-2.77-19.153Z" fill="url(#b)"/><path d="m49.09 26.97 2.732-.358 1.666 12.379-2.73.358L49.09 26.97Z" fill="url(#c)"/><path d="m54.31 30.946 2.731-.358 1.06 7.835-2.73.359-1.06-7.836Z" fill="url(#d)"/><path d="m58.79 28.826 2.73-.359 1.148 9.366-2.73.358-1.149-9.365Z" fill="url(#e)"/><path d="m63.839 32.53 2.73-.358.688 4.966-2.73.359-.688-4.967Z" fill="url(#f)"/><path d="m68.395 22.448-.656-7.41 8.032 5.866-7.376 1.544Z" fill="#DFE1EE"/><path d="m76.953 83.571 30.488 6.946H35.578L.5 83.571h76.453Z" fill="url(#g)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M54.995 53.8c-.774-.608-1.715-.94-2.63-.928l-20.301.26c-2.172.029-3.526 1.927-2.886 4.046.536 1.775 2.302 3.089 4.121 3.065l20.3-.27c3.266-.044 4.162-4.004 1.396-6.173Zm53.289 9.991c-.051-2.388-2.297-4.507-4.743-4.475l-68.852.917c-2.417.032-3.917 2.153-3.19 4.51l6.938 22.468c.604 1.959 2.559 3.401 4.567 3.371l62.391-.934c1.975-.03 3.405-1.477 3.364-3.406l-.475-22.45Z" fill="#C4C6D7"/><path d="m76.92 24.531-2.066 27.784-6.884-.926-2.754-3.705 2.634-16.48a6 6 0 0 1 5.925-5.052h2.227l.918-1.62Z" fill="url(#h)" fill-opacity=".6"/><g filter="url(#i)"><path d="M71.955 27.705a3.975 3.975 0 0 1 4.343-3.602l28.228 2.718a4.024 4.024 0 0 1 3.616 4.369l-3.97 43.59a3.976 3.976 0 0 1-4.343 3.603l-28.228-2.718a4.025 4.025 0 0 1-3.616-4.369l3.97-43.59Z" fill="#fff"/></g><rect width="26.622" height="1.389" rx=".695" transform="rotate(4.056 -376.174 1105.033) skewX(.071)" fill="#E8E9F0"/><rect width="13.33" height="1.389" rx=".695" transform="rotate(4.056 -428.89 1100.632) skewX(.071)" fill="#E8E9F0"/><path d="m106.608 47.684-36.114-1.389-.459 4.4h36.573v-3.01Z" fill="url(#j)" fill-opacity=".5"/><path d="M60.826 41.236a1.83 1.83 0 0 0-1.46-.73H37.218c-1.014 0-1.836.83-1.836 1.853l3.672 46.306c0 1.023.822 1.852 1.836 1.852h67.01c1.014 0 1.836-.83 1.836-1.852l3.672-36.119a1.844 1.844 0 0 0-1.836-1.852H68.878a1.83 1.83 0 0 1-1.46-.73l-6.592-8.728Z" fill="url(#k)"/><ellipse cx="74.166" cy="85.655" rx="11.245" ry="11.345" fill="url(#l)"/><path fill-rule="evenodd" clip-rule="evenodd" d="M74.395 81.997c.305 0 .551.249.551.556v2.778H77.7c.304 0 .55.249.55.556a.553.553 0 0 1-.55.555h-2.754v2.779a.553.553 0 0 1-.55.555.553.553 0 0 1-.551-.555v-2.779H71.09a.553.553 0 0 1-.551-.555c0-.307.247-.556.55-.556h2.755v-2.778c0-.307.246-.556.55-.556Z" fill="#FCFCFF"/><defs><linearGradient id="b" x1="44.102" y1="4.157" x2="36.884" y2="51.275" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#B4B6CA"/></linearGradient><linearGradient id="c" x1="50.491" y1="26.786" x2="52.116" y2="39.171" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="d" x1="55.7" y1="30.764" x2="56.729" y2="38.603" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="e" x1="60.125" y1="28.651" x2="61.353" y2="38.006" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="f" x1="65.227" y1="32.348" x2="65.88" y2="37.319" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity=".31"/></linearGradient><linearGradient id="g" x1="90.689" y1="96.769" x2="24.23" y2="74.494" gradientUnits="userSpaceOnUse"><stop stop-color="#C4C6D7"/><stop offset=".992" stop-color="#C4C6D7" stop-opacity=".1"/></linearGradient><linearGradient id="h" x1="65.216" y1="47.453" x2="69.652" y2="17.597" gradientUnits="userSpaceOnUse"><stop stop-color="#A3A8BD"/><stop offset="1" stop-color="#A3A8BD" stop-opacity="0"/></linearGradient><linearGradient id="j" x1="98.951" y1="-33.583" x2="84.242" y2="51.577" gradientUnits="userSpaceOnUse"><stop stop-color="#C4C6D7"/><stop offset="1" stop-color="#C4C6D7" stop-opacity=".37"/></linearGradient><linearGradient id="k" x1="4.171" y1="9.482" x2="114.21" y2="101.365" gradientUnits="userSpaceOnUse"><stop stop-color="#C4C6D7"/><stop offset="1" stop-color="#F2F2F8"/></linearGradient><linearGradient id="l" x1="58.561" y1="78.246" x2="77.573" y2="100.538" gradientUnits="userSpaceOnUse"><stop stop-color="#A3A8BD"/><stop offset="1" stop-color="#C4C6D7"/></linearGradient><filter id="a" x="15.465" y="4.227" width="74.718" height="87.761" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127Line truncated

After

Width:  |  Height:  |  Size: 6.3 KiB

@@ -69,14 +69,7 @@
{/each}
{#if $organizationList?.total < limit + offset && ($organizationList?.total % 2 !== 0 || $organizationList?.total % 4 === 0)}
<EmptyGridItem on:click={() => (addOrganization = true)}>
<div class="common-section">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Create a new organization</p>
</div>
<p>Create a new organization</p>
</EmptyGridItem>
{/if}
</ul>
@@ -107,14 +107,7 @@
{/each}
{#if projects.length < limit + offset && (projects.length % 2 !== 0 || projects.length % 4 === 0)}
<EmptyGridItem on:click={() => (showCreate = true)}>
<div class="common-section">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Create a new project</p>
</div>
<p>Create a new project</p>
</EmptyGridItem>
{/if}
</ul>
@@ -50,14 +50,7 @@
{/each}
{#if ($databaseList.total % 2 !== 0 || $databaseList.total % 4 === 0) && $databaseList.total - offset <= limit}
<EmptyGridItem on:click={() => (showCreate = true)}>
<div class="common-section">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Create a new database</p>
</div>
<p>Create a new database</p>
</EmptyGridItem>
{/if}
</div>
@@ -64,14 +64,7 @@
{/each}
{#if ($collections.total % 2 !== 0 || $collections.total % 4 === 0) && $collections.total - offset <= limit}
<EmptyGridItem on:click={() => (showCreate = true)}>
<div class="common-section">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Create a new collection</p>
</div>
<p>Create a new collection</p>
</EmptyGridItem>
{/if}
</div>
@@ -83,14 +83,7 @@
{/each}
{#if $bucketList.total % 2 !== 0}
<EmptyGridItem on:click={() => (showCreate = true)}>
<div class="common-section">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<p>Add a new bucket</p>
</div>
<p>Add a new bucket</p>
</EmptyGridItem>
{/if}
</ul>