refactoring for tools and start waypoint

This commit is contained in:
vcoppe
2024-04-28 18:59:31 +02:00
parent 6b201d8341
commit 583af07412
10 changed files with 202 additions and 95 deletions

View File

@@ -1,9 +1,22 @@
<script lang="ts">
import { type Tool, currentTool } from '$lib/stores';
import { flyAndScale } from '$lib/utils';
import * as Card from '$lib/components/ui/card';
export let tool: Tool;
export let active = false;
$: active = $currentTool === tool;
</script>
<div in:flyAndScale={{ x: -2, y: 0, duration: 100 }} class="translate-x-1 h-full">
<div class="rounded-md shadow-md pointer-events-auto">
<slot />
{#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>
</div>
</div>
{/if}