{"version":3,"file":"TypewriterText.DeZixmAp.mjs","names":["useState","useRef","useMemo"],"sources":["https:/framerusercontent.com/modules/8q8xC27NcKDJzNZ8QQdh/XhSw0an7LrTg2ZeUAoeV/TypewriterText.js"],"sourcesContent":["// Recreates the provided text with a typewriter effect, matching the style in the attached image.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef,startTransition,useMemo}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer,RenderTarget}from\"framer\";/**\n * TypewriterText\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */function TypewriterText(props){const{text,typingSpeed,backgroundColor,textColor,font,glowColor,cursorColor,cursorBlinkSpeed,style}=props;const isStatic=useIsStaticRenderer();const[displayed,setDisplayed]=useState(0);const[showCursor,setShowCursor]=useState(true);const intervalRef=useRef(null);const cursorRef=useRef(null);// Reset on text change\nuseEffect(()=>{startTransition(()=>setDisplayed(0));},[text]);// Typing effect\nuseEffect(()=>{if(isStatic||RenderTarget.current()===RenderTarget.thumbnail){setDisplayed(text.length);return;}if(displayed<text.length){intervalRef.current=setTimeout(()=>{startTransition(()=>setDisplayed(displayed+1));},typingSpeed);}return()=>clearTimeout(intervalRef.current);},[displayed,text,typingSpeed,isStatic]);// Cursor blink\nuseEffect(()=>{if(isStatic||RenderTarget.current()===RenderTarget.thumbnail){setShowCursor(false);return;}cursorRef.current=setInterval(()=>{setShowCursor(v=>!v);},cursorBlinkSpeed);return()=>clearInterval(cursorRef.current);},[cursorBlinkSpeed,isStatic]);// Font family fallback for monospaced look\nconst fontFamily=useMemo(()=>{return font.fontFamily||\"Fira Mono, Consolas, Menlo, Monaco, monospace\";},[font.fontFamily]);// Neon glow style\nconst textShadow=useMemo(()=>{return`0 0 12px ${glowColor}, 0 0 32px ${glowColor}, 0 0 2px ${glowColor}`;},[glowColor]);// Centering logic\nconst containerStyle={...style,position:\"relative\",width:\"100%\",height:\"100%\",background:backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",overflow:\"hidden\",padding:\"clamp(8px, 2vw, 24px)\",boxSizing:\"border-box\"};const baseFontSize=typeof font.fontSize===\"number\"?font.fontSize:parseFloat(font.fontSize)||32;const textStyle={color:textColor,fontFamily,fontSize:`clamp(${baseFontSize*.4}px, 4vw, ${font.fontSize})`,fontWeight:font.variant===\"Bold\"?700:400,letterSpacing:font.letterSpacing,lineHeight:font.lineHeight,textAlign:font.textAlign||\"center\",textShadow,whiteSpace:\"pre-line\",margin:0,padding:0,width:\"100%\",maxWidth:\"100%\",wordBreak:\"break-word\",overflowWrap:\"break-word\",WebkitUserSelect:\"none\",userSelect:\"none\"};const cursorStyle={display:\"inline-block\",width:baseFontSize*.38,height:baseFontSize*.82,marginLeft:baseFontSize*.12,background:cursorColor,borderRadius:2,verticalAlign:\"middle\",boxShadow:`0 0 6px ${cursorColor}`,opacity:showCursor?1:0,transition:`opacity 0.1s`};return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"span\",{style:textStyle,\"aria-label\":text,children:[text.slice(0,displayed),displayed===text.length&&isStatic?null:/*#__PURE__*/_jsx(\"span\",{style:cursorStyle,\"aria-hidden\":\"true\"})]})});}addPropertyControls(TypewriterText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"THE VOID IS SILENT.\\nUNTIL A SINGLE PIXEL LIGHTS UP.\\nYOUR STORY BEGINS HERE.\",displayTextArea:true},typingSpeed:{type:ControlType.Number,title:\"Typing Speed\",defaultValue:80,min:10,max:400,unit:\"ms\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#03090B\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#EBF7FC\"},glowColor:{type:ControlType.Color,title:\"Glow Color\",defaultValue:\"#3CB4E5\"},cursorColor:{type:ControlType.Color,title:\"Cursor Color\",defaultValue:\"#F5D93F\"},cursorBlinkSpeed:{type:ControlType.Number,title:\"Cursor Blink\",defaultValue:400,min:100,max:2e3,unit:\"ms\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"monospace\",defaultValue:{fontSize:\"24px\",variant:\"Regular\",letterSpacing:\"0.08em\",lineHeight:\"1.2em\",textAlign:\"center\"}}});export default TypewriterText;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypewriterText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TypewriterText.map"],"mappings":"mVAMG,SAAS,EAAe,EAAM,CAAC,GAAK,CAAC,OAAK,cAAY,kBAAgB,YAAU,OAAK,YAAU,cAAY,mBAAiB,SAAO,EAAY,EAAS,GAAqB,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAE,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAK,CAAO,EAAYC,EAAO,KAAK,CAAO,EAAUA,EAAO,KAAK,CACrU,MAAc,CAAC,MAAoB,EAAa,EAAE,CAAC,EAAG,CAAC,EAAK,CAAC,CAC7D,MAAc,CAAC,GAAG,GAAU,EAAa,SAAS,GAAG,EAAa,UAAU,CAAC,EAAa,EAAK,OAAO,CAAC,OAAqI,OAA1H,EAAU,EAAK,SAAQ,EAAY,QAAQ,eAAe,CAAC,MAAoB,EAAa,EAAU,EAAE,CAAC,EAAG,EAAY,MAAY,aAAa,EAAY,QAAQ,EAAG,CAAC,EAAU,EAAK,EAAY,EAAS,CAAC,CAChU,MAAc,CAAC,GAAG,GAAU,EAAa,SAAS,GAAG,EAAa,UAAU,CAAC,EAAc,GAAM,CAAC,OAAoF,MAA5E,GAAU,QAAQ,gBAAgB,CAAC,EAAc,GAAG,CAAC,EAAE,EAAG,EAAiB,KAAW,cAAc,EAAU,QAAQ,EAAG,CAAC,EAAiB,EAAS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