Skip to content

Commit 6a39a4c

Browse files
committed
more tweaks to the non stable badge
1 parent ec0f2ee commit 6a39a4c

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

src/routes/scripts/ScriptHeader.svelte

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import UUID from "$lib/components/UUID.svelte"
33
import type { TScriptStages } from "$lib/types/collection"
44
import { scriptStages } from "$lib/utils"
5+
import { Portal, Tooltip } from "@skeletonlabs/skeleton-svelte"
56
import StatsHeader from "./StatsHeader.svelte"
67
78
const data = $props()
@@ -29,11 +30,25 @@
2930
{/if}
3031
</h1>
3132
{#if stage !== "stable"}
32-
<div
33-
class="z-1 mx-auto my-4 w-fit cursor-default rounded-md preset-outlined-surface-600-400 preset-filled-surface-500 px-4 py-2 hover:preset-tonal"
34-
>
35-
{scriptStages[stage].icon + scriptStages[stage].name}
36-
</div>
33+
<Tooltip positioning={{ placement: "bottom" }}>
34+
<Tooltip.Trigger
35+
class="mx-auto my-2 w-fit cursor-default rounded-md preset-outlined-surface-600-400 preset-filled-surface-500 px-2 py-1 hover:preset-tonal"
36+
>
37+
{scriptStages[stage].icon + scriptStages[stage].name}
38+
</Tooltip.Trigger>
39+
<Portal>
40+
<Tooltip.Positioner>
41+
<Tooltip.Content class="card preset-filled-surface-950-50 p-2">
42+
<span>This script is in <b>{scriptStages[stage].name}</b> and might not be stable!</span>
43+
<Tooltip.Arrow
44+
class="[--arrow-background:var(--color-surface-950-50)] [--arrow-size:--spacing(2)]"
45+
>
46+
<Tooltip.ArrowTip />
47+
</Tooltip.Arrow>
48+
</Tooltip.Content>
49+
</Tooltip.Positioner>
50+
</Portal>
51+
</Tooltip>
3752
{/if}
3853
<h2 class="my-4">
3954
{description ?? "Loading..."}

0 commit comments

Comments
 (0)