{"version":3,"file":"Text_Carousel.uSKRVCUt.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/pKXrLNxaNFR6WTQv8WKk/2OAw8ZMDoCKGGDVhFnuE/Text_Carousel.js"],"sourcesContent":["// WordCarousel.framer.tsx\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// framer-motion accepts a 4-number bezier tuple for `ease`\nconst SWEEP_EASE=[.2,0,.3,.3];const FADE_MS=250// dissolve length\n;const GAP_MS=70// slight pause after fade\n;export default function WordCarousel(props){const{words,sweepMs,holdMs,className=\"\",font,fontSize}=props;const[idx,setIdx]=useState(0);const[fadeOut,setFadeOut]=useState(false);const timer=useRef(null);const fadeTimer=useRef(null);useEffect(()=>{if(!words?.length)return;if(timer.current)window.clearTimeout(timer.current);if(fadeTimer.current)window.clearTimeout(fadeTimer.current);// start fading just before the end of the cycle, then leave a tiny gap\nfadeTimer.current=window.setTimeout(()=>{setFadeOut(true);},Math.max(0,sweepMs+holdMs-FADE_MS-GAP_MS));// switch after fade + gap\ntimer.current=window.setTimeout(()=>{setFadeOut(false);setIdx(i=>(i+1)%words.length);},sweepMs+holdMs+GAP_MS);return()=>{if(timer.current)window.clearTimeout(timer.current);if(fadeTimer.current)window.clearTimeout(fadeTimer.current);};},[idx,words,sweepMs,holdMs]);const word=words?.[idx]??\"\";const gradient=`\n    linear-gradient(in oklch 90deg,\n      #000000 0%,  #000000 30%,\n      #FF0099 35%,\n      #FF0000 45%,\n      #FF4F04 50%,\n      #FFA600 55%,\n      #F8F8F8 60%,\n      #0056FF 65%,\n      #FFFFFF 70%, #FFFFFF 100%\n    )\n  `;// Build typography from Framer Font control (robust to both key shapes)\nconst fontStyle=toFontStyle(font);// Allow explicit fontSize prop to override font control size\nif(typeof fontSize===\"number\"&&fontSize>0){fontStyle.fontSize=fontSize;// preserve relative line-height behavior if not provided\nif(!fontStyle.lineHeight)fontStyle.lineHeight=\"1.2em\";}// Reuse the exact same typography on both layers (no reliance on inheritance)\nconst typography={fontFamily:fontStyle.fontFamily,fontWeight:fontStyle.fontWeight,fontStyle:fontStyle.fontStyle,fontSize:fontStyle.fontSize,lineHeight:fontStyle.lineHeight,letterSpacing:fontStyle.letterSpacing};return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsxs(\"span\",{\"aria-live\":\"polite\",className:className,style:{position:\"relative\",display:\"inline-block\",whiteSpace:\"nowrap\",...typography},children:[/*#__PURE__*/_jsx(motion.span,{style:{color:\"#000000\",...typography},initial:{opacity:0},animate:{opacity:fadeOut?0:1},transition:fadeOut?{duration:FADE_MS/1e3,ease:\"easeOut\"}:{delay:sweepMs*.8/1e3,duration:.12,ease:\"easeOut\"},children:word},`black-${idx}`),/*#__PURE__*/_jsx(motion.span,{style:{position:\"absolute\",left:0,right:0,top:\"-0.30em\",bottom:\"-0.30em\",paddingTop:\"0.30em\",paddingBottom:\"0.30em\",lineHeight:\"inherit\",pointerEvents:\"none\",backgroundOrigin:\"padding-box\",backgroundImage:gradient,backgroundClip:\"text\",WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",color:\"transparent\",backgroundRepeat:\"no-repeat\",backgroundSize:\"400% 100%\",willChange:\"background-position, opacity, filter\",// ← motion-blur via CSS var so it animates smoothly\nfilter:\"blur(var(--blur))\",...typography},initial:{backgroundPositionX:\"100%\",opacity:1,[\"--blur\"]:\"4px\"},animate:{backgroundPositionX:\"0%\",opacity:[1,1,0],[\"--blur\"]:[\"4px\",\"0.5px\",\"0px\"]},transition:{backgroundPositionX:{duration:sweepMs/1e3,ease:SWEEP_EASE},opacity:{duration:sweepMs/1e3,times:[0,.985,1],ease:\"linear\"},[\"--blur\"]:{duration:sweepMs/1e3,times:[0,.8,1],ease:\"easeOut\"}},children:word},`overlay-${idx}`)]})});}function toFontStyle(font){if(!font)return{};// Handle both Framer's common shape (fontFamily, fontWeight, ...) and the alternate (family, weight, ...)\nconst fontFamily=font.fontFamily??font.family;const fontWeight=font.fontWeight??font.weight;const fontStyle=font.fontStyle??font.style;const fontSize=font.fontSize??font.size;const lineHeightRaw=font.lineHeight;const letterSpacing=font.letterSpacing;const computedLineHeight=typeof lineHeightRaw===\"number\"&&typeof fontSize===\"number\"?`${lineHeightRaw/100*fontSize}px`:lineHeightRaw;return{fontFamily,fontStyle,fontWeight,fontSize,lineHeight:computedLineHeight,letterSpacing};}/** ---------- Framer Controls ---------- */addPropertyControls(WordCarousel,{words:{type:ControlType.Array,title:\"Words\",propertyControl:{type:ControlType.String,placeholder:\"Word\"},defaultValue:[\"fast\",\"smooth\",\"colorful\",\"crisp\"]},sweepMs:{type:ControlType.Number,title:\"Sweep (ms)\",min:100,max:5e3,step:10,defaultValue:750},holdMs:{type:ControlType.Number,title:\"Hold (ms)\",min:0,max:1e4,step:10,defaultValue:2e3},font:{type:ControlType.Font,title:\"Font\"},fontSize:{type:ControlType.Number,title:\"Font Size\",min:8,max:256,step:1,displayStepper:true,defaultValue:64}});WordCarousel.defaultProps={width:600,height:100,words:[\"fast\",\"smooth\",\"colorful\",\"crisp\"],sweepMs:750,holdMs:2e3,fontSize:64};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WordCarousel\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Carousel.map"],"mappings":"iZAIC,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,SAAO,YAAU,GAAG,OAAK,YAAU,EAAW,CAAC,EAAI,GAAQA,EAAS,EAAE,CAAM,CAAC,EAAQ,GAAYA,EAAS,GAAM,CAAO,EAAMC,EAAO,KAAK,CAAO,EAAUA,EAAO,KAAK,CAAC,MAAc,CAAK,MAAO,OA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