{"version":3,"file":"Typewriter.BmF8AxMe.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/QLSZ2FHoaU2PRfLobUPQ/WVAEFRpse5gSJnAQULMC/Typewriter.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Typewriter Text Animation\n * Cycles through 3 text inputs with typewriter effect, pausing 2 seconds after each completion.\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function Typewriter(props){const{text1=\"Welcome to my website\",text2=\"I create amazing designs\",text3=\"Let's work together\",typingSpeed=100,pauseDuration=2e3,textColor=\"#000000\",font,cursorColor=\"#000000\",showCursor=true,cursorBlinkSpeed=530}=props;const texts=[text1,text2,text3];const[currentIndex,setCurrentIndex]=useState(0);const[currentText,setCurrentText]=useState(\"\");const[isTyping,setIsTyping]=useState(true);const[isPaused,setIsPaused]=useState(false);const[cursorVisible,setCursorVisible]=useState(true);// Cursor blink effect\nuseEffect(()=>{if(!showCursor)return;const interval=setInterval(()=>{startTransition(()=>setCursorVisible(v=>!v));},cursorBlinkSpeed);return()=>clearInterval(interval);},[showCursor,cursorBlinkSpeed]);// Typewriter effect\nuseEffect(()=>{const targetText=texts[currentIndex];if(isTyping&&!isPaused){if(currentText.length<targetText.length){const timeout=setTimeout(()=>{startTransition(()=>{setCurrentText(targetText.slice(0,currentText.length+1));});},typingSpeed);return()=>clearTimeout(timeout);}else{// Finished typing, start pause\nstartTransition(()=>setIsPaused(true));}}else if(isPaused){// Pause completed, move to next text\nconst timeout=setTimeout(()=>{startTransition(()=>{setIsPaused(false);setIsTyping(false);setCurrentText(\"\");setCurrentIndex(prev=>(prev+1)%texts.length);});},pauseDuration);return()=>clearTimeout(timeout);}else if(!isTyping){// Start typing next text\nstartTransition(()=>setIsTyping(true));}},[currentText,currentIndex,isTyping,isPaused,texts,typingSpeed,pauseDuration]);const containerStyle={display:\"flex\",alignItems:\"center\",justifyContent:\"flex-start\",width:\"100%\",height:\"100%\",flexWrap:\"wrap\",minWidth:0};const textStyle={color:textColor,...font,whiteSpace:\"pre-wrap\",overflowWrap:\"anywhere\",wordBreak:\"break-word\"};const cursorStyle={display:\"inline-block\",width:\"2px\",height:\"1em\",backgroundColor:cursorColor,marginLeft:\"2px\",verticalAlign:\"baseline\",opacity:cursorVisible?1:0,transition:\"opacity 0.1s ease\"};return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"span\",{style:textStyle,children:[currentText,showCursor&&/*#__PURE__*/_jsx(\"span\",{style:cursorStyle})]})});}addPropertyControls(Typewriter,{text1:{type:ControlType.String,title:\"Text 1\",defaultValue:\"Welcome to my website\",placeholder:\"First text to type...\"},text2:{type:ControlType.String,title:\"Text 2\",defaultValue:\"I create amazing designs\",placeholder:\"Second text to type...\"},text3:{type:ControlType.String,title:\"Text 3\",defaultValue:\"Let's work together\",placeholder:\"Third text to type...\"},typingSpeed:{type:ControlType.Number,title:\"Typing Speed\",defaultValue:100,min:20,max:500,step:10,unit:\"ms\"},pauseDuration:{type:ControlType.Number,title:\"Pause Duration\",defaultValue:2e3,min:500,max:1e4,step:100,unit:\"ms\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"24px\",variant:\"Regular\",letterSpacing:\"0em\",lineHeight:\"1.2em\",textAlign:\"left\"}},showCursor:{type:ControlType.Boolean,title:\"Show Cursor\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},cursorColor:{type:ControlType.Color,title:\"Cursor Color\",defaultValue:\"#000000\",hidden:({showCursor})=>!showCursor},cursorBlinkSpeed:{type:ControlType.Number,title:\"Cursor Blink\",defaultValue:530,min:100,max:2e3,step:50,unit:\"ms\",hidden:({showCursor})=>!showCursor}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Typewriter\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"60\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"300\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Typewriter.map"],"mappings":"+LASG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,wBAAwB,QAAM,2BAA2B,QAAM,sBAAsB,cAAY,IAAI,gBAAc,IAAI,YAAU,UAAU,OAAK,cAAY,UAAU,aAAW,GAAK,mBAAiB,KAAK,EAAY,EAAM,CAAC,EAAM,EAAM,CAAK,EAAO,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAO,CAAC,EAAY,GAAgBA,EAAS,EAAE,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAI,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAO,CAAC,EAAc,GAAkBA,EAAS,EAAI,EAKkC,OAJtjB,MAAc,CAAC,GAAG,CAAC,EAAW,OAAO,IAAM,EAAS,gBAAgB,CAAC,MAAoB,EAAiB,GAAG,CAAC,CAAC,CAAC,CAAE,EAAE,CAAgB,EAAE,UAAU,cAAc,CAAQ,CAAE,EAAE,CAAC,EAAW,CAAgB,CAAC,EACvM,MAAc,CAAC,IAAM,EAAW,EAAM,GAAc,GAAG,GAAU,CAAC,EAAU,GAAG,EAAY,OAAO,EAAW,OAAO,CAAC,IAAM,EAAQ,eAAe,CAAC,MAAoB,CAAC,EAAe,EAAW,MAAM,EAAE,EAAY,OAAO,CAAC,CAAC,CAAE,CAAC,CAAE,EAAE,CAAW,EAAE,UAAU,aAAa,CAAO,CAAE,MACnR,MAAoB,EAAY,EAAI,CAAC,OAAS,GAAG,EAA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