{"version":3,"file":"GradientCircle.Dl8v4cD6.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/RsMCaXKvny5GvKofRCUt/dPkFCPeUZqC2MGhlHcUZ/GradientCircle.js"],"sourcesContent":["// Glowing planet horizon rising from a customizable edge\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useMotionValue,animate,useTransform}from\"framer-motion\";import{useEffect,useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function GradientCircle(props){const{planetSize,backgroundColor,edgeBlur,rotationSpeed,morphAmount,morphSpeed,driftDistance,driftSpeed,positionX,positionY,texts=[],textPositionX,textPositionY,textMaxWidth,textHeadingLevel=\"none\",glow}=props;const angleOffset=useMotionValue(0);const driftX=useMotionValue(0);const driftY=useMotionValue(0);const morphProgress=useMotionValue(0);useEffect(()=>{const controls=animate(angleOffset,360,{duration:rotationSpeed,repeat:Infinity,ease:\"linear\"});return controls.stop;},[angleOffset,rotationSpeed]);useEffect(()=>{const morphControls=animate(morphProgress,[0,1,0],{duration:morphSpeed,repeat:Infinity,ease:\"easeInOut\"});return morphControls.stop;},[morphProgress,morphSpeed]);useEffect(()=>{const controlsX=animate(driftX,[0,driftDistance,-driftDistance,0],{duration:driftSpeed,repeat:Infinity,ease:\"easeInOut\"});const controlsY=animate(driftY,[0,-driftDistance*.75,driftDistance*.75,0],{duration:driftSpeed*1.25,repeat:Infinity,ease:\"easeInOut\"});return()=>{controlsX.stop();controlsY.stop();};},[driftX,driftY,driftDistance,driftSpeed]);const boxShadowTransform=useMemo(()=>{const toRad=Math.PI/180;const distance=glow.intensity/3;const colorCount=glow.innerColors.length;return angle=>{const innerShadows=glow.innerColors.map((color,i)=>{const currentAngle=i/colorCount*360+angle;const x=Math.cos(currentAngle*toRad)*distance+glow.innerX;const y=Math.sin(currentAngle*toRad)*distance+glow.innerY;return`inset ${x}px ${y}px ${glow.innerThickness}px ${glow.innerThickness/4}px ${color}`;}).join(\", \");return`${glow.offsetX}px ${glow.offsetY}px ${glow.intensity}px ${glow.intensity/4}px ${glow.color}, ${innerShadows}`;};},[glow.offsetX,glow.offsetY,glow.intensity,glow.color,glow.innerColors,glow.innerThickness,glow.innerX,glow.innerY]);const boxShadow=useTransform(angleOffset,boxShadowTransform);const borderRadiusTransform=useMemo(()=>{const amount=morphAmount/100;const pi2=Math.PI*2;return progress=>{const t=progress;return`${50+Math.sin(t*pi2)*15*amount}% ${50+Math.cos(t*Math.PI*3)*12*amount}% ${50+Math.sin(t*Math.PI*4)*10*amount}% ${50+Math.cos(t*Math.PI*2.5)*13*amount}% / ${50+Math.cos(t*pi2)*14*amount}% ${50+Math.sin(t*Math.PI*3.5)*11*amount}% ${50+Math.cos(t*Math.PI*3)*13*amount}% ${50+Math.sin(t*Math.PI*2.2)*12*amount}%`;};},[morphAmount]);const borderRadius=useTransform(morphProgress,borderRadiusTransform);const x=useTransform(driftX,value=>`calc(-50% + ${value}px)`);const y=useTransform(driftY,value=>`calc(-50% + ${value}px)`);const renderStyledText=()=>{if(!texts||texts.length===0)return null;return texts.map((textItem,textIndex)=>{if(!textItem.text)return null;return /*#__PURE__*/_jsx(\"span\",{style:{...textItem.font,color:textItem.color},children:textItem.text},textIndex);});};const TextTag=textHeadingLevel===\"none\"?\"div\":textHeadingLevel;return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",backgroundColor},children:[/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",width:`${planetSize}%`,height:`${planetSize}%`,borderRadius,filter:`blur(${edgeBlur}px)`,background:glow.middleColor,boxShadow,top:`${positionY}%`,left:`${positionX}%`,x,y,willChange:\"transform, border-radius, box-shadow\"}}),texts&&texts.length>0&&/*#__PURE__*/_jsx(TextTag,{style:{position:\"absolute\",top:`${textPositionY}%`,left:`${textPositionX}%`,transform:\"translate(-50%, -50%)\",textAlign:\"center\",pointerEvents:\"none\",zIndex:10,whiteSpace:\"normal\",width:`min(${textMaxWidth}px, 90vw)`,boxSizing:\"border-box\",margin:0,padding:0},children:renderStyledText()})]});}addPropertyControls(GradientCircle,{texts:{type:ControlType.Array,title:\"Texts\",control:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Text\",defaultValue:\"\",displayTextArea:false},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"32px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF\"}}},defaultValue:[{text:\"\",font:{fontSize:\"32px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1em\"},color:\"#FFFFFF\"}]},textHeadingLevel:{type:ControlType.Enum,title:\"Heading Level\",options:[\"none\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],optionTitles:[\"None\",\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"H6\"],defaultValue:\"none\",displaySegmentedControl:false},textPositionX:{type:ControlType.Number,title:\"Text Position X\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"},textPositionY:{type:ControlType.Number,title:\"Text Position Y\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"},textMaxWidth:{type:ControlType.Number,title:\"Text Max Width\",defaultValue:600,min:50,max:1e3,step:10,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#0D0D1F\"},planetSize:{type:ControlType.Number,title:\"Size\",defaultValue:60,min:20,max:200,step:5,unit:\"%\"},positionX:{type:ControlType.Number,title:\"Position X\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"},positionY:{type:ControlType.Number,title:\"Position Y\",defaultValue:50,min:0,max:100,step:1,unit:\"%\"},edgeBlur:{type:ControlType.Number,title:\"Edge Blur\",defaultValue:0,min:0,max:5,step:.1,unit:\"px\"},rotationSpeed:{type:ControlType.Number,title:\"Rotation Speed\",defaultValue:10,min:1,max:60,step:1,unit:\"s\"},morphAmount:{type:ControlType.Number,title:\"Morph Amount\",defaultValue:100,min:0,max:200,step:5,unit:\"%\"},morphSpeed:{type:ControlType.Number,title:\"Morph Speed\",defaultValue:12,min:1,max:60,step:1,unit:\"s\"},driftDistance:{type:ControlType.Number,title:\"Drift Distance\",defaultValue:20,min:0,max:100,step:5,unit:\"px\"},driftSpeed:{type:ControlType.Number,title:\"Drift Speed\",defaultValue:8,min:1,max:30,step:1,unit:\"s\"},glow:{type:ControlType.Object,title:\"Glow\",controls:{color:{type:ControlType.Color,title:\"Outer Color\",defaultValue:\"#5B8FFF\"},middleColor:{type:ControlType.Color,title:\"Middle Color\",defaultValue:\"#B565D8\"},innerColors:{type:ControlType.Array,title:\"Inner Colors\",control:{type:ControlType.Color},defaultValue:[\"#7B5FD3\",\"#5BA3FF\",\"#B565D8\"]},intensity:{type:ControlType.Number,title:\"Intensity\",defaultValue:80,min:0,max:200,step:10,unit:\"px\"},innerThickness:{type:ControlType.Number,title:\"Inner Thickness\",defaultValue:40,min:0,max:200,step:5,unit:\"px\"},offsetX:{type:ControlType.Number,title:\"Offset X\",defaultValue:0,min:-100,max:100,step:1,unit:\"px\"},offsetY:{type:ControlType.Number,title:\"Offset Y\",defaultValue:0,min:-100,max:100,step:1,unit:\"px\"},innerX:{type:ControlType.Number,title:\"Inner X\",defaultValue:0,min:-100,max:100,step:1,unit:\"px\"},innerY:{type:ControlType.Number,title:\"Inner Y\",defaultValue:0,min:-100,max:100,step:1,unit:\"px\"}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientCircle\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientCircle.map"],"mappings":"8PAIG,SAAwB,E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