{"version":3,"file":"TextShimmer_Prod.DbBNfhVB.mjs","names":["useRef","useRef"],"sources":["https:/framerusercontent.com/modules/HO5quIEBUDTklhzDdpJE/yGoKewNoGdutcOA3Xu8D/MyAnimatedPath.js","https:/framerusercontent.com/modules/TS5bPiMUGtjrWMUlvKp9/AciUHRnNOn8057WveTGJ/TextShimmer_Prod.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";function easeIn(t){return t*t;}function easeOut(t){const p=t-1;return 1-p*p;}function easeInOut(t){return t<.5?2*t*t:-1+(4-2*t)*t;}function linearEasing(t){return t;}/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export function MyAnimatedPath({pathData,duration,color,size,loop,showPath,pathColor,pathThickness,easingType,borderRadius,mirror}){const graphicRef=useRef(null);const containerRef=useRef(null);useEffect(()=>{const svgNamespace=\"http://www.w3.org/2000/svg\";const tempSvg=document.createElementNS(svgNamespace,\"svg\");const newPath=document.createElementNS(svgNamespace,\"path\");newPath.setAttribute(\"d\",pathData);tempSvg.appendChild(newPath);document.body.appendChild(tempSvg);const pathLength=newPath.getTotalLength();document.body.removeChild(tempSvg);let startTime=null;let animationFrameID=null;const easingFunction={linear:linearEasing,easeIn:easeIn,easeOut:easeOut,easeInOut:easeInOut}[easingType]||linearEasing;const animate=timestamp=>{if(!startTime)startTime=timestamp;const elapsedTime=timestamp-startTime;let progress=elapsedTime/(duration*1e3);if(loop&&progress>=1){if(mirror){const cycle=Math.floor(progress);const cycleProgress=progress-cycle;progress=cycle%2===0?cycleProgress:1-cycleProgress;}else{startTime=timestamp-elapsedTime%(duration*1e3);progress%=1;}}progress=Math.min(progress,1);const easedProgress=easingFunction(progress);const point=newPath.getPointAtLength(easedProgress*pathLength);const offsetX=point.x-size/2;const offsetY=point.y-size/2;if(graphicRef.current){graphicRef.current.style.transform=`translate(${offsetX}px, ${offsetY}px)`;}if(progress<1||loop){animationFrameID=requestAnimationFrame(animate);}};animationFrameID=requestAnimationFrame(animate);return()=>{if(animationFrameID){cancelAnimationFrame(animationFrameID);}};},[pathData,duration,loop,size,easingType,mirror]);const containerStyle={position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"visible\"};const svgStyle={position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"visible\",pointerEvents:\"none\"};const graphicStyle={position:\"absolute\",width:`${size}px`,height:`${size}px`,backgroundColor:color,borderRadius:`${borderRadius}%`,boxSizing:\"border-box\",willChange:\"transform\"};return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:containerStyle,children:[showPath&&/*#__PURE__*/_jsx(\"svg\",{style:svgStyle,children:/*#__PURE__*/_jsx(\"path\",{d:pathData,fill:\"none\",stroke:pathColor,strokeWidth:pathThickness})}),/*#__PURE__*/_jsx(motion.div,{ref:graphicRef,style:graphicStyle,initial:{scale:0},animate:{scale:1},whileHover:{scale:1.2}})]});}MyAnimatedPath.defaultProps={pathData:\"M10 80 Q 95 10 180 80\",duration:2,color:\"#3B82F6\",size:20,loop:true,showPath:true,pathColor:\"#000000\",pathThickness:2,easingType:\"linear\",borderRadius:50,mirror:false};addPropertyControls(MyAnimatedPath,{pathData:{type:ControlType.String,title:\"Path Data\",defaultValue:\"M10 80 Q 95 10 180 80\",displayTextArea:true},duration:{type:ControlType.Number,title:\"Duration\",min:.1,max:30,step:.1,defaultValue:2,unit:\"s\"},color:{type:ControlType.Color,title:\"Object Color\",defaultValue:\"#3B82F6\"},size:{type:ControlType.Number,title:\"Object Size\",min:1,max:100,step:1,defaultValue:20,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",min:0,max:100,step:1,defaultValue:50,unit:\"%\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true,enabledTitle:\"Enabled\",disabledTitle:\"Disabled\"},mirror:{type:ControlType.Boolean,title:\"Mirror Loop\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\",hidden:props=>!props.loop},showPath:{type:ControlType.Boolean,title:\"Show Path\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},pathColor:{type:ControlType.Color,title:\"Path Color\",defaultValue:\"#000000\",hidden:props=>!props.showPath},pathThickness:{type:ControlType.Number,title:\"Path Thickness\",min:.5,max:20,step:.5,defaultValue:2,unit:\"px\",hidden:props=>!props.showPath},easingType:{type:ControlType.Enum,title:\"Easing Type\",options:[\"linear\",\"easeIn\",\"easeOut\",\"easeInOut\"],optionTitles:[\"Linear\",\"Ease In\",\"Ease Out\",\"Ease In Out\"],defaultValue:\"linear\",description:\"v1.1 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"MyAnimatedPath\":{\"type\":\"reactComponent\",\"name\":\"MyAnimatedPath\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MyAnimatedPath.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";function getUniqueClassName(){return\"text-shimmer-\"+Math.random().toString(36).substr(2,9);}/**\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n *\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function TextShimmer({font,content,color,shimmer,size,speed,userSelect,rotation,delay,tag,direction}){const classNameRef=useRef(getUniqueClassName());const Tag=tag;const backgroundSize=`200% 200%`;const speedFormatted=11-speed;const gradientFirst=50-size*(50-20)/100;const gradientLast=50+size*(80-50)/100;const animationDuration=speedFormatted+delay;// Calculate keyframes\nconst startPos=direction===\"left\"?\"-100%\":\"200%\";const endPos=direction===\"left\"?\"200%\":\"-100%\";const keyframes=`\n        @keyframes shimmer-${classNameRef.current} {\n            0%, ${delay/animationDuration*100}% {\n                background-position: ${startPos};\n            }\n            100% {\n                background-position: ${endPos};\n            }\n        }\n    `;// Inject style tag once per instance\nuseEffect(()=>{const styleId=`shimmer-style-${classNameRef.current}`;let styleEl=document.getElementById(styleId);if(!styleEl){styleEl=document.createElement(\"style\");styleEl.id=styleId;document.head.appendChild(styleEl);}styleEl.innerHTML=`\n            ${keyframes}\n            .${classNameRef.current} {\n                background: linear-gradient(\n                    ${rotation}deg,\n                    transparent 0%,\n                    transparent ${gradientFirst}%,\n                    ${shimmer} 50%,\n                    transparent ${gradientLast}%,\n                    transparent 100%\n                );\n                -webkit-background-size: ${backgroundSize};\n                -moz-background-size: ${backgroundSize};\n                background-size: ${backgroundSize};\n                -webkit-background-clip: text;\n                -moz-background-clip: text;\n                background-clip: text;\n                background-repeat: no-repeat;\n                animation: shimmer-${classNameRef.current} ${animationDuration}s linear infinite;\n            }\n        `;return()=>{if(styleEl&&styleEl.parentNode){styleEl.parentNode.removeChild(styleEl);}};},[shimmer,rotation,gradientFirst,gradientLast,backgroundSize,animationDuration,delay,direction,keyframes]);return /*#__PURE__*/_jsxs(\"div\",{style:{userSelect:userSelect?\"auto\":\"none\",position:\"relative\"},children:[/*#__PURE__*/_jsx(Tag,{style:{...font,color,marginBlockStart:\"0px\",marginBlockEnd:\"0px\"},children:content}),/*#__PURE__*/_jsx(Tag,{\"aria-hidden\":\"true\",className:classNameRef.current,style:{...font,color:\"transparent\",position:\"absolute\",top:0,left:0,right:0,bottom:0,zIndex:1,marginBlockStart:\"0px\",marginBlockEnd:\"0px\",pointerEvents:\"none\"},children:content})]});}TextShimmer.displayName=\"Text Shimmer\";addPropertyControls(TextShimmer,{font:{type:ControlType.Font,title:\"Font\",defaultValue:\"Inter\",controls:\"extended\"},content:{type:ControlType.String,title:\"Content\",defaultValue:\"Learn Framer With Framer University\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFFFFF1A\"},shimmer:{type:ControlType.Color,title:\"Shimmer\",defaultValue:\"#ffffff\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:30,step:1,max:100,min:1},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:5,max:10,min:1,step:1},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"left\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],displaySegmentedControl:true,segmentedControlDirection:\"horizontal\",optionIcons:[\"direction-left\",\"direction-right\"]},userSelect:{title:\"User Select\",type:ControlType.Boolean,defaultValue:false},rotation:{type:ControlType.Number,title:\"Rotation\",defaultValue:90,min:45,unit:\"\\xb0\",max:135,step:1},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:0,min:0,max:10,step:.1},tag:{type:ControlType.Enum,title:\"Tag\",defaultValue:\"p\",displaySegmentedControl:true,segmentedControlDirection:\"horizontal\",options:[\"h1\",\"h2\",\"h3\",\"p\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"P\"],description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextShimmer\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextShimmer_Prod.map"],"mappings":"0OAAmL,SAAS,EAAO,EAAE,CAAC,OAAO,EAAE,CAAE,CAAC,SAAS,EAAQ,EAAE,CAAC,IAAM,EAAE,EAAE,EAAE,MAAO,GAAE,EAAE,CAAE,CAAC,SAAS,EAAU,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,CAAE,CAAC,SA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