{"version":3,"file":"Ticker_1.TD4Fdx-R.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/7AiLEQD4EgPvfOYX4DOl/CbC6sCbITgqsKSFauq3d/Ticker_1.js"],"sourcesContent":["// Ticker component with customizable mask, padding, speed, and direction\n// Based on official ticker but with fit-content height and linked elements\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState,useEffect,useRef}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function Ticker(props){const{children,speed=50,direction=\"left\",paddingVertical=0,maskHorizontal=0,gap=20,style}=props;const[contentWidth,setContentWidth]=useState(0);const contentRef=useRef(null);useEffect(()=>{if(contentRef.current){const width=contentRef.current.scrollWidth;setContentWidth(width);}},[children]);const duration=contentWidth/speed;const isLeftDirection=direction===\"left\";const maskImage=maskHorizontal>0?`linear-gradient(to right, transparent, black ${maskHorizontal}px, black calc(100% - ${maskHorizontal}px), transparent)`:undefined;return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\",paddingTop:paddingVertical,paddingBottom:paddingVertical,display:\"flex\",alignItems:\"center\",maskImage,WebkitMaskImage:maskImage},children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",width:\"fit-content\",gap},children:[/*#__PURE__*/_jsx(motion.div,{ref:contentRef,style:{display:\"flex\",gap,flexShrink:0},animate:{x:isLeftDirection?[-contentWidth-gap,0]:[0,-contentWidth-gap]},transition:{duration,repeat:Infinity,ease:\"linear\"},children:children}),/*#__PURE__*/_jsx(motion.div,{style:{display:\"flex\",gap,flexShrink:0},animate:{x:isLeftDirection?[-contentWidth-gap,0]:[0,-contentWidth-gap]},transition:{duration,repeat:Infinity,ease:\"linear\"},children:children})]})});}addPropertyControls(Ticker,{children:{type:ControlType.Array,control:{type:ControlType.ComponentInstance},title:\"Elements\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:50,min:10,max:200,step:10,unit:\"px/s\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:20,min:0,max:100,step:5,unit:\"px\"},paddingVertical:{type:ControlType.Number,title:\"Padding Vertical\",defaultValue:0,min:0,max:100,step:5,unit:\"px\"},maskHorizontal:{type:ControlType.Number,title:\"Mask Horizontal\",defaultValue:0,min:0,max:200,step:10,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Ticker\",\"slots\":[\"children\"],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Ticker_1.map"],"mappings":"iPAKG,SAAwB,EAAO,EAAM,CAAC,GAAK,CAAC,WAAS,QAAM,GAAG,YAAU,OAAO,kBAAgB,EAAE,iBAAe,EAAE,MAAI,GAAG,SAAO,EAAW,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAO,EAAWC,EAAO,KAAK,CAAC,MAAc,CAAC,GAAG,EAAW,QAAQ,CAAC,IAAM,EAAM,EAAW,QAAQ,YAAY,EAAgB,EAAM,GAAI,CAAC,EAAS,CAAC,CAAC,IAAM,EAAS,EAAa,EAAY,EAAgB,IAAY,OAAa,EAAU,EAAe,EAAE,gDAAgD,EAAe,wBAAwB,EAAe,mBAAmB,IAAA,GAAU,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,OAAO,OAAO,OAAO,SAAS,WAAW,SAAS,SAAS,WAAW,EAAgB,cAAc,EAAgB,QAAQ,OAAO,WAAW,SAAS,YAAU,gBAAgB,EAAU,CAAC,SAAsB,EAAM,MAAM,CAAC,MAA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