{"version":3,"file":"ColorCycle.pkgRUPoF.mjs","names":["n"],"sources":["https:/ga.jspm.io/npm:@motionone/easing@10.18.0/dist/index.es.js","https:/framerusercontent.com/modules/cKGD16u2MGB7MfqfVXFp/wiztTCbXokZrMicHAmZc/Grain.js","https:/framerusercontent.com/modules/dXMoFu7V9NbxJuWGeX9h/8zU7so8TlI4oIVv2mQOr/ColorCycle.js"],"sourcesContent":["import{noopReturn as t,clamp as n}from\"@motionone/utils\";const calcBezier=(t,n,e)=>(((1-3*e+3*n)*t+(3*e-6*n))*t+3*n)*t;const e=1e-7;const i=12;function binarySubdivide(t,n,o,r,c){let u;let a;let s=0;do{a=n+(o-n)/2;u=calcBezier(a,r,c)-t;u>0?o=a:n=a}while(Math.abs(u)>e&&++s<i);return a}function cubicBezier(n,e,i,o){if(n===e&&i===o)return t;const getTForX=t=>binarySubdivide(t,0,1,n,i);return t=>t===0||t===1?t:calcBezier(getTForX(t),e,o)}const steps=(t,e=\"end\")=>i=>{i=e===\"end\"?Math.min(i,.999):Math.max(i,.001);const o=i*t;const r=e===\"end\"?Math.floor(o):Math.ceil(o);return n(0,1,r/t)};export{cubicBezier,steps};\n//# sourceMappingURL=index.es.js.map\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion}from\"framer-motion\";import{steps}from\"@motionone/easing\";/**\n * @framerIntrinsicWidth 100\n * @framerIntrinsicHeight 100\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */ export default function Grain(props){const{opacity,style}=props;const keyframesX=[\"0%\",\"-5%\",\"-15%\",\"7%\",\"-5%\",\"-15%\",\"15%\",\"0%\",\"3%\",\"-10%\",];const keyframesY=[\"0%\",\"-10%\",\"5%\",\"-25%\",\"25%\",\"10%\",\"0%\",\"15%\",\"35%\",\"10%\",];const isCanvas=RenderTarget.current()===RenderTarget.canvas;return /*#__PURE__*/ _jsx(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/ _jsx(motion.div,{style:{...containerStyle,opacity:opacity,inset:isCanvas?0:\"-200%\",width:isCanvas?\"100%\":\"400%\",height:isCanvas?\"100%\":\"400%\",position:\"absolute\"},animate:!isCanvas&&{x:keyframesX,y:keyframesY},transition:{ease:steps(10,\"start\"),repeat:Infinity,duration:8}})});};Grain.defaultProps={opacity:.5};addPropertyControls(Grain,{opacity:{title:\"Opacity\",type:ControlType.Number,step:.1,displayStepper:true,max:1,min:0}});const containerStyle={backgroundSize:\"256px 256px\",backgroundRepeat:\"repeat\",background:\"url('https://framerusercontent.com/images/rR6HYXBrMmX4cRpXfXUOvpvpB0.png')\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Grain\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"100\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"100\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Grain.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,Color}from\"framer\";import{motion}from\"framer-motion\";/**\n * COLOR CYCLE\n * By Benjamin den Boer\n *\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */ export default function ColorCycle(props){const{colors,radius,randomStart,animOptions,animRepeat,animPause}=props;let shuffledColors=colors;colors.push(colors[0]);if(randomStart){shuffledColors=colors.map(value=>({value,sort:Math.random()})).sort((a,b)=>a.sort-b.sort).map(({value})=>Color.toHslString(Color(value)));shuffledColors.push(shuffledColors[0]);}return /*#__PURE__*/ _jsx(motion.div,{style:{width:\"100%\",height:\"100%\",backgroundColor:shuffledColors[0],borderRadius:radius,willChange:\"background-color\"},animate:{backgroundColor:[...shuffledColors]},transition:{...animOptions,repeat:animRepeat&&Infinity,repeatType:animRepeat&&\"loop\",repeatDelay:animPause}});};ColorCycle.defaultProps={radius:0,colors:[\"#0CF\",\"#2DD\",\"#F64\",\"#99F\"],randomStart:false,animOptions:{type:\"tween\",ease:[0,0,1,1],duration:1},animRepeat:true,animPause:0};ColorCycle.displayName=\"Color Cycle\";addPropertyControls(ColorCycle,{radius:{type:ControlType.Number,min:0,max:1e3,step:1,displayStepper:true,defaultValue:0},colors:{type:ControlType.Array,control:{type:ControlType.Color},defaultValue:ColorCycle.defaultProps.colors},animOptions:{type:ControlType.Transition,title:\"Transition\",defaultValue:ColorCycle.defaultProps.animOptions},randomStart:{type:ControlType.Boolean,title:\"Randomize\",defaultValue:ColorCycle.defaultProps.randomStart},animRepeat:{type:ControlType.Boolean,title:\"Repeat\",defaultValue:ColorCycle.defaultProps.animRepeat},animPause:{type:ControlType.Number,title:\"Pause\",min:0,max:10,displayStepper:true,step:1,defaultValue:ColorCycle.defaultProps.animPause}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ColorCycle\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"200\",\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ColorCycle.map"],"mappings":"oaAAyD,CAAmY,GAAO,EAAE,EAAE,QAAQ,GAAG,CAAC,EAAE,IAAI,MAAM,KAAK,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,EAAE,KAAK,CAAC,IAAM,EAAE,EAAE,EAA+C,OAAOA,EAAE,EAAE,GAAhD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC,KAAK,KAAK,EAAE,EAAgB,EAAE,K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