#Is there any way to distinguish swip/drag directions?
41 messages · Page 1 of 1 (latest)
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
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.
So he is not doing half half but does also do some frames on top though (2, btu they take up the whole space). The trick might be in the adding push to it
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
Ill do a quick test when i get on a computer. 👍
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
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.
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
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
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?
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
Why are you using smart animate instead of push?
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.
Yeah so it should still work for that too. In my example i moved the whole page up or down, but i could have also selected just a small part to be moved on drag
If you check the youtube video, in that too they were just moving cards (not the page itself)
Yeah it can just change whatever you want to move!
this is updated too with similar stuff as you wanted!
👍 this is exactly what i wanted. Thank you again