@larva.io/webcomponents
Version:
Fentrica SmartUnits WebComponents package
5 lines • 723 B
JavaScript
/*!
* (C) Fentrica http://fentrica.com - Seee LICENSE.md
*/
import{d as t}from"./p-ue25B_tw.js";import{createGesture as o}from"./p-Bg81B2hG.js";const s=(s,n,c,e,r)=>{const a=s.ownerDocument.defaultView;const i=t=>t.startX<=5e3&&n();const p=t=>{const o=t.deltaX;const s=o/a.innerWidth;e(s)};const h=o=>{const s=o.deltaX;const n=a.innerWidth;const c=s/n;const e=o.velocityX;const i=n/2;const p=e>=0&&(e>.2||o.deltaX>i);const h=p?1-c:c;const m=h*n;let g=0;if(m>5){const t=m/Math.abs(e);g=Math.min(t,540)}r(p,c<=0?.01:t(0,c,.9999),g)};return o({el:s,gestureName:"goback-swipe",gesturePriority:40,threshold:10,canStart:i,onStart:c,onMove:p,onEnd:h})};export{s as createSwipeBackGesture};
//# sourceMappingURL=p-mACfXVy4.js.map