mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-03 09:12:30 +00:00
refactoring for tools and start waypoint
This commit is contained in:
@@ -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}
|
||||
|
Reference in New Issue
Block a user