{"version":3,"file":"AnimatedWaveDivider.rFDNFpiP.mjs","names":["d","React.useRef","React.useMemo","p"],"sources":["https:/framerusercontent.com/modules/hDiiEMKq2L4Onb5p3gmY/FhpqnCadECikKTpqP5IE/AnimatedWaveDivider.js"],"sourcesContent":["// User instructions: \"ich benötige eine Animierte Welle, ich habe hier eine welle gebaut aber ich möchte das sie sich bewegt, kannst du mir sowas erstellen?\"\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,animate,useInView,useMotionValue,useTransform}from\"framer-motion\";function clamp(n,min,max){return Math.max(min,Math.min(max,n));}function buildWavePath({phase,baseX,amplitude,waves,segments,edgeOverscan,orientation}){const w=100;const h=100;const pad=Math.max(0,edgeOverscan);const padX=Math.max(0,amplitude)+2;// Small bleed to avoid 1px seams from subpixel rendering at the edges\nconst bleed=.75;const segs=Math.max(2,Math.round(segments));const bx=clamp(baseX,0,100);const amp=Math.max(0,amplitude);const wv=Math.max(.25,waves);if(orientation===\"horizontal\"){const padY=padX;const xStart=-pad-bleed;const xEnd=w+pad+bleed;const totalW=xEnd-xStart;const dx=totalW/segs;const yAt=x=>{const t=x/w*Math.PI*2*wv;return bx+Math.sin(t+phase)*amp;};const ySolid=-padY-bleed;let d=`M ${xStart.toFixed(3)} ${ySolid.toFixed(3)} L ${xStart.toFixed(3)} ${yAt(xStart).toFixed(3)}`;for(let i=0;i<segs;i++){const x0=xStart+i*dx;const x1=xStart+(i+1)*dx;const y1=yAt(x0+dx/3);const y2=yAt(x0+2*dx/3);const y3=yAt(x1);const c1x=x0+dx/3;const c2x=x0+2*dx/3;d+=` C ${c1x.toFixed(3)} ${y1.toFixed(3)}, ${c2x.toFixed(3)} ${y2.toFixed(3)}, ${x1.toFixed(3)} ${y3.toFixed(3)}`;}d+=` L ${xEnd.toFixed(3)} ${ySolid.toFixed(3)} Z`;return d;}const yStart=-pad-bleed;const yEnd=h+pad+bleed;const totalH=yEnd-yStart;const dy=totalH/segs;const xAt=y=>{// Keep wavelength consistent regardless of overscan/bleed\nconst t=y/h*Math.PI*2*wv;return bx+Math.sin(t+phase)*amp;};// Filled shape: left side is solid (x=0..wave), right edge is the animated wave.\n// Path starts at top-left, goes to wave at top, then down wave, then closes along bottom and left.\nlet d=`M ${(-padX-bleed).toFixed(3)} ${yStart.toFixed(3)} L ${xAt(yStart).toFixed(3)} ${yStart.toFixed(3)}`;for(let i=0;i<segs;i++){const y0=yStart+i*dy;const y1=yStart+(i+1)*dy;const x1=xAt(y0+dy/3);const x2=xAt(y0+2*dy/3);const x3=xAt(y1);const c1y=y0+dy/3;const c2y=y0+2*dy/3;d+=` C ${x1.toFixed(3)} ${c1y.toFixed(3)}, ${x2.toFixed(3)} ${c2y.toFixed(3)}, ${x3.toFixed(3)} ${y1.toFixed(3)}`;}d+=` L ${(-padX-bleed).toFixed(3)} ${yEnd.toFixed(3)} Z`;return d;}/**\n * @framerIntrinsicWidth 140\n * @framerIntrinsicHeight 600\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function AnimatedWaveDivider(props){const{fillColor,side,baseX,amplitude,waves,segments,speed,easing,uniformSpeed,edgeOverscan,style}=props;const isStatic=useIsStaticRenderer();const ref=React.useRef(null);const inView=useInView(ref,{amount:.15,margin:\"200px 0px 200px 0px\"});const orientation=side===\"top\"||side===\"bottom\"?\"horizontal\":\"vertical\";const dStatic=React.useMemo(()=>buildWavePath({phase:0,baseX,amplitude,waves,segments,edgeOverscan,orientation}),[baseX,amplitude,waves,segments,edgeOverscan,orientation]);const shouldAnimate=!isStatic&&inView&&speed>0;const phase=useMotionValue(0);const transition=React.useMemo(()=>{const dur=Math.max(.15,speed);// For a perfectly constant phase speed, use linear easing.\nconst ease=uniformSpeed?\"linear\":easing;return{duration:dur,repeat:Infinity,repeatType:\"loop\",ease};},[speed,easing,uniformSpeed]);React.useEffect(()=>{if(!shouldAnimate)return;phase.set(0);const controls=animate(phase,Math.PI*2,transition);return()=>controls.stop();},[phase,shouldAnimate,transition]);const isHorizontal=side===\"top\"||side===\"bottom\";const dAnimated=useTransform(phase,p=>buildWavePath({phase:p,baseX,amplitude,waves,segments,edgeOverscan,orientation}));const vbY=isHorizontal?-(Math.max(0,amplitude)+2):-Math.max(0,edgeOverscan);const vbH=isHorizontal?100+(Math.max(0,amplitude)+2)*2:100+Math.max(0,edgeOverscan)*2;const vbX=isHorizontal?-Math.max(0,edgeOverscan):-(Math.max(0,amplitude)+2);const vbW=isHorizontal?100+Math.max(0,edgeOverscan)*2:100+(Math.max(0,amplitude)+2)*2;// Extend viewBox slightly to eliminate edge seams when scaled\nconst viewBleed=.75;return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",pointerEvents:\"none\",...style},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"100%\",height:\"100%\",viewBox:`${vbX-viewBleed} ${vbY-viewBleed} ${vbW+viewBleed*2} ${vbH+viewBleed*2}`,preserveAspectRatio:\"none\",style:{position:\"relative\",width:\"100%\",height:\"100%\",transform:side===\"left\"?\"scaleX(-1)\":side===\"bottom\"?\"scaleY(-1)\":undefined,transformOrigin:\"50% 50%\",display:\"block\"},focusable:\"false\",children:shouldAnimate?/*#__PURE__*/_jsx(motion.path,{d:dAnimated,fill:fillColor}):/*#__PURE__*/_jsx(\"path\",{d:dStatic,fill:fillColor})})});}addPropertyControls(AnimatedWaveDivider,{fillColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#FFFFFF\"},side:{type:ControlType.Enum,title:\"Side\",options:[\"left\",\"right\",\"top\",\"bottom\"],optionTitles:[\"Left\",\"Right\",\"Top\",\"Bottom\"],defaultValue:\"left\",displaySegmentedControl:true},baseX:{type:ControlType.Number,title:\"Base X\",defaultValue:92,min:0,max:100,step:1,unit:\"%\"},amplitude:{type:ControlType.Number,title:\"Amplitude\",defaultValue:10,min:0,max:40,step:1,unit:\"%\"},waves:{type:ControlType.Number,title:\"Waves\",defaultValue:1.25,min:.5,max:6,step:.1},segments:{type:ControlType.Number,title:\"Detail\",defaultValue:24,min:6,max:60,step:1},edgeOverscan:{type:ControlType.Number,title:\"Edge Overscan\",defaultValue:8,min:0,max:30,step:1,unit:\"%\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:6,min:0,max:20,step:.1,unit:\"s\"},uniformSpeed:{type:ControlType.Boolean,title:\"Uniform Speed\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},easing:{type:ControlType.Enum,title:\"Easing\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\",\"circInOut\",\"backInOut\",\"anticipate\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\",\"Circ In Out\",\"Back In Out\",\"Anticipate\"],defaultValue:\"linear\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"AnimatedWaveDivider\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"140\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"600\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./AnimatedWaveDivider.map"],"mappings":"wQAC+N,SAAS,EAAM,EAAE,EAAI,EAAI,CAAC,OAAO,KAAK,IAAI,EAAI,KAAK,IAAI,EAAI,EAAE,CAAC,CAAE,SAAS,EAAc,CAAC,QAAM,QAAM,YAAU,QAAM,WAAS,eAAa,eAAa,CAAC,IAA8B,EAAI,KAAK,IAAI,EAAE,EAAa,CAAO,EAAK,KAAK,IAAI,EAAE,EAAU,CAAC,EAC7c,EAAM,IAAU,EAAK,KAAK,IAAI,EAAE,KAAK,MAAM,EAAS,CAAC,CAAO,EAAG,EAAM,EAAM,EAAE,IAAI,C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