{"version":3,"file":"Text_Matrix.p5UT4DwA.mjs","names":["React.useState","React.useRef","React.useCallback"],"sources":["https:/framerusercontent.com/modules/k8usOab1muEsTq8DZLX7/gOVAzK5VinkAeKSWTTKX/Text_Matrix.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const CHARS=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";function randomChar(){return CHARS[Math.floor(Math.random()*CHARS.length)];}export default function CipherText(props){const{text=\"292K+ Users\",duration=850,interval=4200,startDelay=700,scrambleIntensity=4,font,fontSize=24,fontWeight=500,lineHeight=1.2,letterSpacing=0,color=\"#111111\",textAlign=\"left\",textTransform=\"none\"}=props;const[displayText,setDisplayText]=React.useState(text);const rafRef=React.useRef(null);const timeoutRef=React.useRef(null);const intervalRef=React.useRef(null);const animatingRef=React.useRef(false);const runCipher=React.useCallback(()=>{if(!text||animatingRef.current)return;animatingRef.current=true;const start=performance.now();const tick=now=>{const elapsed=now-start;const progress=Math.min(elapsed/duration,1);const revealProgress=progress*text.length;const nextText=text.split(\"\").map((char,index)=>{if(char===\" \")return\" \";if(index<revealProgress)return text[index];const distance=index-revealProgress;if(distance>scrambleIntensity)return text[index];return randomChar();}).join(\"\");setDisplayText(nextText);if(progress<1){rafRef.current=requestAnimationFrame(tick);}else{setDisplayText(text);animatingRef.current=false;}};if(rafRef.current!==null)cancelAnimationFrame(rafRef.current);rafRef.current=requestAnimationFrame(tick);},[text,duration,scrambleIntensity]);React.useEffect(()=>{setDisplayText(text);},[text]);React.useEffect(()=>{timeoutRef.current=window.setTimeout(()=>{runCipher();intervalRef.current=window.setInterval(runCipher,interval);},startDelay);return()=>{if(timeoutRef.current!==null)clearTimeout(timeoutRef.current);if(intervalRef.current!==null)clearInterval(intervalRef.current);if(rafRef.current!==null)cancelAnimationFrame(rafRef.current);};},[runCipher,interval,startDelay]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:textAlign===\"right\"?\"flex-end\":textAlign===\"center\"?\"center\":\"flex-start\",whiteSpace:\"pre-wrap\",overflow:\"hidden\",fontFamily:font?.fontFamily||\"Inter\",fontSize,fontWeight,lineHeight,letterSpacing,color,textAlign,textTransform,WebkitFontSmoothing:\"antialiased\",MozOsxFontSmoothing:\"grayscale\"},children:/*#__PURE__*/_jsx(\"span\",{style:{width:\"100%\"},children:displayText})});}addPropertyControls(CipherText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"292K+ Users\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:850,min:200,max:4e3,step:50},interval:{type:ControlType.Number,title:\"Interval\",defaultValue:4200,min:1e3,max:12e3,step:100},startDelay:{type:ControlType.Number,title:\"Start Delay\",defaultValue:700,min:0,max:5e3,step:100},scrambleIntensity:{type:ControlType.Number,title:\"Intensity\",defaultValue:4,min:1,max:12,step:1},font:{type:ControlType.Font,title:\"Font\"},fontSize:{type:ControlType.Number,title:\"Size\",defaultValue:24,min:8,max:200,step:1},fontWeight:{type:ControlType.Number,title:\"Weight\",defaultValue:500,min:100,max:900,step:100},lineHeight:{type:ControlType.Number,title:\"Line\",defaultValue:1.2,min:.8,max:3,step:.1},letterSpacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:0,min:-10,max:20,step:.1},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#111111\"},textAlign:{type:ControlType.Enum,title:\"Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\"},textTransform:{type:ControlType.Enum,title:\"Case\",options:[\"none\",\"uppercase\",\"lowercase\"],optionTitles:[\"Normal\",\"Upper\",\"Lower\"],defaultValue:\"none\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CipherText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\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