{"version":3,"file":"TextCycle.DNEdeHva.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/AcVVTB2fjT9j5nKEMmgs/r5ofTtt13b8MMMhh7LS1/TextCycle.js"],"sourcesContent":["// Text cycle component with slide up and fade animation between static text items\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion,AnimatePresence}from\"framer-motion\";import{useState,useEffect,startTransition,useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function TextCycle(props){const{staticText=\"Hello\",texts=[{text:\"First Text\",image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image 1\"},font:{fontSize:\"40px\",fontWeight:700,letterSpacing:\"-0.04em\",lineHeight:\"1em\"},color:\"#000000\",useGradient:false,gradientColor1:\"#FF0080\",gradientColor2:\"#7928CA\",gradientDirection:90},{text:\"Second Text\",image:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Image 2\"},font:{fontSize:\"40px\",fontWeight:700,letterSpacing:\"-0.04em\",lineHeight:\"1em\"},color:\"#000000\",useGradient:false,gradientColor1:\"#FF0080\",gradientColor2:\"#7928CA\",gradientDirection:90},{text:\"Third Text\",image:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Image 3\"},font:{fontSize:\"40px\",fontWeight:700,letterSpacing:\"-0.04em\",lineHeight:\"1em\"},color:\"#000000\",useGradient:false,gradientColor1:\"#FF0080\",gradientColor2:\"#7928CA\",gradientDirection:90}],interval=2e3,staticTextColor=\"#000000\",staticFont,centerAlign=false,gap=8,cycleGap=12,imageSize=32,animationSpeed=.5,tag=\"h2\",padding={paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0}}=props;const[currentIndex,setCurrentIndex]=useState(0);useEffect(()=>{const timer=setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%texts.length);});},interval);return()=>clearInterval(timer);},[interval,texts.length]);// Memoize current item to prevent unnecessary re-renders\nconst currentItem=useMemo(()=>texts[currentIndex],[texts,currentIndex]);// Memoize text style calculation\nconst textStyle=useMemo(()=>{const style={margin:0,...currentItem?.font};if(currentItem?.useGradient){style.background=`linear-gradient(${currentItem.gradientDirection}deg, ${currentItem.gradientColor1}, ${currentItem.gradientColor2})`;style.WebkitBackgroundClip=\"text\";style.WebkitTextFillColor=\"transparent\";style.backgroundClip=\"text\";}else{style.color=currentItem?.color||\"#000000\";}return style;},[currentItem]);// Memoize static text parts\nconst{firstPart,lastWord}=useMemo(()=>{const staticTextParts=staticText.split(\" \");return{lastWord:staticTextParts[staticTextParts.length-1],firstPart:staticTextParts.slice(0,-1).join(\" \")};},[staticText]);// Memoize static font style\nconst staticFontStyle=useMemo(()=>({margin:0,color:staticTextColor,whiteSpace:\"nowrap\",...staticFont}),[staticTextColor,staticFont]);const Tag=tag;return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:centerAlign?\"center\":\"flex-start\",gap:`${gap}px`,width:\"100%\",height:\"100%\",paddingTop:`${padding.paddingTop}px`,paddingRight:`${padding.paddingRight}px`,paddingBottom:`${padding.paddingBottom}px`,paddingLeft:`${padding.paddingLeft}px`},children:[/*#__PURE__*/_jsx(Tag,{style:{margin:0,color:staticTextColor,whiteSpace:\"nowrap\",...staticFont},children:firstPart}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",display:\"flex\",alignItems:\"center\",gap:`${cycleGap}px`},children:[/*#__PURE__*/_jsx(Tag,{style:{margin:0,color:staticTextColor,whiteSpace:\"nowrap\",...staticFont},children:lastWord}),/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsxs(motion.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:animationSpeed,ease:\"easeInOut\"},style:{display:\"flex\",alignItems:\"center\",gap:\"12px\",whiteSpace:\"nowrap\"},children:[currentItem?.image&&/*#__PURE__*/_jsx(\"img\",{src:currentItem.image.src,alt:currentItem.image.alt||\"\",style:{width:`${imageSize}px`,height:`${imageSize}px`,objectFit:\"cover\",borderRadius:\"4px\"}}),/*#__PURE__*/_jsx(Tag,{style:textStyle,children:currentItem?.text})]},currentIndex)})]})]});}addPropertyControls(TextCycle,{staticText:{type:ControlType.String,title:\"Static Text\",defaultValue:\"Hello\"},tag:{type:ControlType.Enum,title:\"HTML Tag\",options:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"p\",\"span\",\"div\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"H6\",\"Paragraph\",\"Span\",\"Div\"],defaultValue:\"h2\"},texts:{type:ControlType.Array,title:\"Texts\",control:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Text\"},image:{type:ControlType.ResponsiveImage,title:\"Image\"},useGradient:{type:ControlType.Boolean,title:\"Use Gradient\",defaultValue:false,enabledTitle:\"Gradient\",disabledTitle:\"Solid\"},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\",hidden:({useGradient})=>useGradient===true},gradientColor1:{type:ControlType.Color,title:\"Gradient Start\",defaultValue:\"#FF0080\",hidden:({useGradient})=>useGradient!==true},gradientColor2:{type:ControlType.Color,title:\"Gradient End\",defaultValue:\"#7928CA\",hidden:({useGradient})=>useGradient!==true},gradientDirection:{type:ControlType.Number,title:\"Gradient Angle\",defaultValue:90,min:0,max:360,step:1,unit:\"deg\",hidden:({useGradient})=>useGradient!==true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}}},defaultValue:[{text:\"First Text\",image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image 1\"},font:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},color:\"#000000\",useGradient:false,gradientColor1:\"#FF0080\",gradientColor2:\"#7928CA\",gradientDirection:90},{text:\"Second Text\",image:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Image 2\"},font:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},color:\"#000000\",useGradient:false,gradientColor1:\"#FF0080\",gradientColor2:\"#7928CA\",gradientDirection:90},{text:\"Third Text\",image:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Image 3\"},font:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},color:\"#000000\",useGradient:false,gradientColor1:\"#FF0080\",gradientColor2:\"#7928CA\",gradientDirection:90}]},interval:{type:ControlType.Number,title:\"Interval\",defaultValue:2e3,min:500,max:1e4,step:100,unit:\"ms\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:8,min:0,max:100,step:1,unit:\"px\"},cycleGap:{type:ControlType.Number,title:\"Cycle Gap\",defaultValue:12,min:0,max:100,step:1,unit:\"px\"},imageSize:{type:ControlType.Number,title:\"Image Size\",defaultValue:32,min:12,max:100,step:1,unit:\"px\"},animationSpeed:{type:ControlType.Number,title:\"Animation Speed\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\"},padding:{type:ControlType.Object,title:\"Padding\",controls:{paddingTop:{type:ControlType.Number,title:\"Top\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},paddingRight:{type:ControlType.Number,title:\"Right\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},paddingBottom:{type:ControlType.Number,title:\"Bottom\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"},paddingLeft:{type:ControlType.Number,title:\"Left\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"}},defaultValue:{paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0}},staticTextColor:{type:ControlType.Color,title:\"Static Text Color\",defaultValue:\"#000000\"},centerAlign:{type:ControlType.Boolean,title:\"Center Align\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},staticFont:{type:ControlType.Font,title:\"Static Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextCycle\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextCycle.map"],"mappings":"8PAIG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,aAAW,QAAQ,QAAM,CAAC,CAAC,KAAK,aAAa,MAAM,CAAC,IAAI,sEAAsE,IAAI,UAAU,CAAC,KAAK,CAAC,SAAS,OAAO,WAAW,IAAI,cAAc,UAAU,WAAW,MAAM,CAAC,MAAM,UAAU,YAAY,GAAM,eAAe,UAAU,eAAe,UAAU,kBAAkB,GAAG,CAAC,CAAC,KAAK,cAAc,MAAM,CAAC,IAAI,oEAAoE,IAAI,UAAU,CAAC,KAAK,CAAC,SAAS,OAAO,WAAW,IAAI,cAAc,UAAU,WAAW,MAAM,CAAC,MAAM,UAAU,YAAY,GAAM,eAAe,UAAU,eAAe,UAAU,kBAAkB,GAAG,CAAC,CAAC,KAAK,aAAa,MAAM,CAAC,IAAI,uEAAuE,IAAI,UAAU,CAAC,KAAK,CAAC,SAAS,OAAO,WAAW,IAAI,cAAc,UAAU,WAAW,MAAM,CAAC,MAAM,UAAU,YAAY,GAAM,eAAe,U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