MapComplete/src/UI/Base/DrawerLeft.svelte

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

30 lines
577 B
Svelte
Raw Normal View History

<script lang="ts">
import { Drawer } from "flowbite-svelte"
import { sineIn } 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-09-02 12:48:15 +02:00
easing: sineIn,
}
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}
divClass="overflow-y-auto z-50 "
bind:hidden
>
<slot>CONTENTS</slot>
</Drawer>