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"
import { sineIn } from "svelte/easing"
import { UIEventSource } from "../../Logic/UIEventSource.js"
export let shown: UIEventSource<boolean>;
let transitionParams = {
x: -320,
duration: 200,
easing: sineIn
};
2024-08-29 03:53:54 +02:00
let hidden = !shown.data
$: {
shown.setData(!hidden)
}
shown.addCallback(sh => {
hidden = !sh
})
</script>
2024-08-29 03:53:54 +02:00
<Drawer placement="left"
transitionType="fly" {transitionParams}
divClass = "overflow-y-auto z-50 "
bind:hidden={hidden}>
<slot>
CONTENTS
</slot>
</Drawer>