mirror of
https://github.com/open-webui/open-webui
synced 2025-05-20 13:15:13 +00:00
refac: sidebar component
This commit is contained in:
parent
8ad1aa3c2e
commit
db6858582f
@ -7,6 +7,7 @@
|
|||||||
export let width = '200px';
|
export let width = '200px';
|
||||||
|
|
||||||
export let className = '';
|
export let className = '';
|
||||||
|
export let duration = 100;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if show}
|
{#if show}
|
||||||
@ -16,12 +17,12 @@
|
|||||||
on:mousedown={() => {
|
on:mousedown={() => {
|
||||||
show = false;
|
show = false;
|
||||||
}}
|
}}
|
||||||
transition:fade
|
transition:fade={{ duration: duration }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="absolute z-30 shadow-xl {side === 'right' ? 'right-0' : 'left-0'} top-0 bottom-0"
|
class="absolute z-30 shadow-xl {side === 'right' ? 'right-0' : 'left-0'} top-0 bottom-0"
|
||||||
transition:slide={{ easing: quadInOut, axis: side === 'right' ? 'x' : 'y' }}
|
transition:slide={{ duration: duration, easing: quadInOut, axis: side === 'right' ? 'x' : 'y' }}
|
||||||
>
|
>
|
||||||
<div class="{className} h-full" style="width: {show ? width : '0px'}">
|
<div class="{className} h-full" style="width: {show ? width : '0px'}">
|
||||||
<slot />
|
<slot />
|
||||||
|
Loading…
Reference in New Issue
Block a user