UNPKG

@tindtechnologies/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

2 lines (1 loc) 554 B
import{b as c}from"./chunk-V63MGAWK.js";import"./chunk-L67DAW3A.js";var y=function(i,l,d,h,m){var o=i.ownerDocument.defaultView,f=function(r){return r.startX<=50&&l()},p=function(r){var a=r.deltaX,e=a/o.innerWidth;h(e)},w=function(r){var a=r.deltaX,e=o.innerWidth,t=a/e,n=r.velocityX,g=e/2,v=n>=0&&(n>.2||r.deltaX>g),X=v?1-t:t,s=X*e,u=0;if(s>5){var M=s/Math.abs(n);u=Math.min(M,540)}m(v,t<=0?.01:t,u)};return c({el:i,gestureName:"goback-swipe",gesturePriority:40,threshold:10,canStart:f,onStart:d,onMove:p,onEnd:w})};export{y as createSwipeBackGesture};