This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
JT DiMartile
Posted Jan 28 - Read on Facebook

Has anyone made a prototype where a draggable's movement is varied based on the inputs acceleration/velocity. For instance, the apple track pad works like this... slow movements move the mouse arrow slower, and fast movements move it further. I know there is speed and velocity in the draggable class but when I try to tie the speed to the velocity in various ways I get super weird results.

6 Comments

Marc Krenn

As far as I know, on-the-fly speed-changes aren't possible yet, but there's a PR by Paul Mandel addressing this very problem:

https://github.com/koenbok/Framer/pull/149

JT DiMartile

Hmmmmmmmmm, OK thanks Marc Krenn

Koen Bok

I'll see if I can sneak this into the next beta.

JT DiMartile

That would be awesome, thanks!

JT DiMartile

So i have an if then that is checking the velocity, and adjusting the speed. The problem (as you smarter people probably already know) is when you go from slow, to fast, to slow within the same drag event. Is there a way for me to, within the same drag event, manually fire a drag end and then a drag start to reset that initial position?

JT DiMartile

alright so I solved this with a pretty hacky workaround where it uses a smaller speedX value initially but once it triggers the speedX=1 it sets a flag and wont let it go back to the smaller amount until the next drag triggers

Read the entire post on Facebook