{"version":3,"file":"LeephScrollLine.Bdn-oSEZ.mjs","names":["useRef","useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","window","_e","c","init_jsx_runtime","ce","de","addPropertyControls","RenderTarget","ControlType","init_framer_CKT6jEEQ","LeephScrollLine","props","ref","setP","len","setLen","el","raf","update","r","vh","v","direction","onScroll","fit","tl","nodes","n","last","ro","vert","size","style","radius","track","color","init_LeephScrollLine"],"sources":["https:/framerusercontent.com/modules/aHYk4OJ5vEvGAEvEhxrO/6cjU5cDNFS4G1N04oMWv/LeephScrollLine.js"],"sourcesContent":["// Leeph Studio — decorative timeline line that draws as you scroll (Home \"How it works\").\n// Grey track + teal fill. Horizontal or vertical. Renders FULLY DRAWN by default (static HTML,\n// canvas, no JS, reduced motion); after mount it follows scroll position. aria-hidden.\n// Fit: after mount the track is trimmed/extended so it ends exactly at the centre of the last\n// \"Number\" node inside the nearest \"Timeline\" frame (so text wrapping at any width can't break it).\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicWidth 858\n * @framerIntrinsicHeight 2\n */export default function LeephScrollLine(props){const{direction=\"horizontal\",color=\"#0B7A77\",track=\"#E5E5E5\",radius=2,style}=props;const ref=useRef(null);const[p,setP]=useState(1);const[len,setLen]=useState(null);useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;if(typeof window===\"undefined\"||!window.matchMedia)return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;const el=ref.current;if(!el)return;let raf=0;const update=()=>{raf=0;const r=el.getBoundingClientRect();const vh=window.innerHeight||800;let v;if(direction===\"vertical\")v=(vh*.75-r.top)/Math.max(1,r.height);else v=(vh*.85-r.top)/(vh*.4);setP(Math.max(0,Math.min(1,v)));};const onScroll=()=>{if(!raf)raf=requestAnimationFrame(update);};update();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onScroll);return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onScroll);if(raf)cancelAnimationFrame(raf);};},[direction]);useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;if(typeof window===\"undefined\")return;const el=ref.current;if(!el)return;const fit=()=>{const tl=el.closest('[data-framer-name=\"Timeline\"]');if(!tl)return;const nodes=Array.from(tl.querySelectorAll('[data-framer-name=\"Number\"]')).filter(n=>n.offsetParent!==null);if(!nodes.length)return;const last=nodes[nodes.length-1].getBoundingClientRect();const r=el.getBoundingClientRect();const v=direction===\"vertical\"?last.top+last.height/2-r.top:last.left+last.width/2-r.left;if(v>0)setLen(Math.round(v));};fit();const ro=typeof ResizeObserver!==\"undefined\"?new ResizeObserver(fit):null;const tl=el.closest('[data-framer-name=\"Timeline\"]');if(ro&&tl)ro.observe(tl);window.addEventListener(\"resize\",fit);return()=>{if(ro)ro.disconnect();window.removeEventListener(\"resize\",fit);};},[direction]);const vert=direction===\"vertical\";const size=len==null?\"100%\":len+\"px\";return /*#__PURE__*/_jsx(\"div\",{ref:ref,\"aria-hidden\":\"true\",style:{...style,position:\"relative\",overflow:\"visible\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:0,top:0,width:vert?\"100%\":size,height:vert?size:\"100%\",overflow:\"hidden\",borderRadius:radius,background:track},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:color,transformOrigin:vert?\"50% 0%\":\"0% 50%\",transform:vert?`scaleY(${p})`:`scaleX(${p})`,willChange:\"transform\"}})})});}LeephScrollLine.displayName=\"Leeph Scroll Line\";addPropertyControls(LeephScrollLine,{direction:{type:ControlType.Enum,title:\"Direction\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],defaultValue:\"horizontal\"},color:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#0B7A77\"},track:{type:ControlType.Color,title:\"Track\",defaultValue:\"#E5E5E5\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:2,min:0,max:8}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LeephScrollLine\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"2\",\"framerIntrinsicWidth\":\"858\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LeephScrollLine.map"],"mappings":"A,8MAUG,SAAwBe,EAAgB,EAAM,CAAC,GAAK,CAAC,YAAU,aAAa,QAAM,UAAU,QAAM,UAAU,SAAO,EAAE,SAAOC,EAAYC,EAAIjB,EAAO,IAAI,EAAO,CAAC,EAAEkB,GAAMjB,EAAS,CAAC,EAAO,CAACkB,EAAIC,GAAQnB,EAAS,IAAI,EAAEQ,MAAc,CAAkH,GAA9GG,EAAa,QAAQ,IAAIA,EAAa,QAAwBP,IAAS,QAAa,CAACA,EAAO,YAAqBA,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAQ,OAAO,IAAMgB,EAAGJ,EAAI,QAAQ,GAAG,CAACI,EAAG,OAAO,IAAIC,EAAI,EAAQC,MAAW,CAAC,EAAI,EAAE,IAAMC,EAAEH,EAAG,sBAAsB,EAAQI,EAAGpB,EAAO,aAAa,IAAQqB,EAAE,AAAqEA,EAAlEC,IAAY,YAAcF,EAAG,IAAID,EAAE,KAAK,KAAK,IAAI,EAAEA,EAAE,MAAM,GAAUC,EAAG,IAAID,EAAE,MAAMC,EAAG,IAAIP,EAAK,KAAK,IAAI,EAAE,KAAK,IAAI,EAAEQ,CAAC,CAAC,CAAC,CAAE,EAAQE,MAAa,CAAC,AAAQN,IAAI,sBAAsBC,CAAM,CAAE,EAAgH,OAA9GA,EAAO,EAAElB,EAAO,iBAAiB,SAASuB,EAAS,CAAC,QA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