{"version":3,"file":"VerticalShift.BbgyKWmd.mjs","names":[],"sources":["https:/framerusercontent.com/modules/vJsrs08ioWdlFeCsCORF/iSBd4WRVpCLuAOKyQT9q/TextTicker.js","https:/framerusercontent.com/modules/zSHsMvIzgaH078szfmL4/ZP1jC91rTcqBGzLMLdi8/VerticalShift.js"],"sourcesContent":["// Simple horizontal text ticker that scrolls text continuously\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef,useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Simple Text Ticker\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 50\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function TextTicker(props){const{text=\"Breaking News\",speed=40,gap=40,textColor=\"#000000\",font,style,reverseOnScroll=true}=props;const isStatic=useIsStaticRenderer();const containerRef=useRef(null);const textRef=useRef(null);const[textWidth,setTextWidth]=useState(0);const[containerWidth,setContainerWidth]=useState(0);const[offset,setOffset]=useState(0);const[direction,setDirection]=useState(1);const[repeatCount,setRepeatCount]=useState(10);useEffect(()=>{if(typeof window===\"undefined\"||!containerRef.current||!textRef.current)return;const tw=textRef.current.offsetWidth;const cw=containerRef.current.offsetWidth;setTextWidth(tw);setContainerWidth(cw);if(tw>0&&cw>0){const minRepeats=Math.ceil(cw*3/(tw+gap));setRepeatCount(Math.max(minRepeats,10));}},[text,font,gap]);useEffect(()=>{if(!reverseOnScroll||isStatic)return;let lastScrollX=window.scrollX;const handleScroll=()=>{const currentScrollX=window.scrollX;if(currentScrollX>lastScrollX){// Scrolling right\nstartTransition(()=>setDirection(1));}else if(currentScrollX<lastScrollX){// Scrolling left\nstartTransition(()=>setDirection(-1));}lastScrollX=currentScrollX;};window.addEventListener(\"scroll\",handleScroll,{passive:true});return()=>window.removeEventListener(\"scroll\",handleScroll);},[reverseOnScroll,isStatic]);useEffect(()=>{if(isStatic)return;if(textWidth===0)return;let frame;let last=performance.now();function tick(now){const dt=(now-last)/1e3;last=now;startTransition(()=>{setOffset(prev=>{let next=prev-speed*direction*dt;const stripWidth=textWidth+gap;if(next<=-stripWidth){next+=stripWidth;}else if(next>0){next-=stripWidth;}return next;});});frame=requestAnimationFrame(tick);}frame=requestAnimationFrame(tick);return()=>cancelAnimationFrame(frame);},[speed,textWidth,gap,repeatCount,isStatic,direction]);useEffect(()=>{setOffset(0);},[text,textWidth,gap]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",...style},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"row\",alignItems:\"center\",position:\"absolute\",left:0,top:0,height:\"100%\",willChange:\"transform\",transform:isStatic?undefined:`translateX(${offset}px)`},children:Array.from({length:repeatCount}).map((_,i)=>/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:i===0?textRef:undefined,style:{color:textColor,whiteSpace:\"nowrap\",...font},children:text}),/*#__PURE__*/_jsx(\"div\",{style:{width:gap}})]},i))})});}addPropertyControls(TextTicker,{reverseOnScroll:{type:ControlType.Boolean,title:\"Direction with Scroll\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},text:{type:ControlType.String,title:\"Text\",defaultValue:\"Breaking News\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:40,min:10,max:200,step:1},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:40,min:0,max:200,step:1},textColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:18,lineHeight:1.3,letterSpacing:0,textAlign:\"left\",variant:\"Medium\"},controls:\"extended\",defaultFontType:\"sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextTicker\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"50\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextTicker.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useRef}from\"react\";import{useTransform,useScroll}from\"framer-motion\";// Vertical shift override for horizontal scrolling elements\n// When element enters from right and leaves from left, it shifts downward\nexport function withVerticalShift100vh(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const elementRef=useRef(null);const{scrollXProgress}=useScroll({target:elementRef,axis:\"x\",offset:[\"start end\",\"end start\"]});// Transform from 0 to 100vh (using vh units for responsive design)\nconst y=useTransform(scrollXProgress,[0,1],[\"0vh\",\"100vh\"]);return /*#__PURE__*/_jsx(Component,{ref:node=>{if(typeof ref===\"function\")ref(node);else if(ref)ref.current=node;elementRef.current=node;},...props,style:{...props.style,y}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withVerticalShift100vh\":{\"type\":\"reactHoc\",\"name\":\"withVerticalShift100vh\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./VerticalShift.map"],"mappings":"6cAQG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,OAAK,gBAAgB,QAAM,GAAG,MAAI,GAAG,YAAU,UAAU,OAAK,QAAM,mBAAgB,EAAK,CAAC,EAAY,EAAS,GAAqB,CAAO,EAAa,EAAO,KAAK,CAAO,EAAQ,EAAO,KAAK,CAAM,CAAC,EAAU,EAAa,CAAC,EAAS,EAAE,CAAM,CAAC,EAAe,EAAkB,CAAC,EAAS,EAAE,CAAM,CAAC,EAAO,EAAU,CAAC,EAAS,EAAE,CAAM,CAAC,EAAU,EAAa,CAAC,EAAS,EAAE,CAAM,CAAC,EAAY,EAAe,CAAC,EAAS,GAAG,CAE2T,MAF1T,GAAU,IAAI,CAAC,G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