huntabyte / vaul-svelte

An unstyled drawer component for Svelte.
https://vaul-svelte.com
MIT License
467 stars 19 forks source link

Is there a way to subscribe to the drawer's closed percentage? #76

Closed RickRyan26 closed 6 months ago

RickRyan26 commented 7 months ago

Describe the feature in detail (code, mocks, or screenshots encouraged)

The scale background feature transition is absolutely beautiful and it's based on the drawer's closed percentage, but my app has a different glowy effect that appears when the drawer is open and disappears when it's closed. I have it running with a simple svelte transition:fade but that's not nearly as cool as what you have setup. I'd love to have the opacity react with the drawer's percentage closed but can't figure it out for the life of me. Is there any way to bind to this variable or a hacky solution of any kind?

I would greatly appreciate a push in the right direction.

Thank you for this amazing package 😀

What type of pull request would this be?

Docs

Provide relevant links or additional information.

No response

RickRyan26 commented 6 months ago

Found it!

onDrag={(e, num) => console.warn(num)}