Skip to content
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

Open
nikolai-cc opened this issue Jul 18, 2022 · 8 comments
Open

Add actions #4

nikolai-cc opened this issue Jul 18, 2022 · 8 comments
Labels
💻 feat (CSI voice) "Enhance!"

Comments

@nikolai-cc
Copy link
Owner

transform actions (from svelte-transform lib)
lazyload (but good)
pannable / touch actions
scrolldrag (for horizontal scrolling on carousels)
dnd (dragging between multiple containers)

@nikolai-cc nikolai-cc added the 💻 feat (CSI voice) "Enhance!" label Jul 18, 2022
@MathiasWP
Copy link
Contributor

MathiasWP commented Jul 20, 2022

focus-within (do something with JS when the element meets the requirement of CSS's focus-within)
scroll-into-view (scroll an element into view when a condition is true)

@cesarpe
Copy link

cesarpe commented Jun 26, 2024

Hello Nikolai, could you create some function to rotate, such as resize and draggable. Good job

@cesarpe
Copy link

cesarpe commented Jun 26, 2024

Is there a way to place the draggable windows on top of each other to be selected?

@nikolai-cc
Copy link
Owner Author

Hi @cesarpe, I added a rotatable action in v0.3.8!
It works similar to resizable and draggable.

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.)

@cesarpe
Copy link

cesarpe commented Jul 16, 2024

Hola@cesarpe¡Agregué una acción rotatoria en la versión 0.3.8! Funciona de manera similar a la acción redimensionable y arrastrable.

No estoy 100% seguro de lo que quieres decir con tu segunda pregunta, pero existen múltiples estrategias para gestionar el orden de los componentes arrastrables. Suponiendo que utilices una matriz para representar las ventanas en primer lugar, la forma más sencilla sería simplemente reconstruir la matriz.

Vea un ejemplo que muestra tanto el nuevo componente rotatorio como la estrategia de ordenamiento en esta réplica . (Tenga en cuenta que este es un ejemplo simplificado. Tenga en cuenta el rendimiento si su situación es más compleja).

Thank you very much Nicolai, it's just what I need 👍

@cesarpe
Copy link

cesarpe commented Sep 17, 2024

Hi Nicolai,
How can I resize the window (div) of the example you created above (something like this https://svelte.dev/repl/52e662d6220d447495be8cd8851322b9?version=4.2.19 ), I have tried to change it but the result is not good.
ups... I found a way to do it
with resizable

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>

@nikolai-cc
Copy link
Owner Author

Perfect! Yes it is indeed as easy as adding use:resizable. I changed the previous repl to do that here in this repl.

@cesarpe
Copy link

cesarpe commented Sep 19, 2024

¡Perfecto! Sí, es tan fácil como agregar use:resizable. Cambié la respuesta anterior para hacer eso aquí en esta respuesta .

You are the best, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💻 feat (CSI voice) "Enhance!"
Projects
None yet
Development

No branches or pull requests

3 participants