{"version":3,"file":"TextCycle_1.DoyCIpX0.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/sRQdbDIOJwkVCS6UmihB/iuztHhwATGo9y3QpP8ob/TextCycle_1.js"],"sourcesContent":["// Text cycle animation loop with smooth fade-in and fade-out effect\n// Text cycles smoothly from bottom to top\n// Fully customizable text styles including custom breakpoint styles\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition,useMemo}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function TextCycle(props){const{texts=[\"passive house\",\"volume\",\"renovation\",\"extension\",\"luxury home\",\"custom home\"],duration=2e3,fadeInDuration=.5,fadeOutDuration=.5,slideDistance=20,textColor=\"#000000\",font,fontL,fontM,fontS,fontXS,breakpointL=1024,breakpointM=768,breakpointS=480,breakpointXS=0,positionType=\"relative\",top,left,right,bottom,zIndex,style}=props;const[currentIndex,setCurrentIndex]=useState(0);const[windowWidth,setWindowWidth]=useState(typeof window!==\"undefined\"?window.innerWidth:1200);const isStatic=useIsStaticRenderer();// Set initial window width before paint to avoid layout shift\nuseEffect(()=>{if(typeof window===\"undefined\")return;// Immediately set the correct window width on mount\nsetWindowWidth(window.innerWidth);const handleResize=()=>{startTransition(()=>{setWindowWidth(window.innerWidth);});};window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);},[]);useEffect(()=>{if(isStatic||texts.length<=1)return;const interval=setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%texts.length);});},duration);return()=>clearInterval(interval);},[duration,texts.length,isStatic]);const currentText=useMemo(()=>{return texts[currentIndex]||\"Add text...\";},[texts,currentIndex]);const activeFont=useMemo(()=>{// Custom breakpoints: XS < breakpointS, S < breakpointM, M < breakpointL, L >= breakpointL\nif(windowWidth<breakpointS)return fontXS||fontS||fontM||fontL||font;if(windowWidth<breakpointM)return fontS||fontM||fontL||font;if(windowWidth<breakpointL)return fontM||fontL||font;return fontL||font;},[windowWidth,font,fontL,fontM,fontS,fontXS,breakpointL,breakpointM,breakpointS,currentIndex]);const positionStyles=useMemo(()=>{const styles={position:positionType};if(top!==undefined)styles.top=top;if(left!==undefined)styles.left=left;if(right!==undefined)styles.right=right;if(bottom!==undefined)styles.bottom=bottom;if(zIndex!==undefined)styles.zIndex=zIndex;return styles;},[positionType,top,left,right,bottom,zIndex]);if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{...style,...positionStyles,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",color:textColor,...activeFont},children:currentText});}return /*#__PURE__*/_jsx(\"div\",{style:{...style,...positionStyles,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,y:slideDistance},animate:{opacity:1,y:0},exit:{opacity:0,y:-slideDistance},transition:{duration:fadeInDuration,ease:\"easeOut\",exit:{duration:fadeOutDuration,ease:\"easeIn\"}},style:{position:\"relative\",color:textColor,textAlign:\"center\",width:\"100%\",...activeFont},children:currentText},currentIndex)})});}addPropertyControls(TextCycle,{texts:{type:ControlType.Array,title:\"Texts\",control:{type:ControlType.String},defaultValue:[\"passive house\",\"volume\",\"renovation\",\"extension\",\"luxury home\",\"custom home\"]},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:2e3,min:500,max:1e4,step:100,unit:\"ms\",displayStepper:true},fadeInDuration:{type:ControlType.Number,title:\"Fade In\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\"},fadeOutDuration:{type:ControlType.Number,title:\"Fade Out\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\"},slideDistance:{type:ControlType.Number,title:\"Slide Distance\",defaultValue:20,min:0,max:100,step:1,unit:\"px\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true,defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},breakpointL:{type:ControlType.Number,title:\"Breakpoint L\",defaultValue:1024,min:0,max:3e3,step:1,unit:\"px\"},fontL:{type:ControlType.Font,title:\"Font (L)\",controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true,defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},breakpointM:{type:ControlType.Number,title:\"Breakpoint M\",defaultValue:768,min:0,max:3e3,step:1,unit:\"px\"},fontM:{type:ControlType.Font,title:\"Font (M)\",controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true,defaultValue:{fontSize:\"28px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},breakpointS:{type:ControlType.Number,title:\"Breakpoint S\",defaultValue:480,min:0,max:3e3,step:1,unit:\"px\"},fontS:{type:ControlType.Font,title:\"Font (S)\",controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true,defaultValue:{fontSize:\"24px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},breakpointXS:{type:ControlType.Number,title:\"Breakpoint XS\",defaultValue:0,min:0,max:3e3,step:1,unit:\"px\"},fontXS:{type:ControlType.Font,title:\"Font (XS)\",controls:\"extended\",defaultFontType:\"sans-serif\",displayTextAlignment:true,displayFontSize:true,defaultValue:{fontSize:\"20px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1em\"}},positionType:{type:ControlType.Enum,title:\"Position\",options:[\"relative\",\"absolute\",\"fixed\"],optionTitles:[\"Relative\",\"Absolute\",\"Fixed\"],defaultValue:\"relative\",displaySegmentedControl:true},top:{type:ControlType.Number,title:\"Top\",min:-1e3,max:1e3,step:1,unit:\"px\",hidden:({positionType})=>positionType===\"relative\"},left:{type:ControlType.Number,title:\"Left\",min:-1e3,max:1e3,step:1,unit:\"px\",hidden:({positionType})=>positionType===\"relative\"},right:{type:ControlType.Number,title:\"Right\",min:-1e3,max:1e3,step:1,unit:\"px\",hidden:({positionType})=>positionType===\"relative\"},bottom:{type:ControlType.Number,title:\"Bottom\",min:-1e3,max:1e3,step:1,unit:\"px\",hidden:({positionType})=>positionType===\"relative\"},zIndex:{type:ControlType.Number,title:\"Z-Index\",min:-100,max:100,step:1,hidden:({positionType})=>positionType===\"relative\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextCycle\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextCycle_1.map"],"mappings":"6QAMG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,gBAAgB,SAAS,aAAa,YAAY,cAAc,aAAa,EAAE,WAAS,IAAI,iBAAe,GAAG,kBAAgB,GAAG,gBAAc,GAAG,YAAU,UAAU,OAAK,QAAM,QAAM,QAAM,SAAO,cAAY,KAAK,cAAY,IAAI,cAAY,IAAI,eAAa,EAAE,eAAa,WAAW,MAAI,OAAK,QAAM,SAAO,SAAO,SAAO,EAAW,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAO,CAAC,EAAY,GAAgBA,EAAgB,IAAS,OAA8B,KAAlB,EAAO,UAAe,EAAQ,EAAS,EAAoB,EACjjB,MAAc,CAAC,GAAU,IAAS,OAAY,OAC9C,EAAe,EAAO,UAAU,EAAE,IAAM,MAAiB,CAAC,MAAoB,CAAC,EAAe,EAAO,UAAU,CAAE,CAAC,CAAE,EAAiD,OAA/C,EAAO,i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