#Is there any way to distinguish swip/drag directions?

41 messages · Page 1 of 1 (latest)

olive lintel
#

Seems like "on drag" only checks if you dragged, but wouldn't let you navigate to different screens based on whether you swiped up or down.

quasi brook
#

Hey @olive lintel ! It is def tricky to figure it out, but its actually doable! I learned how to do it through this video:

https://www.youtube.com/watch?v=77kw_TPQm98

I think this explains it better than i could haha

olive lintel
#

Thanks @quasi brook I'll check it out. Still don't quite understand how the 2 identical layers with "on drag" interaction decide which would respond to my swiping. Was it the animation setting?

#

The hack I'm currently doing is having 2 rectangles, each cover half of the screen. I'm assuming if the user start the swipe from the bottom they are trying to swip up.

quasi brook
#

so for you it would be up or down

#

instead of left to right

#

idk if thats all what he does though (i last did this like 2 yrs ago and thats when i watched this too lol but it worked!)

#

rn just skimming through it seems liek it might be about the push thing, but i would suggest to watch it

olive lintel
#

Ill do a quick test when i get on a computer. 👍

quasi brook
#

yeah lmk if it works!

#

@olive lintel yeah the trick is just the push! I just tried it out

#

here is the file, should have editing access

#

and i have all the move-up or move-downs as the full width and height of the frame, so no half-halfs

olive lintel
#

Thank you so much @quasi brook I also tried. It works with move in /slide in etc as well. Unfortunately it doesnt work with smart animate.

#

This is what im working on. I guess this push method wont work for me. But its definitely a good trick to learn.

quasi brook
#

Hmm i might would just do it on the moving parts as component variants to go up and down

#

and then create a local variable

#

that is also being updated, and based on that the background could change

olive lintel
#

Ill explore that. Btw is there any way to switch mode by clicking on a button? Like switching between light/dark theme on the fly

quasi brook
#

I think you can also do that with local variants!

#

Where you have a boolean local variant eg (is-light) or it can be a text variant (mode), and then when clicking the button the action would be to set the variant to the appropriate one

#

you can use conditional logic, where you do something like if mode == light then change the mode to dark, else change the mode to light

#

(or if is-light is true then set it to false, else set it to true)

#

also does the animate matching layers not work for smart animate?

olive lintel
#

I mean it rely on the direction you choose to know which type of swip to detect. If i have 2 rectangles with smart animate instead of push, ill always go to the same screen regardless if i swipped up or down

#

Matching layer is not the issue

quasi brook
#

Why are you using smart animate instead of push?

olive lintel
#

If you look at the video i shared. Im not moving things up and down. The text and nav stay in the same spot. The colored ovals would just rotate.

quasi brook
#

If you check the youtube video, in that too they were just moving cards (not the page itself)

olive lintel
#

Ah let me check again.

#

Wow you are right!

quasi brook
#

Yeah it can just change whatever you want to move!

#

this is updated too with similar stuff as you wanted!

olive lintel
#

👍 this is exactly what i wanted. Thank you again