PageSourceSearch

https://portfolio.gateaux-09suntan.workers.dev/mockup-swipe-forward.js?v=1

js portfolio.gateaux-09suntan.workers.dev collected 2026-10-03 08:09:33 UTC 1,599 bytes, 1 lines download raw bytes

1const PAN_START_PX=6,SWIPE_COMMIT_PX=14,VELOCITY_SAMPLE_MS=100,MOMENTUM_FRICTION=.95,MOMENTUM_MIN_PX_PER_FRAME=.2;function attach(n,c){let l=null,f=0,d=0,_=0,m=0,i=!1,e=[],s=null;const L=()=>{s!==null&&(cancelAnimationFrame(s),s=null)};n.addEventListener("touchstart",r=>{if(L(),r.touches.length!==1){l=null;return}const t=r.touches[0];l=t.identifier,f=m=t.clientX,d=t.clientY,_=c.scrollLeft,i=!1,e=[{t:performance.now(),x:t.clientX}]},{passive:!0}),n.addEventListener("touchmove",r=>{if(l===null)return;let t=null;for(const o of r.touches)if(o.identifier===l){t=o;break}if(!t)return;const u=t.clientX-f,a=t.clientY-d;if(!i&&Math.abs(u)>6&&Math.abs(u)>Math.abs(a)&&(i=!0),i){c.scrollLeft=_-u,r.preventDefault();const o=performance.now();for(e.push({t:o,x:t.clientX});e.length>1&&o-e[0].t>100;)e.shift();m=t.clientX}},{passive:!1});const E=()=>{const r=m-f;if(i&&Math.abs(r)>14){const u=a=>{a.preventDefault(),a.stopImmediatePropagation()};if(n.addEventListener("click",u,{capture:!0,once:!0}),setTimeout(()=>{n.removeEventListener("click",u,{capture:!0})},500),e.length>=2){const a=e[0],o=e[e.length-1],h=o.t-a.t;if(h>0){let M=-((o.x-a.x)/h)*16;const P=()=>{if(Math.abs(M)<.2){s=null;return}const p=c.scrollLeft;if(c.scrollLeft=p+M,c.scrollLeft===p){s=null;return}M*=.95,s=requestAnimationFrame(P)};s=requestAnimationFrame(P)}}}l=null,i=!1,e=[]};n.addEventListener("touchend",E),n.addEventListener("touchcancel",E)}for(const n of document.querySelectorAll(".case-mockup-wrap")){const c=n.querySelector(":scope > .case-mockup-scroll"),l=n.querySelector(":scope > .mockup--mobile");c&&l&&attach(l,c)}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.