Add seperator between names/artists/images, styling tweaks
This commit is contained in:
parent
10d6751f6f
commit
a50e0d6ff8
5 changed files with 42 additions and 7 deletions
|
@ -22,11 +22,11 @@
|
||||||
items,
|
items,
|
||||||
flipDurationMs,
|
flipDurationMs,
|
||||||
type: type,
|
type: type,
|
||||||
dropTargetStyle: { outline: 'none' }
|
dropTargetStyle: {}
|
||||||
}}
|
}}
|
||||||
onconsider={handleDndConsider}
|
onconsider={handleDndConsider}
|
||||||
onfinalize={handleDndFinalize}
|
onfinalize={handleDndFinalize}
|
||||||
class="grid grid-cols-3 items-center gap-16"
|
class="grid grid-cols-3 items-center gap-14"
|
||||||
>
|
>
|
||||||
{#each items as item, i (item.id)}
|
{#each items as item, i (item.id)}
|
||||||
<div animate:flip={{ duration: flipDurationMs, easing: expoOut }}>
|
<div animate:flip={{ duration: flipDurationMs, easing: expoOut }}>
|
||||||
|
|
7
src/lib/components/ui/separator/index.ts
Normal file
7
src/lib/components/ui/separator/index.ts
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
import Root from "./separator.svelte";
|
||||||
|
|
||||||
|
export {
|
||||||
|
Root,
|
||||||
|
//
|
||||||
|
Root as Separator,
|
||||||
|
};
|
22
src/lib/components/ui/separator/separator.svelte
Normal file
22
src/lib/components/ui/separator/separator.svelte
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import { Separator as SeparatorPrimitive } from "bits-ui";
|
||||||
|
import { cn } from "$lib/utils.js";
|
||||||
|
|
||||||
|
let {
|
||||||
|
ref = $bindable(null),
|
||||||
|
class: className,
|
||||||
|
orientation = "horizontal",
|
||||||
|
...restProps
|
||||||
|
}: SeparatorPrimitive.RootProps = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<SeparatorPrimitive.Root
|
||||||
|
bind:ref
|
||||||
|
class={cn(
|
||||||
|
"bg-border shrink-0",
|
||||||
|
orientation === "horizontal" ? "h-[1px] w-full" : "min-h-full w-[1px]",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{orientation}
|
||||||
|
{...restProps}
|
||||||
|
/>
|
|
@ -4,7 +4,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex min-h-screen flex-col items-center justify-center">
|
<div class="flex min-h-screen flex-col items-center justify-center">
|
||||||
<header class="mb-12 flex flex-col items-center">
|
<header class="mb-24 flex flex-col items-center">
|
||||||
<h1 class="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl">Paku biiti</h1>
|
<h1 class="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl">Paku biiti</h1>
|
||||||
<p class="text-xl text-muted-foreground">
|
<p class="text-xl text-muted-foreground">
|
||||||
Lohista kokku õiged albumi <span class="text-orange-400">nimed</span>,
|
Lohista kokku õiged albumi <span class="text-orange-400">nimed</span>,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { Separator } from '$lib/components/ui/separator/index.js';
|
||||||
import LoaderCircle from 'lucide-svelte/icons/loader-circle';
|
import LoaderCircle from 'lucide-svelte/icons/loader-circle';
|
||||||
import { Button } from '$lib/components/ui/button/index.js';
|
import { Button } from '$lib/components/ui/button/index.js';
|
||||||
import * as AlertDialog from '$lib/components/ui/alert-dialog/index.js';
|
import * as AlertDialog from '$lib/components/ui/alert-dialog/index.js';
|
||||||
|
@ -55,7 +56,7 @@
|
||||||
</AlertDialog.Title>
|
</AlertDialog.Title>
|
||||||
<AlertDialog.Description>
|
<AlertDialog.Description>
|
||||||
{#if data.stage === 0}
|
{#if data.stage === 0}
|
||||||
Valus. <strong>põrusid esimesel katsel.</strong>
|
Põrusid esimesel katsel.
|
||||||
{:else}
|
{:else}
|
||||||
Vastasid õigesti <strong>{data.stage} korda.</strong>
|
Vastasid õigesti <strong>{data.stage} korda.</strong>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -73,21 +74,22 @@
|
||||||
action="?/submit"
|
action="?/submit"
|
||||||
method="POST"
|
method="POST"
|
||||||
use:enhance
|
use:enhance
|
||||||
class="grid w-full gap-8 px-8 transition-all {loading || data?.playing === false
|
class="grid w-full gap-6 px-8 transition-all {loading || data?.playing === false
|
||||||
? 'grayscale'
|
? 'grayscale'
|
||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
{#if data?.streamed?.albums}
|
{#if data?.streamed?.albums}
|
||||||
{#await data.streamed.albums}
|
{#await data.streamed.albums}
|
||||||
{#each { length: 2 } as _}
|
{#each { length: 2 } as _}
|
||||||
<section class="grid grid-cols-3 items-center gap-16">
|
<section class="grid grid-cols-3 items-center gap-14">
|
||||||
{#each { length: 3 } as _}
|
{#each { length: 3 } as _}
|
||||||
<Skeleton class="h-[6rem] w-full rounded-xl " />
|
<Skeleton class="h-[6rem] w-full rounded-xl " />
|
||||||
{/each}
|
{/each}
|
||||||
</section>
|
</section>
|
||||||
|
<Separator />
|
||||||
{/each}
|
{/each}
|
||||||
|
|
||||||
<section class="grid grid-cols-3 items-center gap-16">
|
<section class="grid grid-cols-3 items-center gap-14">
|
||||||
{#each { length: 3 } as _}
|
{#each { length: 3 } as _}
|
||||||
<Skeleton class="aspect-square h-auto max-w-full rounded-xl object-cover" />
|
<Skeleton class="aspect-square h-auto max-w-full rounded-xl object-cover" />
|
||||||
{/each}
|
{/each}
|
||||||
|
@ -96,14 +98,18 @@
|
||||||
{@render footer(true)}
|
{@render footer(true)}
|
||||||
{:then albums}
|
{:then albums}
|
||||||
<DndGroup items={albums.names} type="names"></DndGroup>
|
<DndGroup items={albums.names} type="names"></DndGroup>
|
||||||
|
<Separator />
|
||||||
<DndGroup items={albums.artists} type="artists"></DndGroup>
|
<DndGroup items={albums.artists} type="artists"></DndGroup>
|
||||||
|
<Separator />
|
||||||
<DndGroup items={albums.images} image type="images"></DndGroup>
|
<DndGroup items={albums.images} image type="images"></DndGroup>
|
||||||
|
|
||||||
{@render footer(false)}
|
{@render footer(false)}
|
||||||
{/await}
|
{/await}
|
||||||
{:else}
|
{:else}
|
||||||
<DndGroup items={oldAlbums.names} type="names"></DndGroup>
|
<DndGroup items={oldAlbums.names} type="names"></DndGroup>
|
||||||
|
<Separator />
|
||||||
<DndGroup items={oldAlbums.artists} type="artists"></DndGroup>
|
<DndGroup items={oldAlbums.artists} type="artists"></DndGroup>
|
||||||
|
<Separator />
|
||||||
<DndGroup items={oldAlbums.images} image type="images"></DndGroup>
|
<DndGroup items={oldAlbums.images} image type="images"></DndGroup>
|
||||||
|
|
||||||
{@render footer(false)}
|
{@render footer(false)}
|
||||||
|
|
Loading…
Add table
Reference in a new issue