{"version":3,"file":"TextShimmer.Cnodycwm.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/AmICnzVRISQblXSestDv/BTEv1fIrDczWwJQDEUB9/TextShimmer.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{motion,useAnimation,useInView}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useEffect}from\"react\";export default function TextShimmerOnce(props){const{text,font,defaultColor,animColorStart,animColorHighlight,animColorEnd,duration,shimmerWidth,repeatMode,repeatDelay,repeatCount}=props;const ref=useRef(null);const isInView=useInView(ref,{once:true});const controls=useAnimation();useEffect(()=>{if(isInView){controls.start(\"visible\");}},[isInView,controls]);const align=font?.textAlign||\"center\";const justifyContent=align===\"left\"?\"flex-start\":align===\"right\"?\"flex-end\":\"center\";// Resolve repeat settings\nconst resolvedRepeat=repeatMode===\"never\"?0:repeatMode===\"forever\"?Infinity:Math.max(0,(repeatCount??1)-1)// \"times\" means total plays\n;const gradientWidth=shimmerWidth;const gradient=`linear-gradient(\n        105deg,\n        ${defaultColor} 0%,\n        ${defaultColor} calc(50% - ${gradientWidth/2}%),\n        ${animColorStart} calc(50% - ${gradientWidth/3}%),\n        ${animColorHighlight} 50%,\n        ${animColorEnd} calc(50% + ${gradientWidth/3}%),\n        ${defaultColor} calc(50% + ${gradientWidth/2}%),\n        ${defaultColor} 100%\n    )`;const containerVariants={hidden:{backgroundPosition:\"-150% center\"},visible:{backgroundPosition:\"250% center\",transition:{duration:duration,ease:[.4,0,.2,1],repeat:resolvedRepeat,repeatDelay:repeatMode!==\"never\"?repeatDelay:0,repeatType:\"loop\"}}};return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:justifyContent,alignItems:\"center\"},children:/*#__PURE__*/_jsx(motion.div,{variants:containerVariants,initial:\"hidden\",animate:controls,style:{...font,display:\"block\",width:\"100%\",// The shimmer is achieved via background-clip: text\nbackground:gradient,backgroundSize:\"300% 100%\",WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",color:\"transparent\",// Ensure crisp rendering\nwillChange:\"background-position\"},children:text})});}addPropertyControls(TextShimmerOnce,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Shimmer Effect\",displayTextArea:true},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\",defaultValue:{fontSize:40,textAlign:\"center\",lineHeight:1.2,letterSpacing:\"0em\"}},defaultColor:{type:ControlType.Color,title:\"Base Color\",defaultValue:\"#888888\"},animColorStart:{type:ControlType.Color,title:\"Anim Start\",defaultValue:\"#ff0088\"},animColorHighlight:{type:ControlType.Color,title:\"Anim Mid\",defaultValue:\"#ffffff\"},animColorEnd:{type:ControlType.Color,title:\"Anim End\",defaultValue:\"#ff0088\"},duration:{type:ControlType.Number,title:\"Flow Time\",defaultValue:2,min:.1,max:20,step:.1,unit:\"s\",displayStepper:true},shimmerWidth:{type:ControlType.Number,title:\"Shimmer Width\",defaultValue:40,min:5,max:100,step:5,unit:\"%\",displayStepper:true,description:\"Width of the shimmer band as % of text\"},repeatMode:{type:ControlType.Enum,title:\"Repeat\",defaultValue:\"never\",options:[\"never\",\"times\",\"forever\"],optionTitles:[\"Once\",\"N Times\",\"Forever\"],displaySegmentedControl:true},repeatCount:{type:ControlType.Number,title:\"Play Count\",defaultValue:3,min:1,max:100,step:1,displayStepper:true,hidden:props=>props.repeatMode!==\"times\"},repeatDelay:{type:ControlType.Number,title:\"Repeat Delay\",defaultValue:1,min:0,max:20,step:.1,unit:\"s\",displayStepper:true,hidden:props=>props.repeatMode===\"never\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextShimmerOnce\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextShimmer.map"],"mappings":"gPAA4L,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC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