{"version":3,"file":"HalfMarkAnimation.h5YxADkK.mjs","names":["useRef","useState","useMemo","height","width"],"sources":["https:/framerusercontent.com/modules/l1QYv6tQJq7bMBUcZnwF/QM3dGSsFLG2TTjZa5hGA/HalfMarkAnimation.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,Frame}from\"framer\";import{motion,useAnimate}from\"framer-motion\";import{useEffect,useLayoutEffect,useMemo,useRef,useState}from\"react\";const aspectRatio=1.69115;const Logomark=({baseSize,color,role,zIndex})=>{const isBackground=zIndex<=1;return /*#__PURE__*/_jsx(motion.div,{\"data-role\":role,style:{alignItems:\"center\",display:\"flex\",height:baseSize*aspectRatio,justifyContent:\"center\",position:\"absolute\",width:baseSize,willChange:\"transform, width, height\"},children:/*#__PURE__*/_jsx(\"svg\",{fill:\"none\",preserveAspectRatio:\"xMidYMid meet\",viewBox:\"0 0 184 232\",xmlns:\"http://www.w3.org/2000/svg\",style:{display:\"block\",height:\"50%\",stroke:!isBackground?color:undefined,width:\"50%\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M184 136.982H99.3016L155.379 0H137.27L0 232H137.678L184 136.982Z\",fill:color})})});};/**\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 500\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerDisableUnlink\n */export function HalfMarkAnimation({animationSpeed=5,baseSize=100,baseScale=1,primaryColor,responsiveScale=true,secondaryColor}){const containerRef=useRef(null);const[scope,animate]=useAnimate();// 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);useLayoutEffect(()=>{const el=containerRef.current;if(!responsiveScale||!el){setMeasuredBaseSize(baseSize);return;}// Initial measurement\nconst{height}=el.getBoundingClientRect();if(height>0){setMeasuredBaseSize(height/aspectRatio);}// Keep observing for changes\nconst ro=new ResizeObserver(()=>{const{height:h2}=el.getBoundingClientRect();if(h2>0){setMeasuredBaseSize(h2/aspectRatio);}});ro.observe(el);return()=>ro.disconnect();},[responsiveScale,baseSize]);/**\n     * Setup animation sequences based on current container size\n     */const calculatedBaseSize=measuredBaseSize??baseSize;const sequences=useMemo(()=>{// Some magic numbers here, they work for the responsive scale.\nconst baseHeight=calculatedBaseSize*aspectRatio;const heightOffset=baseHeight*.372;const halfWidth=calculatedBaseSize/4;const xOffset=halfWidth/2;const secondaryOffset=calculatedBaseSize*.04;const steps=5;const delays=new Array(steps).fill(.8/animationSpeed);const durations=new Array(steps).fill(2/animationSpeed);const scales=[1,1.5,1.5,1,1];const scaleOffsets=[0,-xOffset,-xOffset,0,0];const ease=[.36,0,.01,1];const sequence=[];for(let i=0;i<steps;i++){const scale=scales[i]??1;const delay=delays[i]??.8/animationSpeed;const duration=durations[i]??2/animationSpeed;const scaleOffset=scaleOffsets[i]??0;const height=baseHeight*scale;const width=calculatedBaseSize*scale;/**\n             * Primary Animation loop\n             */let primaryX=-halfWidth;let primaryY=0;switch(i){case 3:primaryX=-xOffset;primaryY=-heightOffset/2;break;}sequence.push(['[data-role=\"primary\"]',{height,width,x:primaryX+scaleOffset,y:primaryY},{at:i===0?0:`+${delay}`,duration,ease}]);sequence.push(['[data-role=\"bg-primary\"]',{height,width,x:primaryX-secondaryOffset+scaleOffset,y:primaryY},{at:i===0?0:`<`,duration,ease}]);/**\n             * Secondary Animation loop\n             */let rotate=0;let secondaryX=halfWidth;let secondaryY=0;let secondaryBgOffset=secondaryOffset;switch(i){case 1:rotate=-180;break;case 2:rotate=-360;break;case 3:rotate=-180;secondaryX=xOffset;secondaryY=heightOffset/2;secondaryBgOffset=-secondaryBgOffset;break;}sequence.push(['[data-role=\"secondary\"]',{height,rotate,width,x:secondaryX+-scaleOffset,y:secondaryY},{at:\"<\",duration,ease}]);sequence.push(['[data-role=\"bg-secondary\"]',{height,rotate,width,x:secondaryX-secondaryBgOffset+-scaleOffset,y:secondaryY},{at:\"<\",duration,ease}]);}const height=baseHeight;const width=calculatedBaseSize;// Make sure the initial state is set correctly\nconst setup=[['[data-role=\"primary\"]',{height,width,x:-halfWidth,y:0},{at:0,duration:0}],['[data-role=\"bg-primary\"]',{height,width,x:-halfWidth-secondaryOffset,y:0},{at:0,duration:0}],['[data-role=\"secondary\"]',{height,rotate:0,width,x:halfWidth,y:0},{at:0,duration:0}],['[data-role=\"bg-secondary\"]',{height,rotate:0,width,x:halfWidth-secondaryOffset,y:0},{at:0,duration:0}]];return[...setup,...sequence];},[animationSpeed,calculatedBaseSize]);useEffect(()=>{if(measuredBaseSize===undefined)return;// run the whole timeline, loop forever, need to add the initial state to loop nicely\nconst controls=animate(sequences,{repeat:Infinity,repeatDelay:0});return()=>{controls?.cancel();};},[animate,animationSpeed,measuredBaseSize,sequences]);return /*#__PURE__*/_jsx(Frame,{width:\"100%\",height:\"100%\",background:\"transparent\",children:/*#__PURE__*/_jsx(\"div\",{ref:scope,style:{alignItems:\"center\",display:\"flex\",height:\"100%\",justifyContent:\"center\",overflow:\"visible\",position:\"relative\",width:\"100%\"},children:/*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{alignItems:\"center\",display:\"flex\",height:`${100*baseScale}%`,justifyContent:\"center\",overflow:\"visible\",position:\"relative\",width:`${100*baseScale}%`},children:[/*#__PURE__*/_jsx(Logomark,{baseSize:calculatedBaseSize,color:secondaryColor,role:\"primary\",zIndex:1}),/*#__PURE__*/_jsx(Logomark,{baseSize:calculatedBaseSize,color:primaryColor,role:\"bg-primary\",zIndex:2}),/*#__PURE__*/_jsx(Logomark,{baseSize:calculatedBaseSize,color:secondaryColor,role:\"secondary\",zIndex:1}),/*#__PURE__*/_jsx(Logomark,{baseSize:calculatedBaseSize,color:primaryColor,role:\"bg-secondary\",zIndex:2})]})})});}addPropertyControls(HalfMarkAnimation,{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\":{\"HalfMarkAnimation\":{\"type\":\"reactComponent\",\"name\":\"HalfMarkAnimation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"300\",\"framerIntrinsicHeight\":\"500\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HalfMarkAnimation.map"],"mappings":"4QAMG,SAAgB,EAAkB,CAAC,iBAAe,EAAE,WAAS,IAAI,YAAU,EAAE,eAAa,kBAAgB,GAAK,kBAAgB,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAM,CAAC,EAAM,GAAS,GAAY,CAE/L,CAAC,EAAiB,GAAqBC,EAAS,IAAA,GAAU,CAAC,MAAoB,CAAC,IAAM,EAAG,EAAa,QAAQ,GAAG,CAAC,GAAiB,CAAC,EAAG,CAAC,EAAoB,EAAS,CAAC,OAC3K,GAAK,CAAC,UAAQ,EAAG,uBAAuB,CAAI,EAAO,GAAG,EAAoB,EAAO,EAAY,CAC7F,IAAM,EAAG,IAAI,mBAAmB,CAAC,GAAK,CAAC,OAAO,GAAI,EAAG,uBAAuB,CAAI,EAAG,GAAG,EAAoB,EAAG,EAAY,EAAI,CAAgB,OAAf,EAAG,QAAQ,EAAG,KAAW,EAAG,YAAY,EAAG,CAAC,EAAgB,EAAS,CAAC,CAE7L,IAAM,EA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