2024-04-22 19:36:31 +02:00
|
|
|
<script lang="ts">
|
2024-04-28 18:59:31 +02:00
|
|
|
import { type Tool, currentTool } from '$lib/stores';
|
2024-04-22 19:36:31 +02:00
|
|
|
import { flyAndScale } from '$lib/utils';
|
2024-04-28 18:59:31 +02:00
|
|
|
import * as Card from '$lib/components/ui/card';
|
|
|
|
|
|
|
|
export let tool: Tool;
|
|
|
|
export let active = false;
|
|
|
|
|
|
|
|
$: active = $currentTool === tool;
|
2024-04-22 19:36:31 +02:00
|
|
|
</script>
|
|
|
|
|
2024-04-28 18:59:31 +02:00
|
|
|
{#if active}
|
|
|
|
<div in:flyAndScale={{ x: -2, y: 0, duration: 100 }} class="translate-x-1 h-full">
|
|
|
|
<div class="rounded-md shadow-md pointer-events-auto">
|
|
|
|
<Card.Root class="border-none">
|
|
|
|
<Card.Content class="p-4 flex flex-col gap-4">
|
|
|
|
<slot />
|
|
|
|
</Card.Content>
|
|
|
|
</Card.Root>
|
|
|
|
</div>
|
2024-04-22 19:36:31 +02:00
|
|
|
</div>
|
2024-04-28 18:59:31 +02:00
|
|
|
{/if}
|