MapComplete/src/UI/Base/DrawerLeft.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
610 B
Svelte
Raw Normal View History

<script lang="ts">
import { Drawer } from "flowbite-svelte"
2024-11-26 20:15:41 +01:00
import { cubicInOut } from "svelte/easing"
import { UIEventSource } from "../../Logic/UIEventSource.js"
2024-09-02 12:48:15 +02:00
export let shown: UIEventSource<boolean>
let transitionParams = {
x: -320,
duration: 200,
2024-11-26 20:15:41 +01:00
easing: cubicInOut,
2024-09-02 12:48:15 +02:00
}
2024-08-29 03:53:54 +02:00
let hidden = !shown.data
$: {
shown.setData(!hidden)
}
2024-09-02 12:48:15 +02:00
shown.addCallback((sh) => {
2024-08-29 03:53:54 +02:00
hidden = !sh
})
</script>
2024-09-02 12:48:15 +02:00
<Drawer
placement="left"
transitionType="fly"
{transitionParams}
bgColor="frozen-glass"
2024-09-02 12:48:15 +02:00
divClass="overflow-y-auto z-50 "
bind:hidden
>
<slot>CONTENTS</slot>
</Drawer>