PageSourceSearch

https://alanneale.com/assets/js/chunk-T2VBYGQ5.mjs

js alanneale.com collected 2026-10-09 22:38:39 UTC 16,656 bytes, 2 lines download raw bytes

1import{$ as P,Y as q,ha as B,k as E,p as Y,t as I}from"./chunk-ZYVAFLF3.mjs";import{c as h}from"./chunk-A3IIQ6X3.mjs";function $(f,t,e){return Math.max(f,Math.min(t,e))}var C=class{constructor(){this.isRunning=!1,this.value=0,this.from=0,this.to=0,this.duration=0,this.currentTime=0}advance(t){var e;if(!this.isRunning)return;let i=!1;if(this.duration&&this.easing){this.currentTime+=t;let r=$(0,this.currentTime/this.duration,1);i=r>=1;let n=i?1:this.easing(r);this.value=this.from+(this.to-this.from)*n}else this.lerp?(this.value=function(n,s,o,l){return function(u,c,d){return(1-d)*u+d*c}(n,s,1-Math.exp(-o*l))}(this.value,this.to,60*this.lerp,t),Math.round(this.value)===this.to&&(this.value=this.to,i=!0)):(this.value=this.to,i=!0);i&&this.stop(),(e=this.onUpdate)===null||e===void 0||e.call(this,this.value,i)}stop(){this.isRunning=!1}fromTo(t,e,{lerp:i,duration:r,easing:n,onStart:s,onUpdate:o}){this.from=this.value=t,this.to=e,this.lerp=i,this.duration=r,this.easing=n,this.currentTime=0,this.isRunning=!0,s?.(),this.onUpdate=o}},D=class{constructor({wrapper:t,content:e,autoResize:i=!0,debounce:r=250}={}){this.width=0,this.height=0,this.scrollWidth=0,this.scrollHeight=0,this.resize=()=>{this.onWrapperResize(),this.onContentResize()},this.onWrapperResize=()=>{this.wrapper===h?(this.width=h.innerWidth,this.height=h.innerHeight):this.wrapper instanceof HTMLElement&&(this.width=this.wrapper.clientWidth,this.height=this.wrapper.clientHeight)},this.onContentResize=()=>{this.wrapper===h?(this.scrollHeight=this.content.scrollHeight,this.scrollWidth=this.content.scrollWidth):this.wrapper instanceof HTMLElement&&(this.scrollHeight=this.wrapper.scrollHeight,this.scrollWidth=this.wrapper.scrollWidth)},this.wrapper=t,this.content=e,i&&(this.debouncedResize=function(s,o){let l;return function(){let a=arguments,u=this;clearTimeout(l),l=setTimeout(function(){s.apply(u,a)},o)}}(this.resize,r),this.wrapper===h?h.addEventListener("resize",this.debouncedResize,!1):(this.wrapperResizeObserver=new ResizeObserver(this.debouncedResize),this.wrapperResizeObserver.observe(this.wrapper)),this.contentResizeObserver=new ResizeObserver(this.debouncedResize),this.contentResizeObserver.observe(this.content)),this.resize()}destroy(){var t,e;(t=this.wrapperResizeObserver)===null||t===void 0||t.disconnect(),(e=this.contentResizeObserver)===null||e===void 0||e.disconnect(),h.removeEventListener("resize",this.debouncedResize,!1)}get limit(){return{x:this.scrollWidth-this.width,y:this.scrollHeight-this.height}}},M=class{constructor(){this.events={}}emit(t,...e){let i=this.events[t]||[];for(let r=0,n=i.length;r<n;r++)i[r](...e)}on(t,e){var i;return!((i=this.events[t])===null||i===void 0)&&i.push(e)||(this.events[t]=[e]),()=>{var r;this.events[t]=(r=this.events[t])===null||r===void 0?void 0:r.filter(n=>e!==n)}}off(t,e){var i;this.events[t]=(i=this.events[t])===null||i===void 0?void 0:i.filter(r=>e!==r)}destroy(){this.events={}}},j=100/6,O=class{constructor(t,{wheelMultiplier:e=1,touchMultiplier:i=1}){this.lastDelta={x:0,y:0},this.windowWidth=0,this.windowHeight=0,this.onTouchStart=r=>{let{clientX:n,clientY:s}=r.targetTouches?r.targetTouches[0]:r;this.touchStart.x=n,this.touchStart.y=s,this.lastDelta={x:0,y:0},this.emitter.emit("scroll",{deltaX:0,deltaY:0,event:r})},this.onTouchMove=r=>{var n,s,o,l;let{clientX:a,clientY:u}=r.targetTouches?r.targetTouches[0]:r,c=-(a-((s=(n=this.touchStart)===null||n===void 0?void 0:n.x)!==null&&s!==void 0?s:0))*this.touchMultiplier,d=-(u-((l=(o=this.touchStart)===null||o===void 0?void 0:o.y)!==null&&l!==void 0?l:0))*this.touchMultiplier;this.touchStart.x=a,this.touchStart.y=u,this.lastDelta={x:c,y:d},this.emitter.emit("scroll",{deltaX:c,deltaY:d,event:r})},this.onTouchEnd=r=>{this.emitter.emit("scroll",{deltaX:this.lastDelta.x,deltaY:this.lastDelta.y,event:r})},this.onWheel=r=>{let{deltaX:n,deltaY:s,deltaMode:o}=r;n*=o===1?j:o===2?this.windowWidth:1,s*=o===1?j:o===2?this.windowHeight:1,n*=this.wheelMultiplier,s*=this.wheelMultiplier,this.emitter.emit("scroll",{deltaX:n,deltaY:s,event:r})},this.onWindowResize=()=>{this.windowWidth=h.innerWidth,this.windowHeight=h.innerHeight},this.element=t,this.wheelMultiplier=e,this.touchMultiplier=i,this.touchStart={x:null,y:null},this.emitter=new M,h.addEventListener("resize",this.onWindowResize,!1),this.onWindowResize(),this.element.addEventListener("wheel",this.onWheel,{passive:!1}),this.element.addEventListener("touchstart",this.onTouchStart,{passive:!1}),this.element.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.element.addEventListener("touchend",this.onTouchEnd,{passive:!1})}on(t,e){return this.emitter.on(t,e)}destroy(){this.emitter.destroy(),h.removeEventListener("resize",this.onWindowResize,!1),this.element.removeEventListener("wheel",this.onWheel),this.element.removeEventListener("touchstart",this.onTouchStart),this.element.removeEventListener("touchmove",this.onTouchMove),this.element.removeEventListener("touchend",this.onTouchEnd)}},L=class{constructor({wrapper:t=h,content:e=document.documentElement,wheelEventsTarget:i=t,eventsTarget:r=i,smoothWheel:n=!0,syncTouch:s=!1,syncTouchLerp:o=.075,touchInertiaMultiplier:l=35,duration:a,easing:u=g=>
1Math.min(1,1.001-Math.pow(2,-10*g)),lerp:c=.1,infinite:d=!1,orientation:m="vertical",gestureOrientation:S="vertical",touchMultiplier:_=1,wheelMultiplier:F=1,autoResize:U=!0,prevent:K,virtualScroll:G,__experimental__naiveDimensions:J=!1}={}){this.__isScrolling=!1,this.__isStopped=!1,this.__isLocked=!1,this.userData={},this.lastVelocity=0,this.velocity=0,this.direction=0,this.onPointerDown=g=>{g.button===1&&this.reset()},this.onVirtualScroll=g=>{if(typeof this.options.virtualScroll=="function"&&this.options.virtualScroll(g)===!1)return;let{deltaX:y,deltaY:w,event:p}=g;if(this.emitter.emit("virtual-scroll",{deltaX:y,deltaY:w,event:p}),p.ctrlKey)return;let T=p.type.includes("touch"),A=p.type.includes("wheel");if(this.isTouching=p.type==="touchstart"||p.type==="touchmove",this.options.syncTouch&&T&&p.type==="touchstart"&&!this.isStopped&&!this.isLocked)return void this.reset();let Q=y===0&&w===0,Z=this.options.gestureOrientation==="vertical"&&w===0||this.options.gestureOrientation==="horizontal"&&y===0;if(Q||Z)return;let z=p.composedPath();z=z.slice(0,z.indexOf(this.rootElement));let N=this.options.prevent;if(z.find(v=>{var R,W,H,x,k;return v instanceof Element&&(typeof N=="function"&&N?.(v)||((R=v.hasAttribute)===null||R===void 0?void 0:R.call(v,"data-lenis-prevent"))||T&&((W=v.hasAttribute)===null||W===void 0?void 0:W.call(v,"data-lenis-prevent-touch"))||A&&((H=v.hasAttribute)===null||H===void 0?void 0:H.call(v,"data-lenis-prevent-wheel"))||((x=v.classList)===null||x===void 0?void 0:x.contains("lenis"))&&!(!((k=v.classList)===null||k===void 0)&&k.contains("lenis-stopped")))}))return;if(this.isStopped||this.isLocked)return void p.preventDefault();if(!(this.options.syncTouch&&T||this.options.smoothWheel&&A))return this.isScrolling="native",void this.animate.stop();p.preventDefault();let b=w;this.options.gestureOrientation==="both"?b=Math.abs(w)>Math.abs(y)?w:y:this.options.gestureOrientation==="horizontal"&&(b=y);let tt=T&&this.options.syncTouch,X=T&&p.type==="touchend"&&Math.abs(b)>5;X&&(b=this.velocity*this.options.touchInertiaMultiplier),this.scrollTo(this.targetScroll+b,Object.assign({programmatic:!1},tt?{lerp:X?this.options.syncTouchLerp:1}:{lerp:this.options.lerp,duration:this.options.duration,easing:this.options.easing}))},this.onNativeScroll=()=>{if(clearTimeout(this.__resetVelocityTimeout),delete this.__resetVelocityTimeout,this.__preventNextNativeScrollEvent)delete this.__preventNextNativeScrollEvent;else if(this.isScrolling===!1||this.isScrolling==="native"){let g=this.animatedScroll;this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity,this.velocity=this.animatedScroll-g,this.direction=Math.sign(this.animatedScroll-g),this.isScrolling="native",this.emit(),this.velocity!==0&&(this.__resetVelocityTimeout=setTimeout(()=>{this.lastVelocity=this.velocity,this.velocity=0,this.isScrolling=!1,this.emit()},400))}},h.lenisVersion="1.1.9",t&&t!==document.documentElement&&t!==document.body||(t=h),this.options={wrapper:t,content:e,wheelEventsTarget:i,eventsTarget:r,smoothWheel:n,syncTouch:s,syncTouchLerp:o,touchInertiaMultiplier:l,duration:a,easing:u,lerp:c,infinite:d,gestureOrientation:S,orientation:m,touchMultiplier:_,wheelMultiplier:F,autoResize:U,prevent:K,virtualScroll:G,__experimental__naiveDimensions:J},this.animate=new C,this.emitter=new M,this.dimensions=new D({wrapper:t,content:e,autoResize:U}),this.updateClassName(),this.userData={},this.time=0,this.velocity=this.lastVelocity=0,this.isLocked=!1,this.isStopped=!1,this.isScrolling=!1,this.targetScroll=this.animatedScroll=this.actualScroll,this.options.wrapper.addEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.addEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll=new O(r,{touchMultiplier:_,wheelMultiplier:F}),this.virtualScroll.on("scroll",this.onVirtualScroll)}destroy(){this.emitter.destroy(),this.options.wrapper.removeEventListener("scroll",this.onNativeScroll,!1),this.options.wrapper.removeEventListener("pointerdown",this.onPointerDown,!1),this.virtualScroll.destroy(),this.dimensions.destroy(),this.cleanUpClassName()}on(t,e){return this.emitter.on(t,e)}off(t,e){return this.emitter.off(t,e)}setScroll(t){this.isHorizontal?this.rootElement.scrollLeft=t:this.rootElement.scrollTop=t}resize(){this.dimensions.resize()}emit(){this.emitter.emit("scroll",this)}reset(){this.isLocked=!1,this.isScrolling=!1,this.animatedScroll=this.targetScroll=this.actualScroll,this.lastVelocity=this.velocity=0,this.animate.stop()}start(){this.isStopped&&(this.isStopped=!1,this.reset())}stop(){this.isStopped||(this.isStopped=!0,this.animate.stop(),this.reset())}raf(t){let e=t-(this.time||t);this.time=t,this.animate.advance(.001*e)}scrollTo(t,{offset:e=0,immediate:i=!1,lock:r=!1,duration:n=this.options.duration,easing:s=this.options.easing,lerp:o=this.options.lerp,onStart:l,onComplete:a,force:u=!1,programmatic:c=!0,userData:d={}}={}){if(!this.isStopped&&!this.isLocked||u){if(typeof t=="string"&&["top","left","start"].includes(t))t=0;else if(typeof t=="string"&&["bottom","right","end"].includes(t))t=this.limit;else{let m;if(typeof t=="string"?m=document.querySelector(t):t instanceof HTMLElement&&t?.nodeType&&(m=t),m){if(this.options.wrapper!==h){let _=this.rootElement.getBoundingClientRect();e-=this.isHorizontal?_.left:_.top}let S=m.getBoundingClientRect();
1t=(this.isHorizontal?S.left:S.top)+this.animatedScroll}}if(typeof t=="number"&&(t+=e,t=Math.round(t),this.options.infinite?c&&(this.targetScroll=this.animatedScroll=this.scroll):t=$(0,t,this.limit),t!==this.targetScroll)){if(this.userData=d,i)return this.animatedScroll=this.targetScroll=t,this.setScroll(this.scroll),this.reset(),this.preventNextNativeScrollEvent(),this.emit(),a?.(this),void(this.userData={});c||(this.targetScroll=t),this.animate.fromTo(this.animatedScroll,t,{duration:n,easing:s,lerp:o,onStart:()=>{r&&(this.isLocked=!0),this.isScrolling="smooth",l?.(this)},onUpdate:(m,S)=>{this.isScrolling="smooth",this.lastVelocity=this.velocity,this.velocity=m-this.animatedScroll,this.direction=Math.sign(this.velocity),this.animatedScroll=m,this.setScroll(this.scroll),c&&(this.targetScroll=m),S||this.emit(),S&&(this.reset(),this.emit(),a?.(this),this.userData={},this.preventNextNativeScrollEvent())}})}}}preventNextNativeScrollEvent(){this.__preventNextNativeScrollEvent=!0,requestAnimationFrame(()=>{delete this.__preventNextNativeScrollEvent})}get rootElement(){return this.options.wrapper===h?document.documentElement:this.options.wrapper}get limit(){return this.options.__experimental__naiveDimensions?this.isHorizontal?this.rootElement.scrollWidth-this.rootElement.clientWidth:this.rootElement.scrollHeight-this.rootElement.clientHeight:this.dimensions.limit[this.isHorizontal?"x":"y"]}get isHorizontal(){return this.options.orientation==="horizontal"}get actualScroll(){return this.isHorizontal?this.rootElement.scrollLeft:this.rootElement.scrollTop}get scroll(){return this.options.infinite?function(e,i){return(e%i+i)%i}(this.animatedScroll,this.limit):this.animatedScroll}get progress(){return this.limit===0?1:this.scroll/this.limit}get isScrolling(){return this.__isScrolling}set isScrolling(t){this.__isScrolling!==t&&(this.__isScrolling=t,this.updateClassName())}get isStopped(){return this.__isStopped}set isStopped(t){this.__isStopped!==t&&(this.__isStopped=t,this.updateClassName())}get isLocked(){return this.__isLocked}set isLocked(t){this.__isLocked!==t&&(this.__isLocked=t,this.updateClassName())}get isSmooth(){return this.isScrolling==="smooth"}get className(){let t="lenis";return this.isStopped&&(t+=" lenis-stopped"),this.isLocked&&(t+=" lenis-locked"),this.isScrolling&&(t+=" lenis-scrolling"),this.isScrolling==="smooth"&&(t+=" lenis-smooth"),t}updateClassName(){this.cleanUpClassName(),this.rootElement.className=`${this.rootElement.className} ${this.className}`.trim()}cleanUpClassName(){this.rootElement.className=this.rootElement.className.replace(/lenis(-\w+)?/g,"").trim()}};function st(f){let{intensity:t}=f,e=Y(null);return E(()=>{if(e.current)try{e.current.scrollTo(0,{immediate:!0})}catch(i){console.error("Error scrolling to top:",i)}},[e]),E(()=>{let i=()=>{try{let s=document.querySelector("[data-frameruni-stop-scroll]"),o=document.documentElement,l=o&&o.style&&o.style.overflow==="hidden";e.current&&(s||l?e.current.stop():e.current.start())}catch(s){console.error("Error in checkForStopScroll:",s)}};i();let r,n;try{r=new MutationObserver(i),n=new MutationObserver(i),document&&document.documentElement&&(r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-frameruni-stop-scroll"]}),n.observe(document.documentElement,{attributes:!0,attributeFilter:["style"]}))}catch(s){console.error("Error setting up observers:",s)}return()=>{try{r&&r.disconnect(),n&&n.disconnect()}catch(s){console.error("Error disconnecting observers:",s)}}},[]),E(()=>{try{if(!document)return;let i=document.getElementsByTagName("*");for(let r=0;r<i.length;r++){let n=i[r];if(n)try{let s=h.getComputedStyle(n);s&&s.getPropertyValue("overflow")==="auto"&&n.setAttribute("data-lenis-prevent","true")}catch(s){console.error("Error getting computed style:",s)}}}catch(i){console.error("Error in overflow detection:",i)}},[]),E(()=>{try{if(typeof L!="function"){console.error("Lenis is not available");return}e.current=new L({duration:(t||10)/10});let i=n=>{if(e.current)try{e.current.raf(n),requestAnimationFrame(i)}catch(s){console.error("Error in animation frame:",s)}},r=requestAnimationFrame(i);return()=>{if(cancelAnimationFrame(r),e.current)try{e.current.destroy(),e.current=null}catch(n){console.error("Error destroying Lenis:",n)}}}catch(i){return console.error("Error initializing Lenis:",i),()=>{}}},[t]),E(()=>{try{if(!document||!e.current)return;let i=Array.from(document.querySelectorAll("a[href]")||[]).filter(s=>{if(!s)return!1;let o=s;if(!o.href)return!1;let l=o.href.startsWith(h.location.origin)||o.href.startsWith("./")||o.href.startsWith("/"),a=o.href.includes("#");return l&&a}).map(s=>{try{let o=s,l=o.href.includes("#")?`#${o.href.split("#").pop()}`:"",a=l?decodeURIComponent(l):"",u=0;try{if(a){let c=document.querySelector(a);if(c){let d=h.getComputedStyle(c).scrollMarginTop;u=d&&parseInt(d)||0}}}catch(c){console.error("Error finding target element:",c)}return{href:l,scrollMargin:u,anchorElement:o}}catch(o){return console.error("Error processing anchor:",o),null}}
1).filter(Boolean),r=(s,o,l)=>{try{s&&s.preventDefault&&s.preventDefault(),e.current&&o&&e.current.scrollTo(o,{offset:-(l||0)})}catch(a){console.error("Error in anchor click handler:",a)}},n=i.map(({href:s,scrollMargin:o})=>l=>r(l,s,o));return i.forEach(({anchorElement:s},o)=>{s&&n[o]&&s.addEventListener("click",n[o])}),()=>{i.forEach(({anchorElement:s},o)=>{s&&n[o]&&s.removeEventListener("click",n[o])})}}catch(i){return console.error("Error setting up anchor links:",i),()=>{}}},[e]),I("div",{style:f.style})}var V=B(st,["html.lenis { height: auto; }",".lenis.lenis-smooth { scroll-behavior: auto !important; }",".lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }",".lenis.lenis-stopped { overflow: hidden; }",".lenis.lenis-scrolling iframe { pointer-events: none; }"],""),ct=V;V.displayName="Smooth Scroll";P(V,{intensity:{title:"Intensity",type:q.Number,defaultValue:10,min:0,description:"More components at [Framer University](https://frameruni.link/cc)."}});export{ct as a};
2//# sourceMappingURL=chunk-T2VBYGQ5.mjs.map

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.