{"version":3,"file":"WaveTicker.BkaUnJfW.mjs","names":["useState","useRef","startTransition"],"sources":["https:/framerusercontent.com/modules/NqZ8BeR74R2gSpAR7TTS/EWS6zMiQVzK6b8VLfto7/WaveTicker.js"],"sourcesContent":["// Ticker with wave-like motion for items\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useAnimationFrame}from\"framer-motion\";import{useEffect,useState,useRef,startTransition}from\"react\";/**\n * Wave Ticker\n *\n * A ticker component where items move in a wave-like pattern while scrolling.\n *\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 200\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function WaveTicker(props){const{slots=[],speed,hoverSpeed,waveAmplitude,verticalSpeed,waveStagger=.2,gap,direction,alignment=\"center\",padding,fadeContent,fadeWidth}=props;const[isHovered,setIsHovered]=useState(false);const containerRef=useRef(null);const contentRef=useRef(null);const offset=useRef(0);const[contentSize,setContentSize]=useState(0);const isVertical=direction===\"top\"||direction===\"bottom\";const isReverse=direction===\"right\"||direction===\"bottom\";// Calculate total width of content to determine how many duplicates we need\nuseEffect(()=>{if(!contentRef.current)return;const observer=new ResizeObserver(()=>{if(contentRef.current){const size=isVertical?contentRef.current.offsetHeight:contentRef.current.offsetWidth;startTransition(()=>setContentSize(size));}});observer.observe(contentRef.current);return()=>observer.disconnect();},[slots,gap,direction,isVertical]);// Create an array of items to render (original + duplicates for seamless loop)\n// We need enough duplicates to fill the screen plus a buffer\nconst items=[...slots,...slots,...slots,...slots];// Map alignment to flex properties\nconst alignMap={start:\"flex-start\",center:\"center\",end:\"flex-end\"};const alignItems=alignMap[alignment]||\"center\";const maskDirection=isVertical?\"to bottom\":\"to right\";const mask=fadeContent?`linear-gradient(${maskDirection}, transparent 0px, black ${fadeWidth}px, black calc(100% - ${fadeWidth}px), transparent 100%)`:undefined;useAnimationFrame((time,delta)=>{if(!contentRef.current||contentSize===0)return;const element=contentRef.current;const loopSize=contentSize/2;// Base speed multiplier (pixels per second at 100% speed)\n// Adjusted to be generally slower as requested\nconst multiplier=.25;const currentHoverFactor=isHovered?hoverSpeed/100:1;const moveBy=delta/1e3*speed*multiplier*currentHoverFactor;offset.current+=moveBy;if(offset.current>=loopSize){offset.current-=loopSize;}const currentOffset=offset.current;const translateValue=isReverse?-loopSize+currentOffset:-currentOffset;if(isVertical){element.style.transform=`translateY(${translateValue}px)`;}else{element.style.transform=`translateX(${translateValue}px)`;}});return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"hidden\",padding,display:\"flex\",flexDirection:isVertical?\"column\":\"row\",alignItems:alignItems,position:\"relative\",maskImage:mask,WebkitMaskImage:mask},ref:containerRef,onMouseEnter:()=>startTransition(()=>setIsHovered(true)),onMouseLeave:()=>startTransition(()=>setIsHovered(false)),children:/*#__PURE__*/_jsx(motion.div,{ref:contentRef,style:{display:\"flex\",flexDirection:isVertical?\"column\":\"row\",gap,width:isVertical?\"100%\":\"max-content\",height:isVertical?\"max-content\":\"100%\",willChange:\"transform\"},children:items.map((child,index)=>/*#__PURE__*/_jsx(WaveItem,{index:index,amplitude:waveAmplitude,speed:verticalSpeed,stagger:waveStagger,isVertical:isVertical,children:child},index))})});}function WaveItem({children,index,amplitude,speed,stagger,isVertical}){const ref=useRef(null);useAnimationFrame(time=>{if(!ref.current)return;const frequency=speed/50;const phaseOffset=index*stagger*Math.PI;const t=time/1e3;const offset=amplitude*Math.sin(2*Math.PI*frequency*t+phaseOffset);if(isVertical){ref.current.style.transform=`translateX(${offset}px)`;}else{ref.current.style.transform=`translateY(${offset}px)`;}});return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexShrink:0},children:children});}addPropertyControls(WaveTicker,{slots:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},title:\"Children\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:10,min:0,max:100,unit:\"%\"},hoverSpeed:{type:ControlType.Number,title:\"Hover Speed\",defaultValue:100,min:0,max:100,unit:\"%\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"left\",\"right\",\"top\",\"bottom\"],optionTitles:[\"Left\",\"Right\",\"Top\",\"Bottom\"],defaultValue:\"left\"},alignment:{type:ControlType.Enum,title:\"Align\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],defaultValue:\"center\",displaySegmentedControl:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:20,min:0},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"20px\"},fadeContent:{type:ControlType.Boolean,title:\"Fade\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},fadeWidth:{type:ControlType.Number,title:\"Fade Width\",defaultValue:50,min:0,unit:\"px\",hidden:props=>!props.fadeContent},waveAmplitude:{type:ControlType.Number,title:\"Wave Height\",defaultValue:20,min:0,max:100,unit:\"px\"},verticalSpeed:{type:ControlType.Number,title:\"Wave Speed\",defaultValue:25,min:1,max:100,step:1},waveStagger:{type:ControlType.Number,title:\"Wave Flow\",defaultValue:.2,min:0,max:2,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WaveTicker\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicHeight\":\"200\",\"framerIntrinsicWidth\":\"800\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WaveTicker.map"],"mappings":"uPAUG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,EAAE,QAAM,aAAW,gBAAc,gBAAc,cAAY,GAAG,MAAI,YAAU,YAAU,SAAS,UAAQ,cAAY,aAAW,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAQ,EAAaC,EAAO,IAAI,EAAQ,EAAWA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