{"version":3,"file":"FlickerText.B1E22yD5.mjs","names":["useState","useRef","useMemo"],"sources":["https:/framerusercontent.com/modules/PHYJaL8wxPORnwddQHSf/pWiVQK6QyOxgvhst254T/FlickerText.js"],"sourcesContent":["// Interactive text flicker animation effect with fill/stroke transitions and neon aesthetic\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef,useMemo,startTransition}from\"react\";import{motion,useInView}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Text Flicker Animation\n *\n * Interactive text animation with flickering fill/stroke transitions and neon effects.\n * Each character animates individually with customizable timing and patterns.\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 200\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function FlickerText(props){const{text=\"FLICKER TEXT\",textColor=\"#FFFFFF\",glowColor=\"#00FFFF\",backgroundColor=\"#000000\",font,animationSpeed=1,animationPattern=\"sequential\",repeatBehavior=\"loop\",animationStyle=\"neon\",strokeWidth=2,glowIntensity=10,showBackground=true,autoPlay=true}=props;const[isPlaying,setIsPlaying]=useState(autoPlay);const[animationKey,setAnimationKey]=useState(0);const containerRef=useRef(null);const isInView=useInView(containerRef,{once:false});const isStatic=useIsStaticRenderer();// Split text into characters for individual animation\nconst characters=useMemo(()=>{return text.split(\"\").map((char,index)=>({char:char===\" \"?\"\\xa0\":char,index,id:`${char}-${index}`}));},[text]);// Animation timing calculations\nconst baseDelay=.1/animationSpeed;const flickerDuration=.3/animationSpeed;const totalDuration=characters.length*baseDelay+flickerDuration;// Generate animation delays based on pattern\nconst getAnimationDelay=index=>{switch(animationPattern){case\"sequential\":return index*baseDelay;case\"random\":return Math.random()*(totalDuration*.7);case\"sync\":return 0;default:return index*baseDelay;}};// Style variations based on animation style\nconst getStyleVariation=()=>{switch(animationStyle){case\"neon\":return{filter:`drop-shadow(0 0 ${glowIntensity}px ${glowColor})`,textShadow:`0 0 ${glowIntensity*2}px ${glowColor}`};case\"led\":return{filter:`drop-shadow(0 0 ${glowIntensity*.5}px ${glowColor})`,textShadow:`0 0 ${glowIntensity}px ${glowColor}`};case\"retro\":return{filter:`drop-shadow(0 0 ${glowIntensity*1.5}px ${glowColor}) contrast(1.2)`,textShadow:`0 0 ${glowIntensity*3}px ${glowColor}`};case\"electric\":return{filter:`drop-shadow(0 0 ${glowIntensity*2}px ${glowColor}) brightness(1.1)`,textShadow:`0 0 ${glowIntensity*4}px ${glowColor}`};default:return{};}};const styleVariation=getStyleVariation();// Auto-play logic\nuseEffect(()=>{if(autoPlay&&isInView&&!isStatic){startTransition(()=>setIsPlaying(true));}},[autoPlay,isInView,isStatic]);// Character animation variants\nconst characterVariants={initial:{opacity:1,color:textColor,WebkitTextStroke:`${strokeWidth}px transparent`,textShadow:\"none\",filter:\"none\"},flicker:index=>({opacity:[1,.3,1,.1,1,.7,1],color:[textColor,\"transparent\",textColor,\"transparent\",textColor],WebkitTextStroke:[`${strokeWidth}px transparent`,`${strokeWidth}px ${textColor}`,`${strokeWidth}px transparent`,`${strokeWidth}px ${textColor}`,`${strokeWidth}px transparent`],transition:{duration:flickerDuration,delay:getAnimationDelay(index),ease:\"easeInOut\",repeat:repeatBehavior===\"loop\"?Infinity:0,repeatDelay:repeatBehavior===\"loop\"?totalDuration:0}})};const isFixedWidth=props?.style&&props.style.width===\"100%\";const isFixedHeight=props?.style&&props.style.height===\"100%\";return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...props.style,position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:showBackground?backgroundColor:\"transparent\",overflow:\"hidden\",...isFixedWidth?{}:{minWidth:\"max-content\"},...isFixedHeight?{}:{minHeight:\"max-content\"},padding:\"20px\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexWrap:\"wrap\",justifyContent:\"center\",alignItems:\"center\",gap:\"0\",...font,...styleVariation},children:characters.map((character,index)=>/*#__PURE__*/_jsx(motion.span,{custom:index,variants:characterVariants,initial:\"initial\",animate:isPlaying&&!isStatic?\"flicker\":\"initial\",style:{display:\"inline-block\",fontSize:\"inherit\",fontWeight:\"inherit\",fontFamily:\"inherit\",lineHeight:\"inherit\",letterSpacing:\"inherit\",whiteSpace:\"pre\"},children:character.char},`${character.id}-${animationKey}`))})});}addPropertyControls(FlickerText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"FLICKER TEXT\",displayTextArea:true},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},glowColor:{type:ControlType.Color,title:\"Glow Color\",defaultValue:\"#00FFFF\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"48px\",variant:\"Bold\",letterSpacing:\"0.05em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},animationSpeed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:.1,max:5,step:.1,unit:\"x\"},animationPattern:{type:ControlType.Enum,title:\"Pattern\",options:[\"sequential\",\"random\",\"sync\"],optionTitles:[\"Sequential\",\"Random\",\"Sync\"],defaultValue:\"sequential\",displaySegmentedControl:true},repeatBehavior:{type:ControlType.Enum,title:\"Repeat\",options:[\"once\",\"loop\",\"trigger\"],optionTitles:[\"Once\",\"Loop\",\"Trigger\"],defaultValue:\"loop\",displaySegmentedControl:true},animationStyle:{type:ControlType.Enum,title:\"Style\",options:[\"neon\",\"led\",\"retro\",\"electric\"],optionTitles:[\"Neon\",\"LED\",\"Retro\",\"Electric\"],defaultValue:\"neon\",displaySegmentedControl:true},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:2,min:1,max:10,step:1,unit:\"px\"},glowIntensity:{type:ControlType.Number,title:\"Glow Intensity\",defaultValue:10,min:0,max:50,step:1,unit:\"px\"},showBackground:{type:ControlType.Boolean,title:\"Background\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},autoPlay:{type:ControlType.Boolean,title:\"Auto Play\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FlickerText\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FlickerText.map"],"mappings":"sQAYG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,OAAK,eAAe,YAAU,UAAU,YAAU,UAAU,kBAAgB,UAAU,OAAK,iBAAe,EAAE,mBAAiB,aAAa,iBAAe,OAAO,iBAAe,OAAO,cAAY,EAAE,gBAAc,GAAG,iBAAe,GAAK,WAAS,IAAM,EAAW,CAAC,EAAU,GAAcA,EAAS,CAAQ,EAAO,CAAC,EAAa,GAAiBA,EAAS,CAAC,EAAQ,EAAaC,EAAO,IAAI,EAAQ,EAAS,EAAU,EAAa,CAAC,KAAK,EAAK,CAAC,EAAQ,EAAS,EAAoB,EACpgB,EAAWC,MAAoB,EAAK,MAAM,EAAE,CAAC,CAAC,KAAK,EAAK,KAAS,CAAC,KAAK,IAAO,IAAI,OAAO,EAAK,QAAM,GAAG,GAAG,EAAK,GAAG,GAAO,EAAE,EAAI,CAAC,CAAI,CAAC,EACrI,EAAU,GAAG,EAAqB,EAAgB,GAAG,EAAqB,EAAc,EAAW,OAAO,EAAU,EACpH,EAAkB,GAAO,CAAC,OAAO,EAAP,CAAyB,IAAI,aAAa,OAAO,EAAM,EAAU,IAAI,SAAS,OAAsB,EAAc,GAA7B,KAAK,OAAO,EAAqB,IAAI,OAAO,MAAO,GAAE,QAAQ,OAAO,EAAM,CAAU,CAAC,EAC6a,OAA3lB,CAAC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