{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/gQm3iA4uMoEk1k8MnRHo/ylh1PH6ZqNEQwgUltUYS/TypingEffect.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerIntrinsicWidth 200\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export function TypingEffect({textToType,colors,interval,typingSpeed,fontFamily,fontSize,fontWeight,lineHeight,textAlign,letterSpacing}){const[currentText,setCurrentText]=useState(\"\");const[index,setIndex]=useState(0);const[charIndex,setCharIndex]=useState(0);const[colorIndex,setColorIndex]=useState(0);const[isDeleting,setIsDeleting]=useState(false);const[startTyping,setStartTyping]=useState(false);const initialDelay=500;useEffect(()=>{if(!textToType||textToType.length===0)return;setStartTyping(false);const initialTimeout=setTimeout(()=>{setStartTyping(true);},initialDelay);return()=>clearTimeout(initialTimeout);},[index,textToType,initialDelay]);useEffect(()=>{if(!startTyping)return;const stringToType=textToType[index];const type=()=>{if(!isDeleting){if(charIndex<stringToType.length){setCurrentText(prev=>prev+stringToType.charAt(charIndex));setCharIndex(charIndex+1);}else{setTimeout(()=>{setIsDeleting(true);},interval);}}else{if(charIndex>0){setCurrentText(prev=>prev.slice(0,-1));setCharIndex(charIndex-1);}else{setIsDeleting(false);setColorIndex(prevColorIndex=>(prevColorIndex+1)%colors.length);setCurrentText(\"\");setCharIndex(0);setIndex(prevIndex=>(prevIndex+1)%textToType.length);setStartTyping(false);// Delay the start of typing the next text\nsetTimeout(()=>{setStartTyping(true);},initialDelay);}}};const timeoutId=setTimeout(type,typingSpeed);return()=>clearTimeout(timeoutId);},[charIndex,index,textToType,colors,interval,typingSpeed,startTyping,isDeleting]);// Add Google Fonts link to head\nuseEffect(()=>{const linkElement=document.createElement(\"link\");linkElement.href=`https://fonts.googleapis.com/css2?family=${fontFamily.replace(/\\s+/g,\"+\")}:wght@${fontWeight}&display=swap`;linkElement.rel=\"stylesheet\";document.head.appendChild(linkElement);return()=>{document.head.removeChild(linkElement);};},[fontFamily,fontWeight]);return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"span\",{style:{fontFamily,fontWeight,fontSize,lineHeight:`${lineHeight}em`,textAlign,letterSpacing:`${letterSpacing}em`,color:colors[colorIndex],whiteSpace:\"pre\"},children:[currentText,/*#__PURE__*/_jsx(\"span\",{id:\"typing-cursor\",style:{position:\"relative\",display:\"inline-block\",width:fontSize*.6,height:fontSize*.6,borderRadius:\"50%\",backgroundColor:colors[colorIndex],marginLeft:10,animation:startTyping?`blink ${typingSpeed*.01}s step-end infinite`:\"none\"}})]})});}addPropertyControls(TypingEffect,{textToType:{type:ControlType.Array,title:\"Text to Type\",propertyControl:{type:ControlType.String}},colors:{type:ControlType.Array,title:\"Colors\",propertyControl:{type:ControlType.Color},description:\"------------------------\"},typingSpeed:{type:ControlType.Number,title:\"Typing Speed (ms)\",defaultValue:100},interval:{type:ControlType.Number,title:\"Interval (ms)\",defaultValue:2e3,max:5e3,description:\"Higher values make the animation slower, while lower values make it faster.\"},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Arial\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:8,max:100,step:1,displayStepper:true},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",options:[\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"],optionTitles:[\"Thin\",\"Extra Light\",\"Light\",\"Regular\",\"Medium\",\"Semi Bold\",\"Bold\",\"Extra Bold\",\"Black\"],defaultValue:\"400\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1,min:.5,max:3,step:.1,displayStepper:true},textAlign:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\",\"justify\"],optionTitles:[\"Left\",\"Center\",\"Right\",\"Justify\"],defaultValue:\"left\"},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",defaultValue:0,min:-.5,max:5,step:.1,displayStepper:true,description:\"Made by *Otvos Studio*\\n Contact me for support [( \u2709\uFE0F contact).](https://waitlist-otvos-studio.framer.website/)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"TypingEffect\":{\"type\":\"reactComponent\",\"name\":\"TypingEffect\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"200\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TypingEffect.map"],
  "mappings": "8GAMU,SAASA,EAAa,CAAC,WAAAC,EAAW,OAAAC,EAAO,SAAAC,EAAS,YAAAC,EAAY,WAAAC,EAAW,SAAAC,EAAS,WAAAC,EAAW,WAAAC,EAAW,UAAAC,EAAU,cAAAC,CAAa,EAAE,CAAC,GAAK,CAACC,EAAYC,CAAc,EAAEC,EAAS,EAAE,EAAO,CAACC,EAAMC,CAAQ,EAAEF,EAAS,CAAC,EAAO,CAACG,EAAUC,CAAY,EAAEJ,EAAS,CAAC,EAAO,CAACK,EAAWC,CAAa,EAAEN,EAAS,CAAC,EAAO,CAACO,EAAWC,CAAa,EAAER,EAAS,EAAK,EAAO,CAACS,EAAYC,CAAc,EAAEV,EAAS,EAAK,EAAQW,EAAa,IAAI,OAAAC,EAAU,IAAI,CAAC,GAAG,CAACxB,GAAYA,EAAW,SAAS,EAAE,OAAOsB,EAAe,EAAK,EAAE,IAAMG,EAAe,WAAW,IAAI,CAACH,EAAe,EAAI,CAAE,EAAEC,CAAY,EAAE,MAAM,IAAI,aAAaE,CAAc,CAAE,EAAE,CAACZ,EAAMb,EAAWuB,CAAY,CAAC,EAAEC,EAAU,IAAI,CAAC,G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,CAAC,OAAO,SAAS,QAAQ,SAAS,EAAE,aAAa,CAAC,OAAO,SAAS,QAAQ,SAAS,EAAE,aAAa,MAAM,EAAE,cAAc,CAAC,KAAKA,EAAY,OAAO,MAAM,iBAAiB,aAAa,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,GAAG,eAAe,GAAK,YAAY;AAAA,kGAAiH,CAAC,CAAC",
  "names": ["TypingEffect", "textToType", "colors", "interval", "typingSpeed", "fontFamily", "fontSize", "fontWeight", "lineHeight", "textAlign", "letterSpacing", "currentText", "setCurrentText", "ye", "index", "setIndex", "charIndex", "setCharIndex", "colorIndex", "setColorIndex", "isDeleting", "setIsDeleting", "startTyping", "setStartTyping", "initialDelay", "ue", "initialTimeout", "stringToType", "timeoutId", "prev", "prevColorIndex", "prevIndex", "linkElement", "p", "u", "addPropertyControls", "ControlType"]
}
