{"version":3,"file":"SequentialHoverText.C8KQ376E.mjs","names":["useMemo","useState","useRef"],"sources":["https:/framerusercontent.com/modules/Opo6yEVeNs6EePQAue4g/tZuwI7M0G0vy3KFk01Db/SequentialHoverText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useMemo,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useReducedMotion}from\"framer-motion\";/**\n * Sequential type-on headline: completed lines stay visible and new lines append below.\n * Each line uses a left-to-right background wipe on hover.\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 230\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function SequentialHoverText(props){const{line1=\"Brand Strategy\",line2=\"Visual Identity\",line3=\"Digital Experience\",font={},textColor=\"#1D99B5\",hoverColor=\"#F0F0F0\",typeMs=50,lineDelayMs=280,fixedHeight=230,autoHeight=false,minPx=16,maxPx=64,scaleVw=6,showCursor=true,cursorChar=\"_\",blinkS=.5,transition={type:\"tween\",ease:[.44,0,.56,1],duration:.3},style}=props;const lines=useMemo(()=>[line1,line2,line3].filter(Boolean),[line1,line2,line3]);const isStatic=useIsStaticRenderer();const reduceMotion=useReducedMotion();const[lineIndex,setLineIndex]=useState(0);const[characterCount,setCharacterCount]=useState(0);const[hoveredLine,setHoveredLine]=useState(null);const rootRef=useRef(null);const[componentWidth,setComponentWidth]=useState(0);const fillsWidth=style?.width===\"100%\";useEffect(()=>{if(!fillsWidth||typeof ResizeObserver===\"undefined\")return;const root=rootRef.current;if(!root)return;const measure=()=>setComponentWidth(root.clientWidth);measure();const observer=new ResizeObserver(measure);observer.observe(root);return()=>observer.disconnect();},[fillsWidth]);const measuredPx=Math.min(maxPx,Math.max(minPx,componentWidth*scaleVw/100));const responsiveFontSize=fillsWidth?`${componentWidth>0?measuredPx:minPx}px`:`clamp(${minPx}px, ${scaleVw}vw, ${maxPx}px)`;useEffect(()=>{startTransition(()=>{setLineIndex(0);setCharacterCount(0);});},[line1,line2,line3]);useEffect(()=>{if(isStatic||reduceMotion||lines.length===0||lineIndex>=lines.length)return;const currentLine=lines[lineIndex];const isComplete=characterCount>=currentLine.length;const timer=window.setTimeout(()=>{startTransition(()=>{if(isComplete){setLineIndex(value=>value+1);setCharacterCount(0);}else{setCharacterCount(value=>value+1);}});},Math.max(0,isComplete?lineDelayMs:typeMs));return()=>window.clearTimeout(timer);},[characterCount,isStatic,lineDelayMs,lineIndex,lines,reduceMotion,typeMs]);const visibleLineCount=isStatic||reduceMotion?lines.length:Math.min(lineIndex+1,lines.length);const typingFinished=isStatic||reduceMotion||lineIndex>=lines.length;return /*#__PURE__*/_jsxs(\"div\",{ref:rootRef,style:{...style,position:\"relative\",display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",width:style?.width===\"100%\"?\"100%\":\"max-content\",minWidth:style?.width===\"100%\"?undefined:\"max-content\",height:autoHeight?\"auto\":`${fixedHeight}px`,minHeight:autoHeight?undefined:`${fixedHeight}px`,flexShrink:0,overflow:\"visible\",color:textColor,...font,fontSize:responsiveFontSize},\"aria-label\":lines.join(\", \"),children:[autoHeight&&/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{visibility:\"hidden\",pointerEvents:\"none\",display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",width:\"max-content\",maxWidth:\"100%\"},children:lines.map((line,index)=>/*#__PURE__*/_jsxs(\"span\",{style:{display:\"block\",width:\"max-content\",maxWidth:\"100%\",whiteSpace:\"nowrap\"},children:[line,showCursor&&index===lines.length-1?cursorChar:null]},index))}),/*#__PURE__*/_jsx(\"div\",{style:{position:autoHeight?\"absolute\":\"relative\",left:0,top:0,display:\"flex\",flexDirection:\"column\",alignItems:\"flex-start\",width:\"max-content\",maxWidth:\"100%\"},children:lines.slice(0,visibleLineCount).map((line,index)=>{const isCurrent=!typingFinished&&index===lineIndex;const shownText=isCurrent?line.slice(0,characterCount):line;const isHovered=hoveredLine===index;const keepsFinalCursor=typingFinished&&index===lines.length-1;return /*#__PURE__*/_jsxs(\"span\",{style:{position:\"relative\",display:\"block\",width:\"max-content\",maxWidth:\"100%\",cursor:\"default\",isolation:\"isolate\",whiteSpace:\"nowrap\"},onMouseEnter:()=>setHoveredLine(index),onMouseLeave:()=>setHoveredLine(null),children:[/*#__PURE__*/_jsx(motion.span,{\"aria-hidden\":\"true\",initial:false,animate:{scaleX:isHovered?1:0},transition:transition,style:{position:\"absolute\",inset:0,zIndex:-1,backgroundColor:hoverColor,transformOrigin:\"left center\"}}),shownText,showCursor&&(isCurrent||keepsFinalCursor)&&/*#__PURE__*/_jsx(motion.span,{\"aria-hidden\":\"true\",animate:{opacity:[1,1,0,0]},transition:{duration:Math.max(.2,blinkS*2),repeat:Infinity,times:[0,.45,.5,1]},children:cursorChar})]},index);})})]});}addPropertyControls(SequentialHoverText,{line1:{type:ControlType.String,title:\"Line 1\",defaultValue:\"Brand Strategy\"},line2:{type:ControlType.String,title:\"Line 2\",defaultValue:\"Visual Identity\"},line3:{type:ControlType.String,title:\"Line 3\",defaultValue:\"Digital Experience\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"64px\",lineHeight:\"1.2em\",letterSpacing:\"0em\"}},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#1D99B5\"},hoverColor:{type:ControlType.Color,title:\"Hover\",defaultValue:\"#F0F0F0\"},typeMs:{type:ControlType.Number,title:\"Type Speed\",defaultValue:50,min:10,max:200,step:5,unit:\"ms\"},lineDelayMs:{type:ControlType.Number,title:\"Line Delay\",defaultValue:280,min:0,max:2e3,step:20,unit:\"ms\"},autoHeight:{type:ControlType.Boolean,title:\"Auto Height\",defaultValue:false},fixedHeight:{type:ControlType.Number,title:\"Fixed Height\",defaultValue:230,min:80,max:600,step:1,unit:\"px\",hidden:({autoHeight})=>Boolean(autoHeight)},minPx:{type:ControlType.Number,title:\"Min Size\",defaultValue:16,min:8,max:48,unit:\"px\"},maxPx:{type:ControlType.Number,title:\"Max Size\",defaultValue:64,min:24,max:160,unit:\"px\"},scaleVw:{type:ControlType.Number,title:\"Scale\",defaultValue:6,min:1,max:12,step:.1,unit:\"vw\"},showCursor:{type:ControlType.Boolean,title:\"Cursor\",defaultValue:true},cursorChar:{type:ControlType.String,title:\"Character\",defaultValue:\"_\",hidden:({showCursor})=>!showCursor},blinkS:{type:ControlType.Number,title:\"Blink\",defaultValue:.5,min:.1,max:2,step:.1,unit:\"s\",hidden:({showCursor})=>!showCursor},transition:{type:ControlType.Transition,title:\"Hover Motion\",defaultValue:{type:\"tween\",ease:[.44,0,.56,1],duration:.3}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SequentialHoverText\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"230\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SequentialHoverText.map"],"mappings":"2RAQG,SAAwB,EAAoB,EAAM,CAAC,GAAK,CAAC,QAAM,iBAAiB,QAAM,kBAAkB,QAAM,qBAAqB,OAAK,CAAC,EAAE,YAAU,UAAU,aAAW,UAAU,SAAO,GAAG,cAAY,IAAI,cAAY,IAAI,aAAW,GAAM,QAAM,GAAG,QAAM,GAAG,UAAQ,EAAE,aAAW,GAAK,aAAW,IAAI,SAAO,GAAG,aAAW,CAAC,KAAK,QAAQ,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,SAAO,EAAY,EAAMA,MAAY,CAAC,EAAM,EAAM,CAAK,CAAC,CAAC,OAAO,OAAO,EAAE,CAAC,EAAM,EAAM,CAAK,CAAC,EAAQ,EAAS,EAAoB,EAAQ,EAAa,E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