Refactor SVG loading icons and adjust styles

This commit includes several changes that revolve around the SVG icons used as loading indicators. The loading indicators have been reduced in size and the animation and color have been adjusted. New SVG graphics have also been introduced, including a complex icon and a simple icon for different sections of the interface.

Here are some key points:
- The size of the `IconLoading` class has been changed from `h-5` and `w-5` to `h-4` and `w-4`.
- New styling with `fill-purple-600`, `text-light-500`, and `dark:text-dark-500` have been applied to `IconLoading` to better match the project's color scheme.
- A new SVG graphic, using `fill="currentFill"`, has been introduced and replaces the old SVG graphic.
- Some SVG tags have been commented out, presumably for future use or for debugging purposes.
This commit is contained in:
Kiril Videlov 2023-07-23 12:41:43 +02:00 committed by Kiril Videlov
parent b5930770d9
commit 4f282805da
2 changed files with 25 additions and 3 deletions

View File

@ -46,11 +46,13 @@
>
{#if loading}
{#if icon}
<IconLoading class="h-5 w-5 animate-spin" />
<IconLoading class="h-4 w-4 animate-spin fill-purple-600 text-light-500 dark:text-dark-500" />
<slot />
{:else}
<div class="items-around absolute flex w-full justify-center">
<IconLoading class="h-5 w-5 animate-spin" />
<IconLoading
class="h-4 w-4 animate-spin fill-purple-600 text-light-500 dark:text-dark-500"
/>
</div>
<div class="opacity-0">
<slot />

View File

@ -3,7 +3,7 @@
export { className as class };
</script>
<svg
<!-- <svg
class={className}
width="17"
height="18"
@ -15,4 +15,24 @@
d="M10.2319 16.778C10.3291 17.3917 9.90965 17.9754 9.28864 17.9954C8.01444 18.0363 6.74156 17.8061 5.55585 17.3149C4.02239 16.6797 2.69445 15.6329 1.71885 14.2901C0.743241 12.9473 0.157971 11.3608 0.027744 9.70613C-0.102483 8.05145 0.227407 6.39298 0.980941 4.91409C1.73448 3.43519 2.8823 2.19348 4.29751 1.32624C5.71273 0.458995 7.3402 2.9673e-08 9 0C10.6598 -2.9673e-08 12.2873 0.458995 13.7025 1.32624C14.7968 1.99682 15.7312 2.89128 16.4471 3.94617C16.796 4.46028 16.5703 5.14275 16.0167 5.42482C15.4631 5.7069 14.7926 5.47939 14.4226 4.98026C13.9097 4.28843 13.2671 3.69827 12.5269 3.24468C11.4655 2.59425 10.2449 2.25 9 2.25C7.75515 2.25 6.53454 2.59425 5.47313 3.24468C4.41172 3.89511 3.55086 4.82639 2.98571 5.93556C2.42056 7.04473 2.17314 8.28859 2.27081 9.5296C2.36848 10.7706 2.80743 11.9604 3.53914 12.9676C4.27084 13.9747 5.26679 14.7598 6.41689 15.2362C7.21892 15.5684 8.07412 15.7414 8.93527 15.7497C9.55656 15.7557 10.1347 16.1644 10.2319 16.778Z"
fill="currentColor"
/>
</svg> -->
<!-- class="animate-spin fill-blue-600 text-light-600" -->
<svg
class={className}
width="20"
height="20"
aria-hidden="true"
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
/>
<path
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill="currentFill"
/>
</svg>