-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add actions #4
Comments
focus-within (do something with JS when the element meets the requirement of CSS's |
Hello Nikolai, could you create some function to rotate, such as resize and draggable. Good job |
Is there a way to place the draggable windows on top of each other to be selected? |
Hi @cesarpe, I added a rotatable action in v0.3.8! I'm not 100% sure what you mean by your second question, but there are multiple strategies to manage draggable component ordering. Assuming you use an array to render the windows in the first place, the simplest way would be to simply rebuild the array. See an example showing both the new rotatable component and the ordering strategy in this repl. (Keep in mind that this is a simplified example. Take performance into account if your situation is more complex.) |
Thank you very much Nicolai, it's just what I need 👍 |
Hi Nicolai, import { draggable, rotatable, resizable } from 'svu/action'
...
<div id={id} class="divi" on:pointerdown
style="top: {top}px; left: {left}px; height:{height}px; width:{width}px;"
use:draggable={{ handle: dragHandle }}
use:rotatable={{ handle: rotateHandle }}
use:resizable >
<header bind:this={dragHandle} />
<slot />
<span bind:this={rotateHandle} />
</div> |
Perfect! Yes it is indeed as easy as adding |
You are the best, thank you very much. |
transform actions (from svelte-transform lib)
lazyload (but good)
pannable / touch actions
scrolldrag (for horizontal scrolling on carousels)
dnd (dragging between multiple containers)
The text was updated successfully, but these errors were encountered: