{"version":3,"file":"RotatingText_1.BnVMcDC5.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/rE9bzS1kwx1qGQermnBh/jIUN86mtWHTIv2H1QHP0/RotatingText_1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Rotating Text\n *\n * A text component with a static pretext and rotating words with blur animations.\n * The container smoothly animates to accommodate words of different lengths.\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function RotatingText(props){const{pretextBefore=\"We treat\",pretextAfter=\"\",words=[\"depression\",\"anxiety\",\"PTSD\"],wordStayDuration=1.5,transitionDuration=.5,layoutTransitionDuration=.5,font,textColor=\"#000000\",wordColor=\"#000000\",blurAmount=10,textAlign=\"left\",wordGap=8,useLineHeight=true}=props;const[currentIndex,setCurrentIndex]=useState(0);useEffect(()=>{if(words.length<=1)return;const totalInterval=(wordStayDuration+transitionDuration*2)*1e3;const interval=setInterval(()=>{startTransition(()=>{setCurrentIndex(prev=>(prev+1)%words.length);});},totalInterval);return()=>clearInterval(interval);},[words.length,wordStayDuration,transitionDuration]);const currentWord=words[currentIndex]||\"\";return /*#__PURE__*/_jsxs(\"div\",{style:{textAlign,width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:textAlign===\"center\"?\"center\":textAlign===\"right\"?\"flex-end\":\"flex-start\"},children:[pretextBefore&&/*#__PURE__*/_jsx(motion.div,{layout:true,transition:{duration:layoutTransitionDuration,ease:\"easeInOut\"},style:{fontSize:font?.fontSize||\"32px\",fontFamily:font?.fontFamily,fontWeight:font?.fontWeight||600,fontStyle:font?.fontStyle,letterSpacing:font?.letterSpacing,lineHeight:useLineHeight?font?.lineHeight||\"1.3em\":\"1\",color:textColor,whiteSpace:\"normal\",wordWrap:\"break-word\"},children:pretextBefore}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"block\"},children:[pretextAfter&&/*#__PURE__*/_jsx(motion.span,{layout:true,transition:{duration:layoutTransitionDuration,ease:\"easeInOut\"},style:{display:\"inline-block\",fontSize:font?.fontSize||\"32px\",fontFamily:font?.fontFamily,fontWeight:font?.fontWeight||600,fontStyle:font?.fontStyle,letterSpacing:font?.letterSpacing,lineHeight:useLineHeight?font?.lineHeight||\"1.3em\":\"1\",color:textColor,whiteSpace:\"normal\",wordWrap:\"break-word\",marginRight:wordGap},children:pretextAfter}),/*#__PURE__*/_jsx(motion.span,{layout:true,transition:{duration:layoutTransitionDuration,ease:\"easeInOut\"},style:{display:\"inline-block\",fontSize:font?.fontSize||\"32px\",fontFamily:font?.fontFamily,fontWeight:font?.fontWeight||600,fontStyle:font?.fontStyle,letterSpacing:font?.letterSpacing,lineHeight:useLineHeight?font?.lineHeight||\"1.3em\":\"1\",verticalAlign:\"top\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.span,{initial:{opacity:0,filter:`blur(${blurAmount}px)`},animate:{opacity:1,filter:`blur(0px)`},exit:{opacity:0,filter:`blur(${blurAmount}px)`},transition:{duration:transitionDuration,ease:\"easeInOut\"},style:{display:\"inline\",color:wordColor,whiteSpace:\"normal\",wordWrap:\"break-word\"},children:currentWord},currentIndex)})})]})]});}addPropertyControls(RotatingText,{pretextBefore:{type:ControlType.String,title:\"Pretext Before\",defaultValue:\"We treat\",placeholder:\"Enter pretext...\"},pretextAfter:{type:ControlType.String,title:\"Pretext After\",defaultValue:\"\",placeholder:\"Enter pretext...\"},words:{type:ControlType.Array,title:\"Rotating Words\",control:{type:ControlType.String,placeholder:\"Enter word...\"},defaultValue:[\"depression\",\"anxiety\",\"PTSD\"]},textAlign:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},wordStayDuration:{type:ControlType.Number,title:\"Word Stay Duration\",defaultValue:1.5,min:.5,max:10,step:.1,unit:\"s\"},transitionDuration:{type:ControlType.Number,title:\"Animation Duration\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\"},layoutTransitionDuration:{type:ControlType.Number,title:\"Layout Transition\",defaultValue:.5,min:0,max:2,step:.1,unit:\"s\"},blurAmount:{type:ControlType.Number,title:\"Blur Amount\",defaultValue:10,min:0,max:50,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.02em\",lineHeight:\"1.3em\"}},textColor:{type:ControlType.Color,title:\"Pretext Color\",defaultValue:\"#000000\"},wordColor:{type:ControlType.Color,title:\"Word Color\",defaultValue:\"#000000\"},wordGap:{type:ControlType.Number,title:\"Word Gap\",defaultValue:8,min:0,max:100,step:1,unit:\"px\"},useLineHeight:{type:ControlType.Boolean,title:\"Line Height\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RotatingText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"60\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RotatingText_1.map"],"mappings":"wPAWG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,gBAAc,WAAW,eAAa,GAAG,QAAM,CAAC,aAAa,UAAU,MAAM,EAAE,mBAAiB,IAAI,qBAAmB,GAAG,2BAAyB,GAAG,OAAK,YAAU,UAAU,YAAU,UAAU,aAAW,GAAG,YAAU,OAAO,UAAQ,EAAE,gBAAc,IAAM,EAAW,CAA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