p-7d99f5f4.js 542 字节
Newer Older
1
import{i as t}from"./p-5a5a5c96.js";import{createGesture as o}from"./p-101feae9.js";import"./p-8fc9298a.js";const r=(r,e,a,s,n)=>{const c=r.ownerDocument.defaultView;return o({el:r,gestureName:"goback-swipe",gesturePriority:40,threshold:10,canStart:t=>t.startX<=50&&e(),onStart:a,onMove:t=>{s(t.deltaX/c.innerWidth)},onEnd:o=>{const r=c.innerWidth,e=o.deltaX/r,a=o.velocityX,s=a>=0&&(a>.2||o.deltaX>r/2),i=(s?1-e:e)*r;let p=0;if(i>5){const t=i/Math.abs(a);p=Math.min(t,540)}n(s,e<=0?.01:t(0,e,.9999),p)}})};export{r as createSwipeBackGesture}