{"version":3,"file":"RainbowBorder.BTRtO2du.mjs","names":[],"sources":["https:/framerusercontent.com/modules/vPtsj5Dnkhpg9oyVrURh/CccC2AShm9hxo9LNm4OF/RainbowBorder.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,useMotionValue,useTransform,animate}from\"framer-motion\";import{useEffect}from\"react\";/**\n@framerSupportedLayoutWidth fixed\n@framerSupportedLayoutHeight fixed\n*/export default function RainbowBorder(props){const{saturation,brightness,opacity,animation,customColors}=props;const startAngle=props.randomize?0:props.startAngle;const inset=props.borderWidth;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const angle=useMotionValue(!isCanvas&&props.randomize?Math.random()*360:0);useEffect(()=>{if(!isCanvas&&animation){animate(angle,angle.get()+(animation.direction===\"ccw\"?-360:360),{duration:animation.duration,repeat:Infinity,ease:\"linear\"});}},[]);let gradientColors=[];if(customColors&&customColors.length>0){gradientColors=customColors.map(color=>{if(opacity<1){// Append opacity as 2-digit hex if needed\nreturn`${color}${Math.round(opacity*255).toString(16).padStart(2,\"0\")}`;}return color;});gradientColors.push(gradientColors[0])// Loop the gradient\n;}else{let multiplier=props.direction===\"default\"?1:-1;const stopCount=18;for(let i=0;i<stopCount;i++){gradientColors.push(`hsl(${i/stopCount*360*multiplier}deg ${saturation}% ${brightness}% / ${opacity})`);}gradientColors.push(gradientColors[0]);}const gradientStops=gradientColors.join(\", \");return /*#__PURE__*/_jsx(motion.div,{style:{backgroundImage:isCanvas?`conic-gradient(from ${startAngle}deg, ${gradientStops})`:useTransform([angle],([value])=>`conic-gradient(from ${startAngle+value}deg, ${gradientColors})`),borderRadius:props.radiusIsMixed?`${props.radiusTopLeft}px ${props.radiusTopRight}px ${props.radiusBottomRight}px ${props.radiusBottomLeft}px`:`${props.radius}px`,...props.style},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:inset,backgroundColor:props.fill,borderRadius:props.radiusIsMixed?`${props.radiusTopLeft-inset}px ${props.radiusTopRight-inset}px ${props.radiusBottomRight-inset}px ${props.radiusBottomLeft-inset}px`:`${props.radius-inset}px`}})});}RainbowBorder.displayName=\"Rainbow Border (Atom)\";const animationDefault={duration:5,direction:\"cw\"};// Default color list you requested\nconst defaultCustomColors=[\"#FFAA00\",\"#FF6A00\",\"#FF1500\",\"#FF0055\",\"#FF00AA\",\"#BF00FF\",\"#4000FF\",\"#0080FF\",\"#00BFFF\",\"#00FFD5\",\"#00FF95\",\"#40BF4A\"];addPropertyControls(RainbowBorder,{borderWidth:{type:ControlType.Number,defaultValue:10,min:1,step:1,title:\"Width\"},direction:{type:ControlType.Enum,defaultValue:\"default\",options:[\"default\",\"reverse\"],optionTitles:[\"Default\",\"Reverse\"],displaySegmentedControl:true},saturation:{type:ControlType.Number,defaultValue:100,min:0,max:100,unit:\"%\"},brightness:{type:ControlType.Number,defaultValue:50,min:0,max:100,unit:\"%\"},opacity:{type:ControlType.Number,defaultValue:1,min:0,max:1,step:.01},animation:{type:ControlType.Object,defaultValue:animationDefault,optional:true,icon:\"effect\",controls:{duration:{type:ControlType.Number,defaultValue:animationDefault.duration,min:.1,description:\"Seconds to rotate 360\\xb0\"},direction:{type:ControlType.Enum,defaultValue:animationDefault.direction,options:[\"cw\",\"ccw\"],optionTitles:[\"Clockwise\",\"Counterclockwise\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"}}},randomize:{type:ControlType.Boolean,defaultValue:true,description:\"Random start angle.\"},startAngle:{type:ControlType.Number,defaultValue:0,min:-360,max:360,unit:\"\\xb0\",hidden:props=>props.randomize},fill:{type:ControlType.Color,defaultValue:\"#000\"},radius:{type:ControlType.FusedNumber,defaultValue:20,toggleKey:\"radiusIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"radiusTopLeft\",\"radiusTopRight\",\"radiusBottomRight\",\"radiusBottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0},customColors:{type:ControlType.Array,defaultValue:defaultCustomColors,propertyControl:{type:ControlType.Color},title:\"Custom Colors\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RainbowBorder\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RainbowBorder.map"],"mappings":"wPAGE,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,aAAW,aAAW,UAAQ,YAAU,gBAAc,EAAY,EAAW,EAAM,UAAU,EAAE,EAAM,WAAiB,EAAM,EAAM,YAAkB,EAAS,EAAa,SAAS,GAAG,EAAa,OAAa,EAAM,EAAe,CAAC,GAAU,EAAM,UAAU,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAc,CAAI,CAAC,GAAU,GAAW,EAAQ,EAAM,EAAM,KAAK,EAAE,EAAU,YAAY,MAAM,KAAK,KAAK,CAAC,SAAS,EAAU,SAAS,OAAO,IAAS,KAAK,SAAS,CAAC,EAAI,EAAE,CAAC,CAAC,IAAI,EAAe,EAAE,CAAC,GAAG,GAAc,EAAa,OAAO,EAAG,EAAe,EAAa,IAAI,GAAW,EAAQ,EAClmB,GAAG,IAAQ,KAAK,MAAM,EAAQ,IAAI,CAAC,SAAS,GAAG,CAAC,SAAS,EAAE,IAAI,GAAW,EAAQ,CAAC,EAAe,KAAK,EAAe,GAAG,KACzH,CAAC,IAAI,EAAW,EAAM,YAAY,UAAU,EAAE,GAAsB,IAAI,IAAI,EAAE,EAAE,EAAE,GAAU,IAAK,EAAe,KAAK,OAAO,EAAE,GAAU,IAAI,EAAW,MAAM,EAAW,IAAI,EAAW,MAAM,EAAQ,GAAG,CAAE,EAAe,KAAK,EAAe,GAAG,CAAE,IAAM,EAAc,EAAe,KAAK,KAAK,CAAC,OAAoB,EAAK,EAAO,IAAI,CAAC,MAAM,CA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