{"version":3,"file":"HeroAnimation.ConSlJCE.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/tHjHtXIyRI8voFUqFW8d/xPalqeeNIdD8b4Gjeihk/HeroAnimation.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,Frame}from\"framer\";import{motion,useAnimationControls}from\"framer-motion\";import{useLayoutEffect,useEffect,useRef,useState}from\"react\";const aspectRatio=1.69115;const Logomark=({baseSize:baseSizeProp,color,sequences,shouldAnimate,zIndex,containerRef})=>{const controls=useAnimationControls();const mounted=useRef(false);const getBaseSize=()=>{if(typeof baseSizeProp===\"number\")return baseSizeProp;// if parent container ref provided, measure its height\nconst el=containerRef?.current;if(el){const{height}=el.getBoundingClientRect();// Fall back to a sensible default if height is 0\nreturn height>0?height/aspectRatio:100;}// Fallback in case something else goes wrong\nreturn 100;};useLayoutEffect(()=>{const initial=getBaseSize();controls.set({height:initial*aspectRatio,width:initial,x:0});mounted.current=true;},[baseSizeProp,containerRef,controls]);useEffect(()=>{if(!shouldAnimate)return;mounted.current=true;async function run(){while(mounted.current){for(const sequence of sequences){if(!mounted.current)break;const[animation,transition,delay]=sequence;const baseSize=getBaseSize();// Calculate pixel-based offset based on the scale\n// Percentage unfortunately doesn't work when using responsive scaling\nconst offsetMultiplier=baseSize*.1;let xOffset=0;if(typeof animation.x===\"string\"){const isNegative=animation.x.startsWith(\"-\");const magnitude=parseFloat(animation.x.replace(/[-%]/g,\"\"));xOffset=(isNegative?-1:1)*magnitude*offsetMultiplier/10;}else{xOffset=animation.x??0;}// Animating scale causes blurry edges, so animate height/width instead\nconst fullAnimation={height:baseSize*animation.scale*aspectRatio,width:baseSize*animation.scale,x:xOffset};await controls.start(fullAnimation,transition);if(!mounted.current)break;await new Promise(resolve=>setTimeout(resolve,delay*1e3));}}}run();return()=>{mounted.current=false;controls.stop();};},[shouldAnimate]);const initialBase=getBaseSize();const initialWidth=initialBase;const initialHeight=initialBase*aspectRatio;const isBackground=zIndex<=1;if(!mounted.current)return null;return /*#__PURE__*/_jsx(motion.div,{animate:controls,initial:{height:initialHeight,width:initialWidth,x:0},style:{alignItems:\"center\",display:\"flex\",justifyContent:\"center\",position:\"absolute\",willChange:\"transform, width, height\"},children:/*#__PURE__*/_jsxs(\"svg\",{fill:\"none\",preserveAspectRatio:\"xMidYMid meet\",viewBox:\"0 0 531 898\",xmlns:\"http://www.w3.org/2000/svg\",style:{display:\"block\",height:\"100%\",stroke:!isBackground?color:undefined,strokeWidth:!isBackground?2:undefined,width:\"100%\"},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M355.972 265.108H192.112L300.602 0H265.567L0 449H266.356L355.972 265.108Z\",fill:color}),/*#__PURE__*/_jsx(\"path\",{d:\"M175.036 632.892L338.896 632.892L230.406 898L265.441 898L531.008 449L264.652 449L175.036 632.892Z\",fill:color})]})});};/**\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 500\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n */export function HeroAnimation({animationSpeed=1,baseSize=100,baseScale=1,primaryColor,responsiveScale=true,secondaryColor}){const[containerSize,setContainerSize]=useState({height:500,width:300});const containerRef=useRef(null);// measuredBaseSize state is set once when we can synchronously measure the container.\n// This ensures the initial render/initial motion dimensions match the parent.\nconst[measuredBaseSize,setMeasuredBaseSize]=useState(undefined);useEffect(()=>{const el=containerRef.current;if(!responsiveScale||!el){setMeasuredBaseSize(baseSize);return;}const{height}=el.getBoundingClientRect();if(height>0){setMeasuredBaseSize(height/aspectRatio);return;}// If height is zero, observe until non-zero\nconst ro=new ResizeObserver(()=>{const{height:h2}=el.getBoundingClientRect();if(h2>0){setMeasuredBaseSize(h2/aspectRatio);ro.disconnect();}});ro.observe(el);return()=>ro.disconnect();},[responsiveScale,baseSize]);const calculatedBaseSize=measuredBaseSize??baseSize;// Adjust timing based on animation speed\nconst delays=[.8/animationSpeed,.8/animationSpeed,.8/animationSpeed];const durations=[2/animationSpeed,2/animationSpeed,2/animationSpeed];const scales=[1*baseScale,.7*baseScale,2.5*baseScale];// Calculate pixel-based offsets that scale properly (percent based offsets did not work)\nconst pixelOffsets=[0,calculatedBaseSize*.016,calculatedBaseSize*.08];const bezierCurve=[.36,0,.01,1];const sequences={primary:[[{scale:scales[0],x:pixelOffsets[0]},{duration:durations[0],ease:bezierCurve},delays[0]],[{scale:scales[1],x:-pixelOffsets[1]},{duration:durations[1],ease:bezierCurve},delays[1]],[{scale:scales[2],x:pixelOffsets[2]},{duration:durations[2],ease:bezierCurve},delays[2]]],secondary:[[{scale:scales[0],x:pixelOffsets[0]},{duration:durations[0],ease:bezierCurve},delays[0]],[{scale:scales[1],x:pixelOffsets[1]},{duration:durations[1],ease:bezierCurve},delays[1]],[{scale:scales[2],x:-pixelOffsets[2]},{duration:durations[2],ease:bezierCurve},delays[2]]]};return /*#__PURE__*/_jsx(Frame,{width:\"100%\",height:\"100%\",background:\"transparent\",children:/*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{alignItems:\"center\",display:\"flex\",height:\"100%\",justifyContent:\"center\",overflow:\"visible\",position:\"relative\",width:\"100%\"},children:[/*#__PURE__*/_jsx(Logomark,{baseSize:calculatedBaseSize,containerRef:containerRef,color:secondaryColor,sequences:sequences.primary,shouldAnimate:measuredBaseSize!==undefined,zIndex:1}),/*#__PURE__*/_jsx(Logomark,{baseSize:calculatedBaseSize,containerRef:containerRef,color:primaryColor,sequences:sequences.secondary,shouldAnimate:measuredBaseSize!==undefined,zIndex:2})]})});}addPropertyControls(HeroAnimation,{primaryColor:{title:\"Primary Color\",type:ControlType.Color,defaultValue:\"#494D5C\"},secondaryColor:{title:\"Secondary Color\",type:ControlType.Color,defaultValue:\"#F0FA73\"},baseSize:{title:\"Base Size\",type:ControlType.Number,defaultValue:100,min:50,max:500,step:10,displayStepper:true},baseScale:{title:\"Base Scale\",type:ControlType.Number,defaultValue:1,min:0,max:10,step:.1,displayStepper:true},responsiveScale:{title:\"Responsive Scale\",type:ControlType.Boolean,defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},animationSpeed:{title:\"Animation Speed\",type:ControlType.Number,defaultValue:1,min:.1,max:3,step:.1,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"HeroAnimation\":{\"type\":\"reactComponent\",\"name\":\"HeroAnimation\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"500\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"300\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HeroAnimation.map"],"mappings":"qQAYG,SAAgB,EAAc,CAAC,iBAAe,EAAE,WAAS,IAAI,YAAU,EAAE,eAAa,kBAAgB,GAAK,kBAAgB,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAS,CAAC,OAAO,IAAI,MAAM,GAAG,CAAC,EAAQ,EAAaC,EAAO,IAAI,EAE/N,CAAC,EAAiB,GAAqBD,EAAS,IAAA,EAAS,EAAE,MAAc,CAAC,IAAM,EAAG,EAAa,QAAQ,GAAG,CAAC,GAAiB,CAAC,EAAG,CAAC,EAAoB,CAAQ,EAAE,MAAO,CAAC,GAAK,CAAC,UAAQ,EAAG,sBAAsB,EAAE,GAAG,EAAO,EAAE,CAAC,EAAoB,EAAO,CAAW,EAAE,MAAO,CAClR,IAAM,EAAG,IAAI,mBAAmB,CAAC,GAAK,CAAC,OAAO,GAAI,EAAG,sBAAsB,EAAK,EAAG,IAAG,EAAoB,EAAG,CAAW,EAAE,EAAG,WAAW,EAAG,CAAC,EAAiB,OAAf,EAAG,QAAQ,CAAE,MAAY,EAAG,WAAW,CAAE,EAAE,CAAC,EAAgB,CAAQ,CAAC,EAAE,IAAM,EAAmB,GAAkB,EAC1P,EAAO,CAAC,GAAG,EAAe,GAAG,EAAe,GAAG,CAAc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