{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/TueGCGudDOBEnhiOkb2o/VOTjTm9CeSyzjji7V1SY/TypeIt.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function TypeIt({phrases,typingSpeed,erasingSpeed,delayBetween,fontSize,fontFamily,fontWeight,color,fixedTextColor,letterSpacing,lineHeight,prefixText,suffixText,direction,spacing,verticalAlignment}){const[currentPhraseIndex,setCurrentPhraseIndex]=useState(0);const[displayedText,setDisplayedText]=useState(\"\");const[isErasing,setIsErasing]=useState(false);const adjustedTypingSpeed=500-typingSpeed;const adjustedErasingSpeed=500-erasingSpeed;useEffect(()=>{const currentPhrase=phrases[currentPhraseIndex];let timeout;if(isErasing){if(displayedText.length>0){timeout=setTimeout(()=>{setDisplayedText(prev=>prev.slice(0,-1));},adjustedErasingSpeed);}else{setIsErasing(false);setCurrentPhraseIndex(prev=>prev===phrases.length-1?0:prev+1);}}else{if(displayedText.length<currentPhrase.length){timeout=setTimeout(()=>{setDisplayedText(prev=>currentPhrase.slice(0,prev.length+1));},adjustedTypingSpeed);}else{timeout=setTimeout(()=>{setIsErasing(true);},delayBetween);}}return()=>clearTimeout(timeout);},[displayedText,isErasing,phrases,currentPhraseIndex,adjustedTypingSpeed,adjustedErasingSpeed,delayBetween]);const textAlign=verticalAlignment===\"left\"?\"flex-start\":verticalAlignment===\"right\"?\"flex-end\":\"center\";return /*#__PURE__*/_jsxs(\"div\",{style:{fontSize,fontFamily,fontWeight,color,letterSpacing,lineHeight,whiteSpace:\"nowrap\",overflow:\"visible\",display:\"flex\",flexDirection:direction===\"horizontal\"?\"row\":\"column\",alignItems:direction===\"horizontal\"?\"center\":textAlign,justifyContent:direction===\"horizontal\"?\"flex-start\":\"center\",position:\"relative\",textAlign:direction===\"vertical\"?verticalAlignment:\"left\",gap:prefixText||suffixText?spacing:0,width:\"100%\",height:\"100%\",boxSizing:\"border-box\",padding:0},children:[prefixText&&/*#__PURE__*/_jsx(\"span\",{style:{color:fixedTextColor},children:prefixText},\"prefix\"),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"row\",alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"span\",{children:displayedText}),/*#__PURE__*/_jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.5,repeat:Infinity},style:{borderRight:\"2px solid\",marginLeft:2,height:\"1em\"}},\"cursor\")]}),suffixText&&/*#__PURE__*/_jsx(\"span\",{style:{color:fixedTextColor},children:suffixText},\"suffix\")]});}TypeIt.defaultProps={phrases:[\"Hello, World!\",\"Welcome to Framer!\",\"Let's build something amazing!\"],typingSpeed:300,erasingSpeed:300,delayBetween:2e3,fontSize:24,fontFamily:\"Inter\",fontWeight:400,color:\"#000\",fixedTextColor:\"#888\",letterSpacing:0,lineHeight:1.5,prefixText:\"\",suffixText:\"\",direction:\"horizontal\",spacing:12,verticalAlignment:\"center\"};/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */addPropertyControls(TypeIt,{phrases:{type:ControlType.Array,title:\"Words / Phrases\",control:{type:ControlType.String},defaultValue:[\"Hello, World!\",\"Welcome to Framer!\",\"Let's build something amazing!\"]},typingSpeed:{type:ControlType.Number,title:\"Typing Speed\",defaultValue:150,min:50,max:500},erasingSpeed:{type:ControlType.Number,title:\"Erasing Speed\",defaultValue:100,min:50,max:500},delayBetween:{type:ControlType.Number,title:\"Delay Between Phrases\",defaultValue:2e3,min:500,max:5e3},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:24},fontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter\"},fontWeight:{type:ControlType.Number,title:\"Font Weight\",defaultValue:400},color:{type:ControlType.Color,title:\"Animated Text Color\",defaultValue:\"#000\"},fixedTextColor:{type:ControlType.Color,title:\"Fixed Text Color\",defaultValue:\"#888\"},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",defaultValue:0,min:-5,max:20,step:.1},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1.5,min:.5,max:3,step:.1},prefixText:{type:ControlType.String,title:\"Prefix Text\",defaultValue:\"\"},suffixText:{type:ControlType.String,title:\"Suffix Text\",defaultValue:\"\"},direction:{type:ControlType.Enum,title:\"Direction\",defaultValue:\"horizontal\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"]},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:8,min:0,max:50,step:1},verticalAlignment:{type:ControlType.Enum,title:\"Vertical Alignment\",defaultValue:\"center\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],hidden:props=>props.direction!==\"vertical\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypeIt\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TypeIt.map"],
  "mappings": "mFAAoM,SAARA,EAAwB,CAAC,QAAAC,EAAQ,YAAAC,EAAY,aAAAC,EAAa,aAAAC,EAAa,SAAAC,EAAS,WAAAC,EAAW,WAAAC,EAAW,MAAAC,EAAM,eAAAC,EAAe,cAAAC,EAAc,WAAAC,EAAW,WAAAC,EAAW,WAAAC,EAAW,UAAAC,EAAU,QAAAC,EAAQ,kBAAAC,CAAiB,EAAE,CAAC,GAAK,CAACC,EAAmBC,CAAqB,EAAEC,EAAS,CAAC,EAAO,CAACC,EAAcC,CAAgB,EAAEF,EAAS,EAAE,EAAO,CAACG,EAAUC,CAAY,EAAEJ,EAAS,EAAK,EAAQK,EAAoB,IAAItB,EAAkBuB,EAAqB,IAAItB,EAAa,OAAAuB,EAAU,IAAI,CAAC,IAAMC,EAAc1B,EAAQgB,CAAkB,EAAMW,EAAQ,OAAGN,EAAcF,EAAc,OAAO,EA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AAmB,aAAa,MAAM,EAAE,cAAc,CAAC,KAAKA,EAAY,OAAO,MAAM,iBAAiB,aAAa,EAAE,IAAI,GAAG,IAAI,GAAG,KAAK,EAAE,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,cAAc,aAAa,IAAI,IAAI,GAAG,IAAI,EAAE,KAAK,EAAE,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,cAAc,aAAa,EAAE,EAAE,WAAW,CAAC,KAAKA,EAAY,OAAO,MAAM,cAAc,aAAa,EAAE,EAAE,UAAU,CAAC,KAAKA,EAAY,KAAK,MAAM,YAAY,aAAa,aAAa,QAAQ,CAAC,aAAa,UAAU,EAAE,aAAa,CAAC,aAAa,UAAU,CAAC,EAAE,QAAQ,CAAC,KAAKA,EAAY,OAAO,MAAM,UAAU,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,CAAC,EAAE,kBAAkB,CAAC,KAAKA,EAAY,KAAK,MAAM,qBAAqB,aAAa,SAAS,QAAQ,CAAC,OAAO,SAAS,OAAO,EAAE,aAAa,CAAC,OAAO,SAAS,OAAO,EAAE,OAAOC,GAAOA,EAAM,YAAY,UAAU,CAAC,CAAC",
  "names": ["TypeIt", "phrases", "typingSpeed", "erasingSpeed", "delayBetween", "fontSize", "fontFamily", "fontWeight", "color", "fixedTextColor", "letterSpacing", "lineHeight", "prefixText", "suffixText", "direction", "spacing", "verticalAlignment", "currentPhraseIndex", "setCurrentPhraseIndex", "ye", "displayedText", "setDisplayedText", "isErasing", "setIsErasing", "adjustedTypingSpeed", "adjustedErasingSpeed", "ue", "currentPhrase", "timeout", "prev", "u", "p", "motion", "addPropertyControls", "ControlType", "props"]
}
