introduce a threshold that has to be crossed to flip page

Hi!
For a project I needed the ability to cancel the sliding if the movement was small. Feel free to add it or tell me how to change it.

Best,
Marten

PS: add ?w=1 to the url to only see the actual changes