{"version":3,"file":"TickerWithVelocity.DaIGtrlj.mjs","names":["useState","useRef","React.useRef"],"sources":["https:/framerusercontent.com/modules/6cWeGliDfQxZFW8DAKJ5/aKnUkwgSLG7wa7o05zBV/FrameTransitioner.js","https:/framerusercontent.com/modules/tcEJCM1AZtZsqdIb7H8A/ruZQLfE4UFoJkFm7lutU/TickerWithVelocity.js"],"sourcesContent":["// Frame Carousel Component - Cycles through connected frames with customizable transitions\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function FrameTransitioner(props){const{frames=[],delay=.5,showTime=3,blurAmount=5,scaleAmount=.9,startDelay=0,horizontalAlignment=\"center\",verticalAlignment=\"center\"}=props;const[currentIndex,setCurrentIndex]=useState(0);const intervalRef=useRef(null);const isStatic=useIsStaticRenderer();const getJustifyContent=()=>{switch(horizontalAlignment){case\"left\":return\"flex-start\";case\"right\":return\"flex-end\";default:return\"center\";}};const getAlignItems=()=>{switch(verticalAlignment){case\"top\":return\"flex-start\";case\"bottom\":return\"flex-end\";default:return\"center\";}};// Cycle through frames\nuseEffect(()=>{if(isStatic||frames.length<=1)return;const startCycle=()=>{intervalRef.current=window.setInterval(()=>{startTransition(()=>{setCurrentIndex(prevIndex=>prevIndex===frames.length-1?0:prevIndex+1);});},(showTime+delay)*1e3);};// Add initial delay before starting the cycle\nconst initialTimeout=window.setTimeout(()=>{startCycle();},startDelay*1e3);return()=>{if(intervalRef.current){clearInterval(intervalRef.current);}clearTimeout(initialTimeout);};},[frames.length,showTime,delay,startDelay,isStatic]);// Show static preview if no frames or in static mode\nif(frames.length===0){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),color:\"#666\",fontSize:\"14px\",fontFamily:\"system-ui, sans-serif\"},children:\"Connect frames\"});}if(isStatic){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent()},children:frames[0]});}return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"wait\",children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,filter:`blur(${blurAmount}px)`,scale:scaleAmount},animate:{opacity:1,filter:\"blur(0px)\",scale:1},exit:{opacity:0,filter:`blur(${blurAmount}px)`,scale:scaleAmount},transition:{duration:delay,ease:\"easeInOut\"},style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),position:\"relative\"},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:getAlignItems(),justifyContent:getJustifyContent(),width:\"100%\",height:\"100%\"},children:frames[currentIndex]})},currentIndex)})});}addPropertyControls(FrameTransitioner,{frames:{type:ControlType.Array,title:\"Frames\",control:{type:ControlType.ComponentInstance},maxCount:10,defaultValue:[]},startDelay:{type:ControlType.Number,title:\"Start Delay\",defaultValue:0,min:0,max:10,step:.1,unit:\"s\"},delay:{type:ControlType.Number,title:\"Transition Duration\",defaultValue:.5,min:.1,max:3,step:.1,unit:\"s\"},showTime:{type:ControlType.Number,title:\"Frame Display Time\",defaultValue:3,min:.5,max:10,step:.5,unit:\"s\"},blurAmount:{type:ControlType.Number,title:\"Blur Amount\",defaultValue:5,min:0,max:20,step:1,unit:\"px\"},scaleAmount:{type:ControlType.Number,title:\"Scale Amount\",defaultValue:.9,min:.5,max:1.5,step:.05},horizontalAlignment:{type:ControlType.Enum,title:\"Horizontal Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},verticalAlignment:{type:ControlType.Enum,title:\"Vertical Alignment\",options:[\"top\",\"center\",\"bottom\"],optionTitles:[\"Top\",\"Center\",\"Bottom\"],defaultValue:\"center\",displaySegmentedControl:true,description:\"Follow the creator on [Twitter](https://x.com/Muhammad_maass)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FrameTransitioner\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FrameTransitioner.map","import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{useScroll,useVelocity,useAnimationFrame}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function ScrollSpeedTicker(props){const{items=[],gap=40,baseSpeed=60}=props;const{scrollY}=useScroll();const velocity=useVelocity(scrollY);const containerRef=React.useRef(null);const speedRef=React.useRef(1);const directionRef=React.useRef(-1)// -1 = left, 1 = right\n;const x=React.useRef(0);// 👇 keep your speed logic, just add direction\nReact.useEffect(()=>{return velocity.on(\"change\",v=>{// detect direction\nif(v>0)directionRef.current=-1// scroll down → move left\n;if(v<0)directionRef.current=1// scroll up → move right\n;// your original speed logic\nconst normalized=Math.min(Math.abs(v)/200,150);const target=1+normalized;speedRef.current+=(target-speedRef.current)*.05;});},[velocity]);useAnimationFrame((t,delta)=>{// 👇 decay back to base speed (momentum)\nspeedRef.current+=(1-speedRef.current)*.02;const moveBy=baseSpeed*speedRef.current*delta/1e3*directionRef.current;x.current+=moveBy;if(containerRef.current){const width=containerRef.current.scrollWidth/2;if(Math.abs(x.current)>=width){x.current=0;}containerRef.current.style.transform=`translateX(${x.current}px)`;}});return /*#__PURE__*/_jsx(\"div\",{style:{overflow:\"hidden\",width:\"100%\",display:\"flex\"},children:/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{display:\"flex\",whiteSpace:\"nowrap\"},children:[...items,...items,...items,...items,...items].map((item,i)=>/*#__PURE__*/_jsx(\"div\",{style:{marginRight:gap,display:\"flex\",alignItems:\"center\"},children:item},i))})});}addPropertyControls(ScrollSpeedTicker,{items:{type:ControlType.Array,title:\"Items\",control:{type:ControlType.ComponentInstance}},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:40,min:0,max:200},baseSpeed:{type:ControlType.Number,title:\"Base Speed\",defaultValue:50,min:10,max:200}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollSpeedTicker\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TickerWithVelocity.map"],"mappings":"kSAKG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,SAAO,EAAE,CAAC,QAAM,GAAG,WAAS,EAAE,aAAW,EAAE,cAAY,GAAG,aAAW,EAAE,sBAAoB,SAAS,oBAAkB,UAAU,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAO,EAAYC,EAAO,KAAK,CAAO,EAAS,GAAqB,CAAO,MAAsB,CAAC,OAAO,EAAP,CAA4B,IAAI,OAAO,MAAM,aAAa,IAAI,QAAQ,MAAM,WAAW,QAAQ,MAAM,WAAkB,MAAkB,CAAC,OAAO,EAAP,CAA0B,IAAI,MAAM,MAAM,aAAa,IAAI,SAAS,MAAM,WAAW,QAAQ,MAAM,WAGxI,OAFtb,MAAc,CAAC,GAAG,GAAU,EAAO,QAAQ,EAAE,OAAO,IAAM,MAAe,CAAC,EAAY,QAAQ,EAAO,gBAAgB,CAAC,MAAoB,CAAC,EAAgB,GAAW,IAAY,EAAO,OAAO,EAAE,EAAE,EAAU,EAAE,EAAG,GAAI,EAAS,GAAO,IAAI,EACrO,EAAe,EAAO,eAAe,CAAC,GAAY,EAAG,EA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