1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-04-10 13:41:03 +00:00

61 lines
1.1 KiB
Svelte
Raw Normal View History

2023-01-10 17:28:27 +01:00
<script>
2023-07-02 11:00:20 +02:00
import icons from '$lib/icons.json';
2023-01-14 20:38:39 +01:00
export let name = '';
export let spin = false;
export let rotation = 0;
if (name === 'loading') {
spin = true;
}
2023-01-10 17:28:27 +01:00
</script>
<style>
@keyframes spinning {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
svg {
transition: transform 0.25s;
will-change: transform;
2023-12-22 13:30:03 +01:00
width: 1.2em;
height: 1.2em;
}
svg.spinning {
animation: spinning 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
:global(.field) svg {
2023-12-22 13:30:03 +01:00
width: 1em;
height: 1em;
margin-right: 2px;
}
2023-06-27 17:21:54 +02:00
:global(.button) svg {
2023-12-22 13:30:03 +01:00
height: 1em;
width: auto;
vertical-align: bottom;
}
2023-07-19 20:45:05 +02:00
:global(.blankstate .button) svg {
2023-12-22 13:30:03 +01:00
height: 1.25em;
2023-07-19 20:45:05 +02:00
vertical-align: -3px;
margin-right: 4px;
}
</style>
<svg
xmlns="http://www.w3.org/2000/svg"
2023-06-11 09:34:00 +02:00
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class:spinning={spin}
style:transform="rotate({rotation}deg)"
>
2023-07-02 11:00:20 +02:00
{@html icons[name] || ''}
</svg>