{"version":3,"file":"GradientSweepText.DP6VzkbD.mjs","names":["React.useRef","React.useState","Tag","__esmMin","de","window","ce","init_ssg_sandbox_shims","_e","init_jsx_runtime","p","init_npm_react_18_3_1","c","init_framer_CN96F41L","addPropertyControls","ControlType","RenderTarget","GradientSweepText","defaultFont","props","root","sweep","plain","setPlain","isCanvas","seconds","duration","wait","delay","progress","canvasProgress","isRtl","direction","textAlign","hiddenPosition","revealedPosition","canvasPosition","host","span","reduced","forced","animation","observer","played","finish","play","replay","connect","trigger","entry","text","before","after","tag","gradient","color","lightBlue","blue","pink","red","orange","font","style","init_GradientSweepText"],"sources":["https:/framerusercontent.com/modules/6P0r5ox1XhUFUMVYdJDw/XJ23Y3Q331WV6EMBiBQj/GradientSweepText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const defaultFont={fontFamily:\"Inter, sans-serif\",fontSize:\"36px\",fontWeight:600,lineHeight:\"1.1em\",letterSpacing:\"-0.04em\"};/**\n * A rainbow reveal inspired by the heading on lovable.dev.\n * Uses one accessible text node per phrase, with no duplicated overlay text.\n * Without JavaScript, in Canvas, and with reduced motion, text stays readable.\n * @framerIntrinsicWidth 760\n * @framerIntrinsicHeight 44\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function GradientSweepText(props){const{before=\"One platform. \",text=\"Endless possibilities.\",after=\"\",font=defaultFont,color=\"#1C1C1C\",lightBlue=\"#82BCFF\",blue=\"#2483FF\",pink=\"#FF66F4\",red=\"#FF3029\",orange=\"#FE7B02\",duration=1.2,delay=.1,replay=false,trigger=\"view\",direction=\"auto\",tag=\"h2\",canvasProgress=100,style}=props;const root=React.useRef(null);const sweep=React.useRef(null);const[plain,setPlain]=React.useState(false);const isCanvas=RenderTarget.current()===RenderTarget.canvas;const seconds=Number.isFinite(duration)?Math.max(0,duration):1.2;const wait=Number.isFinite(delay)?Math.max(0,delay):.1;const progress=Math.max(0,Math.min(100,canvasProgress??100));const isRtl=direction===\"rtl\";const textAlign=direction===\"auto\"?\"center\":isRtl?\"right\":\"left\";const hiddenPosition=isRtl?\"0% 0%\":\"100% 0%\";const revealedPosition=isRtl?\"100% 0%\":\"0% 0%\";const canvasPosition=`${isRtl?progress:100-progress}% 0%`;React.useEffect(()=>{const host=root.current;const span=sweep.current;if(!host||!span||isCanvas)return;const reduced=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const forced=window.matchMedia(\"(forced-colors: active)\");let animation;let observer;let played=false;const finish=()=>{animation?.cancel();animation=undefined;span.style.backgroundPosition=revealedPosition;span.style.filter=\"none\";};const play=()=>{if(reduced.matches||forced.matches||seconds===0){finish();return;}if(played&&!replay)return;played=true;animation?.cancel();animation=span.animate([{backgroundPosition:hiddenPosition,filter:\"blur(1px)\"},{backgroundPosition:revealedPosition,filter:\"blur(0px)\"}],{duration:seconds*1e3,delay:wait*1e3,easing:\"cubic-bezier(0.455, 0.03, 0.515, 0.955)\",fill:\"both\"});animation.onfinish=finish;};const connect=()=>{observer?.disconnect();finish();setPlain(forced.matches);if(reduced.matches||forced.matches||!span.animate)return;if(trigger===\"load\"||!(\"IntersectionObserver\"in window)){play();return;}observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){play();if(!replay)observer?.disconnect();}else if(replay){finish();played=false;span.style.backgroundPosition=hiddenPosition;}},{threshold:0,rootMargin:\"0px 0px -10% 0px\"});observer.observe(host);// Prepare before the next paint; the no-JS/SSR state remains visible.\nspan.style.backgroundPosition=hiddenPosition;};connect();reduced.addEventListener(\"change\",connect);forced.addEventListener(\"change\",connect);return()=>{observer?.disconnect();finish();reduced.removeEventListener(\"change\",connect);forced.removeEventListener(\"change\",connect);};},[text,before,after,seconds,wait,trigger,replay,isCanvas,tag,hiddenPosition,revealedPosition]);const gradient=`linear-gradient(${isRtl?270:90}deg, ${color} 0%, ${color} 33.33%, ${lightBlue} 40%, ${blue} 45%, ${pink} 50%, ${red} 55%, ${orange} 60%, transparent 66.67%, transparent 100%)`;const Tag=tag;return /*#__PURE__*/_jsxs(Tag,{ref:root,dir:direction,style:{margin:0,width:\"100%\",minWidth:0,overflowWrap:\"anywhere\",whiteSpace:\"pre-wrap\",...defaultFont,...font,color,...style,textAlign},children:[before,/*#__PURE__*/_jsx(\"span\",{ref:sweep,style:plain?{color:\"CanvasText\"}:{display:\"inline\",paddingInlineEnd:\"0.1em\",marginInlineEnd:\"-0.1em\",backgroundImage:gradient,backgroundSize:\"300% 100%\",backgroundPosition:isCanvas?canvasPosition:revealedPosition,backgroundRepeat:\"no-repeat\",backgroundClip:\"text\",WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",color:\"transparent\"},children:text}),after]});}addPropertyControls(GradientSweepText,{before:{type:ControlType.String,title:\"Before\",defaultValue:\"One platform. \"},text:{type:ControlType.String,title:\"Sweep Text\",defaultValue:\"Endless possibilities.\",displayTextArea:true},after:{type:ControlType.String,title:\"After\",defaultValue:\"\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultValue:defaultFont},color:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#1C1C1C\"},lightBlue:{type:ControlType.Color,title:\"Light Blue\",defaultValue:\"#82BCFF\"},blue:{type:ControlType.Color,title:\"Blue\",defaultValue:\"#2483FF\"},pink:{type:ControlType.Color,title:\"Pink\",defaultValue:\"#FF66F4\"},red:{type:ControlType.Color,title:\"Red\",defaultValue:\"#FF3029\"},orange:{type:ControlType.Color,title:\"Orange\",defaultValue:\"#FE7B02\"},duration:{type:ControlType.Number,title:\"Duration\",defaultValue:1.2,min:0,max:10,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:.1,min:0,max:5,step:.05,unit:\"s\"},trigger:{type:ControlType.Enum,title:\"Trigger\",options:[\"view\",\"load\"],optionTitles:[\"In View\",\"On Load\"],defaultValue:\"view\"},replay:{type:ControlType.Boolean,title:\"Replay\",defaultValue:false,hidden:p=>p.trigger===\"load\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"auto\",\"ltr\",\"rtl\"],optionTitles:[\"Auto\",\"Left to Right\",\"Right to Left\"],defaultValue:\"auto\",description:\"Auto centers the text. Left to Right and Right to Left set both alignment and sweep direction.\"},tag:{type:ControlType.Enum,title:\"Tag\",options:[\"h1\",\"h2\",\"h3\",\"p\",\"div\"],defaultValue:\"h2\"},canvasProgress:{type:ControlType.Number,title:\"Canvas %\",defaultValue:100,min:0,max:100,step:1,description:\"Static Canvas preview only. Open Preview to see the animation.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradientSweepText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"44\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"760\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradientSweepText.map"],"mappings":"A,qNAQG,SAAwBiB,EAAkB,EAAM,CAAC,GAAK,CAAC,SAAO,iBAAiB,OAAK,yBAAyB,QAAM,GAAG,OAAKC,EAAY,QAAM,UAAU,YAAU,UAAU,OAAK,UAAU,OAAK,UAAU,MAAI,UAAU,SAAO,UAAU,WAAS,IAAI,QAAM,GAAG,SAAO,GAAM,UAAQ,OAAO,YAAU,OAAO,MAAI,KAAK,iBAAe,IAAI,SAAOC,EAAYC,EAAKpB,EAAa,IAAI,EAAQqB,EAAMrB,EAAa,IAAI,EAAO,CAACsB,EAAMC,GAAUtB,EAAe,EAAK,EAAQuB,EAASR,EAAa,QAAQ,IAAIA,EAAa,OAAaS,EAAQ,OAAO,SAASC,CAAQ,EAAE,KAAK,IAAI,EAAEA,CAAQ,EAAE,IAAUC,EAAK,OAAO,SAASC,CAAK,EAAE,KAAK,IAAI,EAAEA,CAAK,EAAE,GAASC,EAAS,KAAK,IAAI,EAAE,KAAK,IAAI,I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