{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/oFOs9dvv9P1TsgFFrdAS/gXFu0UHSN5pX1wQcam1p/LinesOverlayCode.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{useEffect,useRef,useState}from\"react\";/**\n * Animated horizontal lines overlay\n *\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 50\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LineOverlay(props){const{lineColor,lineHeight,lineGap,speed=1,style={},preview=true,direction=\"horizontal\"}=props;const containerRef=useRef(null);const[dimensions,setDimensions]=useState({width:400,height:300});const isPreviewOrExport=RenderTarget.current()===RenderTarget.preview||RenderTarget.current()===RenderTarget.export;const shouldAnimate=isPreviewOrExport?true:preview;const actualLineHeight=Math.max(1,Math.round(dimensions.height*(lineHeight/100)));const actualLineGap=Math.max(0,Math.round(dimensions.height*(lineGap/100)));useEffect(()=>{if(!containerRef.current)return;const node=containerRef.current;function update(){setDimensions({width:node.offsetWidth,height:node.offsetHeight});}update();const ro=new window.ResizeObserver(update);ro.observe(node);return()=>ro.disconnect();},[]);const[lineAnims,setLineAnims]=useState([]);useEffect(()=>{const{height,width}=dimensions;const step=actualLineHeight+actualLineGap;if(step<=0)return;// Calculate count based on direction\nconst size=direction===\"horizontal\"?height:width;let count=Math.ceil((size-actualLineHeight)/step)+1;if(count>0&&(count-1)*step+actualLineHeight<size)count+=1;const arr=Array.from({length:count},(_,i)=>{const y=i*step;const direction=Math.random()>.5?1:-1;const minLen=width*.2;const maxLen=width*.9;const baseLen=minLen+Math.random()*(maxLen-minLen);const minOffset=0;const maxOffset=width-baseLen;const baseOffset=minOffset+Math.random()*(maxOffset-minOffset);const duration=.8+Math.random()*(2.5-.8);const targetOffset=minOffset+Math.random()*(maxOffset-minOffset);const targetLen=minLen+Math.random()*(maxLen-minLen);return{y,direction,baseLen,baseOffset,targetOffset,targetLen,duration};});setLineAnims(arr);},[dimensions,actualLineHeight,actualLineGap]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"svg\",{width:dimensions.width,height:dimensions.height,viewBox:`0 0 ${dimensions.width} ${dimensions.height}`,style:{position:\"absolute\",top:0,left:0,pointerEvents:\"none\",width:dimensions.width,height:dimensions.height},children:lineAnims.map((anim,i)=>/*#__PURE__*/_jsx(AnimatedLine,{position:anim.y+actualLineHeight/2,length:direction===\"horizontal\"?dimensions.width:dimensions.height,color:lineColor,lineWidth:actualLineHeight,speed:speed,animateLine:shouldAnimate,direction:direction},i))})});}function AnimatedLine({position,length,color,lineWidth,speed,animateLine,direction}){const[dash,setDash]=useState({dash:100,gap:100,offset:0,duration:1.5,direction:1});useEffect(()=>{const dashLen=length*(.2+Math.random()*.6);const gapLen=length*(.1+Math.random()*.5);const baseDuration=.8+Math.random()*1.7;const duration=baseDuration/(speed||1);const direction=Math.random()>.5?1:-1;setDash({dash:dashLen,gap:gapLen,offset:0,duration,direction});},[length,speed]);const[offset,setOffset]=useState(0);useEffect(()=>{if(!animateLine){setOffset(0);return;}let raf;let start=performance.now();function animate(now){const elapsed=(now-start)/1e3%dash.duration;const progress=elapsed/dash.duration;const total=dash.dash+dash.gap;const val=dash.direction*total*progress;setOffset(val);raf=requestAnimationFrame(animate);}raf=requestAnimationFrame(animate);return()=>cancelAnimationFrame(raf);},[dash,animateLine]);return /*#__PURE__*/_jsx(\"line\",{x1:direction===\"horizontal\"?0:position,y1:direction===\"horizontal\"?position:0,x2:direction===\"horizontal\"?length:position,y2:direction===\"horizontal\"?position:length,stroke:color,strokeWidth:lineWidth,strokeDasharray:`${dash.dash},${dash.gap}`,strokeDashoffset:offset,strokeLinecap:\"butt\",vectorEffect:\"non-scaling-stroke\"});}addPropertyControls(LineOverlay,{direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"horizontal\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\",icon:\"swap\"},lineColor:{type:ControlType.Color,title:\"Line Color\",defaultValue:\"#000000\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:.5,min:.1,max:100,step:.1,unit:\"%\"},lineGap:{type:ControlType.Number,title:\"Line Gap\",defaultValue:0,min:0,max:100,step:.1,unit:\"%\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:.1,max:5,step:.05,unit:\"x\"},preview:{type:ControlType.Boolean,title:\"Preview\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\",description:\"Show line animation in Framer canvas.\"}});LineOverlay.displayName=\"Line Animator\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LineOverlay\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"50\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"200\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LinesOverlayCode.map"],
  "mappings": "8JAUkB,SAARA,EAA6BC,EAAM,CAAC,GAAK,CAAC,UAAAC,EAAU,WAAAC,EAAW,QAAAC,EAAQ,MAAAC,EAAM,EAAE,MAAAC,EAAM,CAAC,EAAE,QAAAC,EAAQ,GAAK,UAAAC,EAAU,YAAY,EAAEP,EAAYQ,EAAaC,EAAO,IAAI,EAAO,CAACC,EAAWC,CAAa,EAAEC,EAAS,CAAC,MAAM,IAAI,OAAO,GAAG,CAAC,EAA4HC,EAAlGC,EAAa,QAAQ,IAAIA,EAAa,SAASA,EAAa,QAAQ,IAAIA,EAAa,OAA6C,GAAKR,EAAcS,EAAi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AC,KAAKA,EAAY,OAAO,MAAM,cAAc,aAAa,GAAG,IAAI,GAAG,IAAI,IAAI,KAAK,GAAG,KAAK,GAAG,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,WAAW,aAAa,EAAE,IAAI,EAAE,IAAI,IAAI,KAAK,GAAG,KAAK,GAAG,EAAE,MAAM,CAAC,KAAKA,EAAY,OAAO,MAAM,QAAQ,aAAa,EAAE,IAAI,GAAG,IAAI,EAAE,KAAK,IAAI,KAAK,GAAG,EAAE,QAAQ,CAAC,KAAKA,EAAY,QAAQ,MAAM,UAAU,aAAa,GAAK,aAAa,MAAM,cAAc,KAAK,YAAY,uCAAuC,CAAC,CAAC,EAAEjE,EAAY,YAAY",
  "names": ["LineOverlay", "props", "lineColor", "lineHeight", "lineGap", "speed", "style", "preview", "direction", "containerRef", "pe", "dimensions", "setDimensions", "ye", "shouldAnimate", "RenderTarget", "actualLineHeight", "actualLineGap", "ue", "node", "update", "ro", "window", "lineAnims", "setLineAnims", "height", "width", "step", "size", "count", "arr", "_", "i", "y", "minLen", "maxLen", "baseLen", "minOffset", "maxOffset", "baseOffset", "duration", "targetOffset", "targetLen", "p", "anim", "AnimatedLine", "position", "length", "color", "lineWidth", "animateLine", "dash", "setDash", "dashLen", "gapLen", "offset", "setOffset", "raf", "start", "animate", "now", "progress", "total", "val", "addPropertyControls", "ControlType"]
}
