{"version":3,"file":"FrameBeam.BDFThjIO.mjs","names":["beamLength","secondColor","firstColor"],"sources":["https:/framerusercontent.com/modules/0aV8IO22JIYVmkzPFMtA/GHqaSjfW4Tn1261KIRsa/FrameBeam.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{Frame,addPropertyControls,ControlType}from\"framer\";import{motion,useAnimation}from\"framer-motion\";//Code component provided by Eleveight Supply™. All rights reserved 2024.\n/**\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth 100%\n * @framerSupportedLayoutHeight 100%\n */export default function Framebeam({speed,borderWidth,beamLength,firstColor,secondColor,appearDelay,connectedFrame,radius,colorMode,rotationDirection,sizeBehaviour}){const animationControl=useAnimation();const getGradientDefinition=(firstColor,secondColor,beamLength)=>{const fadeStart=100-beamLength;return`transparent ${fadeStart}%, ${secondColor}, ${firstColor} 100%`;};React.useEffect(()=>{const effectiveSecondColor=colorMode===\"Solid\"?firstColor:secondColor;const gradientDefinition=getGradientDefinition(firstColor,effectiveSecondColor,beamLength);animationControl.set({opacity:0});setTimeout(()=>{animationControl.start({opacity:[0,1],transition:{duration:1,ease:\"ease-in\"}});animationControl.start({background:[`conic-gradient(from 0deg at 50% 50%, ${gradientDefinition})`,`conic-gradient(from ${rotationDirection===\"CounterClockwise\"?\"360deg\":\"360deg\"} at 50% 50%, ${gradientDefinition})`],transition:{duration:31-speed,ease:\"linear\",repeat:Infinity}});},appearDelay*1e3);return()=>animationControl.stop();},[animationControl,speed,appearDelay,firstColor,secondColor,beamLength,colorMode,rotationDirection]);const renderContent=()=>{if(!connectedFrame||connectedFrame.length===0){return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",backgroundColor:\"#221A34\",color:\"#fff\",borderRadius:\"20px\",zIndex:2,flexDirection:\"column\",textAlign:\"center\",padding:\"35px\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsxs(\"svg\",{width:\"80\",height:\"100\",viewBox:\"0 0 305 241\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M0 39C0 17.4609 17.4609 0 39 0H266C287.539 0 305 17.4609 305 39V202C305 223.539 287.539 241 266 241H39C17.4609 241 0 223.539 0 202V39Z\",fill:\"#9A66FF\",\"fill-opacity\":\"0.22\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M3 135L3 37C3 18.2223 18.2223 3.00004 37 3.00004L154.827 3.00003L251 3.00004\",stroke:\"url(#paint0_linear_830_1907)\",\"stroke-width\":\"5\",\"stroke-linecap\":\"square\"}),/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"linearGradient\",{id:\"paint0_linear_830_1907\",x1:\"251\",y1:\"5.85924\",x2:\"7.84388\",y2:\"105.944\",gradientUnits:\"userSpaceOnUse\",children:[/*#__PURE__*/_jsx(\"stop\",{\"stop-color\":\"#9A66FF\"}),/*#__PURE__*/_jsx(\"stop\",{offset:\"0.699384\",\"stop-color\":\"#E11FED\"}),/*#__PURE__*/_jsx(\"stop\",{offset:\"1\",\"stop-color\":\"#FF00E6\",\"stop-opacity\":\"0\"})]})})]}),/*#__PURE__*/_jsx(\"div\",{style:{marginTop:\"8px\",color:\"#8658D8\",fontWeight:\"normal\",fontSize:\"12px\",fontFamily:\"Inter, sans-serif\",textAlign:\"center\",width:\"300px\"},children:\"Connect to your frame, then adjust the various styling options from the property controls panel.\"})]});}else{const frameStyle=sizeBehaviour===\"Fit Frame\"?{}// No additional styling to fit frame\n:{width:\"100%\",height:\"100%\"}// Ensure connected frame fills the container\n;return connectedFrame.map((child,index)=>/*#__PURE__*/React.cloneElement(child,{key:index,style:{...frameStyle,...child.props.style}}));}};return /*#__PURE__*/_jsxs(Frame,{background:\"\",style:{width:sizeBehaviour===\"Fit Frame\"?\"auto\":\"100%\",height:sizeBehaviour===\"Fit Frame\"?\"auto\":\"100%\",overflow:\"hidden\",position:\"relative\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",borderRadius:`${radius}px`,padding:`${borderWidth}px`,boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(motion.div,{style:{width:\"100%\",height:\"100%\",position:\"absolute\",top:0,left:0,right:0,bottom:0,backgroundSize:\"cover\",transform:rotationDirection===\"CounterClockwise\"?\"scaleX(-1)\":\"none\"},animate:animationControl}),renderContent()]});}Framebeam.defaultProps={speed:21,borderWidth:0,beamLength:50,firstColor:\"#8658D8\",secondColor:\"#E81CFF\",appearDelay:0,radius:20,direction:\"Right\",colorMode:\"Gradient\",rotationDirection:\"Clockwise\",sizeBehaviour:\"Fit Frame\"};addPropertyControls(Framebeam,{colorMode:{type:ControlType.SegmentedEnum,title:\"Color Mode\",options:[\"Solid\",\"Gradient\"],defaultValue:\"Gradient\"},firstColor:{type:ControlType.Color,title:\"First Color\"},secondColor:{type:ControlType.Color,title:\"Second Color\",hidden:({colorMode})=>colorMode===\"Solid\"},speed:{type:ControlType.Number,title:\"Speed\",min:1,max:30,displayStepper:true},rotationDirection:{type:ControlType.SegmentedEnum,title:\"Rotation\",options:[\"CounterClockwise\",\"Clockwise\"],optionTitles:[\"←\",\"→\"],defaultValue:\"Clockwise\"},beamLength:{type:ControlType.Number,title:\"Length\",min:0,max:100,unit:\"%\",displayStepper:true,defaultValue:50},borderWidth:{type:ControlType.Number,title:\"Thickness\",min:1,max:20,unit:\"px\",displayStepper:true},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:200,displayStepper:true,description:\"Set to (main frame radius *+* thickness)\"},appearDelay:{type:ControlType.Number,title:\"Appear\",min:0,max:10,step:.1,unit:\"s\",displayStepper:true,description:\"Set a delay before the beam appears.\"},connectedFrame:{type:ControlType.Array,title:\"Main Frame\",propertyControl:{type:ControlType.ComponentInstance}},sizeBehaviour:{type:ControlType.Enum,title:\"Sizing\",options:[\"Fill Container\",\"Fit Frame\"],optionTitles:[\"Fill Container\",\"Fit Frame\"],defaultValue:\"Fit Frame\",description:\"*Fit* has the component size itself based on the connected Frame while *Fill* has the connected Fame cover the entire component area\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Framebeam\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"100%\",\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutWidth\":\"100%\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FrameBeam.map"],"mappings":"mPASG,SAAwB,EAAU,CAAC,QAAM,cAAY,aAAW,aAAW,cAAY,cAAY,iBAAe,SAAO,YAAU,oBAAkB,iBAAe,CAAC,IAAM,EAAiB,GAAc,CAAO,GAAuB,EAAW,EAAY,IAAmD,eAArB,IAAIA,EAA0C,KAAKC,EAAY,IAAIC,EAAW,OAElO,OAF2O,MAAoB,CAAuE,IAAM,EAAmB,EAAsB,EAA1F,IAAY,QAAQ,EAAW,EAA2F,EAAW,CAA4a,OAA3a,EAAiB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,eAAe,CAAC,EAAiB,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,KAAK,UAAU,CAAC,CAAC,CAAC,EAAiB,MAAM,CAAC,WAAW,CAAC,wCAAwC,EAAmB,GAAG,0CAA+F,EAAmB,GAAG,CAAC,WAAW,CAAC,SAAS,GAAG,EAAM,KAAK,SAAS,OAAO,IAAS,CAAC,CAAC,EAAG,EAAY,IAAI,KAAW,EAAiB,MAAM,EAAG,CAAC,EAAiB,EAAM,EAAY,EAAW,EAAY,EAAW,EAAU,EAAkB,CAAC,CAE/7B,EAAM,EAAM,CAAC,WAAW,GAAG,MAAM,CAAC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