{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/zIIymVGoACbGMaVbmnrw/UmFcP4qJd36gUlycbNKU/AnimatedGradientBorder.js"],
  "sourcesContent": ["import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType, RenderTarget } from \"framer\";\nimport { motion, useMotionValue, useTransform, animate } from \"framer-motion\";\nimport { useEffect } from \"react\"; /**\n                                   * @framerSupportedLayoutWidth fixed\n                                   * @framerSupportedLayoutHeight fixed\n                                   */\nexport default function AnimatedGradientBorder(props) {\n  const {\n    shineColor,\n    borderColor,\n    shineRange\n  } = props;\n  const startAngle = props.randomize ? 0 : props.startAngle;\n  const inset = props.borderWidth;\n  const isCanvas = RenderTarget.current() === RenderTarget.canvas;\n  const angle = useMotionValue(!isCanvas && props.randomize ? Math.random() * 360 : 0);\n  useEffect(() => {\n    if (!isCanvas) {\n      animate(angle, angle.get() + (props.direction == \"ccw\" ? -360 : 360), {\n        duration: props.duration,\n        repeat: Infinity,\n        ease: \"linear\"\n      });\n    }\n  }, []);\n  const gradientStops = props.shineStyle == \"sharp\" ? props.direction == \"ccw\" ? `${shineColor} 0, ${borderColor} ${shineRange}deg` : `${borderColor} ${360 - shineRange}deg, ${shineColor} 360deg` : `${shineColor} 0, ${borderColor} ${shineRange / 2}deg, ${borderColor} ${360 - shineRange / 2}deg,${shineColor} 360deg`;\n  return /*#__PURE__*/_jsx(motion.div, {\n    style: {\n      backgroundImage: isCanvas ? `conic-gradient(from ${startAngle}deg, ${gradientStops})` : useTransform([angle], ([value]) => `conic-gradient(from ${startAngle + value}deg, ${gradientStops})`),\n      borderRadius: props.radiusIsMixed ? `${props.radiusTopLeft}px ${props.radiusTopRight}px ${props.radiusBottomRight}px ${props.radiusBottomLeft}px` : `${props.radius}px`,\n      ...props.style\n    },\n    children: /*#__PURE__*/_jsx(\"div\", {\n      style: {\n        position: \"absolute\",\n        inset: inset,\n        backgroundColor: props.fill,\n        borderRadius: props.radiusIsMixed ? `${props.radiusTopLeft - inset}px ${props.radiusTopRight - inset}px ${props.radiusBottomRight - inset}px ${props.radiusBottomLeft - inset}px` : `${props.radius - inset}px`\n      }\n    })\n  });\n}\n;\nAnimatedGradientBorder.displayName = \"Animated Gradient Border\";\naddPropertyControls(AnimatedGradientBorder, {\n  borderWidth: {\n    type: ControlType.Number,\n    defaultValue: 4,\n    min: 1,\n    step: 1,\n    title: \"Width\"\n  },\n  shineStyle: {\n    type: ControlType.Enum,\n    defaultValue: \"sharp\",\n    options: [\"smooth\", \"sharp\"],\n    optionTitles: [\"Smooth\", \"Sharp\"],\n    displaySegmentedControl: true,\n    title: \"Style\"\n  },\n  shineRange: {\n    type: ControlType.Number,\n    defaultValue: 45,\n    min: 1,\n    max: 180,\n    step: 1,\n    unit: \"\\xb0\"\n  },\n  shineColor: {\n    type: ControlType.Color,\n    defaultValue: \"#6019FA\",\n    title: \"Shine\"\n  },\n  borderColor: {\n    type: ControlType.Color,\n    defaultValue: \"#EDEDED\",\n    title: \"Border\"\n  },\n  duration: {\n    type: ControlType.Number,\n    defaultValue: 5,\n    min: .1,\n    description: \"Seconds to rotate 360\\xb0\"\n  },\n  direction: {\n    type: ControlType.Enum,\n    defaultValue: \"cw\",\n    options: [\"cw\", \"ccw\"],\n    optionTitles: [\"Clockwise\", \"Counterclockwise\"],\n    displaySegmentedControl: true,\n    segmentedControlDirection: \"vertical\"\n  },\n  randomize: {\n    type: ControlType.Boolean,\n    defaultValue: true,\n    description: \"Random start angle.\"\n  },\n  startAngle: {\n    type: ControlType.Number,\n    defaultValue: 0,\n    min: -360,\n    max: 360,\n    unit: \"\\xb0\",\n    hidden: props => props.randomize\n  },\n  fill: {\n    type: ControlType.Color,\n    defaultValue: \"#FFF\"\n  },\n  radius: {\n    type: ControlType.FusedNumber,\n    defaultValue: 20,\n    toggleKey: \"radiusIsMixed\",\n    toggleTitles: [\"All\", \"Individual\"],\n    valueKeys: [\"radiusTopLeft\", \"radiusTopRight\", \"radiusBottomRight\", \"radiusBottomLeft\"],\n    valueLabels: [\"TL\", \"TR\", \"BR\", \"BL\"],\n    min: 0\n  }\n});\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"AnimatedGradientBorder\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerSupportedLayoutWidth\": \"fixed\",\n        \"framerSupportedLayoutHeight\": \"fixed\",\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./AnimatedGradientBorder.map"],
  "mappings": "mIAOe,SAARA,EAAwCC,EAAO,CACpD,GAAM,CACJ,WAAAC,EACA,YAAAC,EACA,WAAAC,CACF,EAAIH,EACEI,EAAaJ,EAAM,UAAY,EAAIA,EAAM,WACzCK,EAAQL,EAAM,YACdM,EAAWC,EAAa,QAAQ,IAAMA,EAAa,OACnDC,EAAQC,EAAe,CAACH,GAAYN,EAAM,UAAY,KAAK,OAAO,EAAI,IAAM,CAAC,EACnFU,EAAU,IAAM,CACTJ,GACHK,EAAQH,EAAOA,EAAM,IAAI,GAAKR,EAAM,WAAa,MAAQ,KAAO,KAAM,CACpE,SAAUA,EAAM,SAChB,OAAQ,IACR,KAAM,QACR,CAAC,CAEL,EAAG,CAAC,CAAC,EACL,IAAMY,EAAgBZ,EAAM,YAAc,QAAUA,EAAM,WAAa,MAAQ,GAAGC,QAAiBC,KAAeC,OAAkB,GAAGD,KAAe,IAAMC,SAAkBF,WAAsB,GAAGA,QAAiBC,KAAeC,EAAa,SAASD,KAAe,IAAMC,EAAa,QAAQF,WACvS,OAAoBY,EAAKC,EAAO,IAAK,CACnC,MAAO,CACL,gBAAiBR,EAAW,uBAAuBF,SAAkBQ,KAAmBG,EAAa,CAACP,CAAK,EAAG,CAAC,CAACQ,CAAK,IAAM,uBAAuBZ,EAAaY,SAAaJ,IAAgB,EAC5L,aAAcZ,EAAM,cAAgB,GAAGA,EAAM,m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A,OAAQ,CACN,KAAMA,EAAY,YAClB,aAAc,GACd,UAAW,gBACX,aAAc,CAAC,MAAO,YAAY,EAClC,UAAW,CAAC,gBAAiB,iBAAkB,oBAAqB,kBAAkB,EACtF,YAAa,CAAC,KAAM,KAAM,KAAM,IAAI,EACpC,IAAK,CACP,CACF,CAAC",
  "names": ["AnimatedGradientBorder", "props", "shineColor", "borderColor", "shineRange", "startAngle", "inset", "isCanvas", "RenderTarget", "angle", "useMotionValue", "ue", "animate", "gradientStops", "p", "motion", "useTransform", "value", "addPropertyControls", "ControlType"]
}
