drag and drop but nicer

This commit is contained in:
2026-02-10 01:58:33 -08:00
parent ed9fcbe116
commit 197b9267c4

View File

@@ -80,21 +80,28 @@
class:border-primary={dragOverIndex === i}
>
<div
class="w-8 shrink-0 flex items-center justify-center cursor-grab active:cursor-grabbing text-muted-foreground/50 hover:text-foreground"
class="w-6 shrink-0 flex items-center justify-center text-xs text-muted-foreground/60 font-mono"
>
<!-- Default: Number or Active Indicator -->
<div
class="group-hover:hidden flex items-center justify-center w-full h-full"
>
{#if player.currentId === track.id}
<div
class="w-2 h-2 bg-primary rounded-full animate-pulse"
></div>
{:else}
<span>{i + 1}</span>
{/if}
</div>
<!-- Hover: Grip Handle -->
<div
class="hidden group-hover:flex items-center justify-center w-full h-full cursor-grab active:cursor-grabbing text-muted-foreground/50 hover:text-foreground"
aria-label="Drag to reorder"
>
<GripVertical class="h-4 w-4" />
</div>
<div
class="w-6 shrink-0 text-center text-xs text-muted-foreground/60 font-mono"
>
{#if player.currentId === track.id}
<div
class="w-2 h-2 bg-primary rounded-full mx-auto animate-pulse"
></div>
{:else}
<span class="text-xs">{i + 1}</span>
{/if}
</div>
<div class="flex-1 min-w-0">