{"version":3,"file":"TypewriterEffect.DMG9jSBF.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/RbXKiolTkokjJIz1sZVT/ghOcqKJRV9LwQZt0kkRS/TypewriterEffect.js"],"sourcesContent":["// Text renamer component with typing animation that cycles through multiple sentences\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Text Renamer with Typing Animation\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TypewriterEffect(props){const{sentences=[\"Hello World\",\"Welcome to Framer\",\"Create Amazing Designs\"],typingSpeed=100,deletingSpeed=50,pauseDuration=2e3,showCursor=true,cursorColor=\"#000000\",textColor=\"#000000\",font,style}=props;const[currentSentenceIndex,setCurrentSentenceIndex]=useState(0);const[currentText,setCurrentText]=useState(\"\");const[isDeleting,setIsDeleting]=useState(false);const[isPaused,setIsPaused]=useState(false);useEffect(()=>{if(typeof window===\"undefined\"){startTransition(()=>setCurrentText(sentences[0]||\"\"));return;}const currentSentence=sentences[currentSentenceIndex]||\"\";if(isPaused){const pauseTimeout=setTimeout(()=>{startTransition(()=>{setIsPaused(false);setIsDeleting(true);});},pauseDuration);return()=>clearTimeout(pauseTimeout);}if(!isDeleting&&currentText===currentSentence){startTransition(()=>setIsPaused(true));return;}if(isDeleting&&currentText===\"\"){startTransition(()=>{setIsDeleting(false);setCurrentSentenceIndex(prev=>(prev+1)%sentences.length);});return;}const timeout=setTimeout(()=>{startTransition(()=>{if(isDeleting){setCurrentText(prev=>prev.slice(0,-1));}else{setCurrentText(prev=>currentSentence.slice(0,prev.length+1));}});},isDeleting?deletingSpeed:typingSpeed);return()=>clearTimeout(timeout);},[currentText,isDeleting,isPaused,currentSentenceIndex,sentences,typingSpeed,deletingSpeed,pauseDuration]);const isFixedWidth=style&&style.width===\"100%\";return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"inline-block\"},children:[/*#__PURE__*/_jsxs(\"span\",{style:{color:textColor,...font,wordBreak:\"break-word\",overflowWrap:\"break-word\"},children:[currentText,showCursor&&/*#__PURE__*/_jsx(\"span\",{style:{color:cursorColor,animation:\"blink 1s step-end infinite\"},children:\"|\"})]}),/*#__PURE__*/_jsx(\"style\",{children:`\n                    @keyframes blink {\n                        0%, 100% { opacity: 1; }\n                        50% { opacity: 0; }\n                    }\n                `})]});}addPropertyControls(TypewriterEffect,{sentences:{type:ControlType.Array,title:\"Sentences\",control:{type:ControlType.String},defaultValue:[\"Hello World\",\"Welcome to Framer\",\"Create Amazing Designs\",\"Build Interactive Components\"],maxCount:10},typingSpeed:{type:ControlType.Number,title:\"Typing Speed\",defaultValue:100,min:10,max:500,step:10,unit:\"ms\"},deletingSpeed:{type:ControlType.Number,title:\"Delete Speed\",defaultValue:50,min:10,max:500,step:10,unit:\"ms\"},pauseDuration:{type:ControlType.Number,title:\"Pause Duration\",defaultValue:2e3,min:500,max:5e3,step:100,unit:\"ms\"},showCursor:{type:ControlType.Boolean,title:\"Show Cursor\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},cursorColor:{type:ControlType.Color,title:\"Cursor Color\",defaultValue:\"#000000\",hidden:({showCursor})=>!showCursor},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1.5em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypewriterEffect\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":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