{"version":3,"file":"ScrollLine.Bsjf6aHU.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/q2kVyKSZsFceFWDh7Hjz/E3XmRQ8gSHSVmDHv4ao1/ScrollLine.js"],"sourcesContent":["// Pedido do usuário: remover Mouse Y e substituir por uma nova opção Stack Viewport, mantendo Scroll/Parent Scroll, indicador de progresso do stack pai e espessura exata sem fallback de 5px.\n// Linha com animação de progresso baseada em scroll\n// Linha base com opacidade e linha branca sólida que desce conforme scroll\n// Largura fit (auto) e altura fill (100%)\n// Suporta valores de espessura menores que 1px (como 0.5px)\n// Sem bordas arredondadas ou radius\n// Controle de velocidade da animação\n// Animação pode começar a partir de uma scroll section específica com controles de alinhamento\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useScroll,useTransform,motion}from\"framer-motion\";import{useRef,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Scroll Progress Line\n * \n * @framerIntrinsicWidth 5\n * @framerIntrinsicHeight 200\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ScrollLine(props){const{animationType=\"scroll\",baseColor=\"#FFFFFF\",baseOpacity=.3,progressColor=\"#FFFFFF\",thickness=4,orientation=\"vertical\",speed=1,scrollSection={enabled:false,sectionId:\"\",containerAlign:\"start\",targetAlign:\"end\"},style}=props;const containerRef=useRef(null);const scrollContainerRef=useRef(null);const parentTargetRef=useRef(null);// Find and store the scroll section container\nuseEffect(()=>{if(scrollSection.enabled&&scrollSection.sectionId&&typeof document!==\"undefined\"){const element=document.querySelector(`[data-framer-name=\"${scrollSection.sectionId}\"]`);if(element){scrollContainerRef.current=element;}}},[scrollSection.enabled,scrollSection.sectionId]);useEffect(()=>{if(typeof window===\"undefined\")return;const rootElement=containerRef.current;if(!rootElement)return;parentTargetRef.current=rootElement.parentElement??rootElement;},[]);// Build offset string based on alignment settings\nconst offsetStart=`${scrollSection.containerAlign} ${scrollSection.targetAlign}`;const offsetEnd=scrollSection.enabled?`end ${scrollSection.targetAlign}`:\"end start\";// Track scroll progress with optional scroll section target\nconst{scrollYProgress}=useScroll(scrollSection.enabled&&scrollContainerRef.current?{target:containerRef,container:scrollContainerRef,offset:[offsetStart,offsetEnd]}:{target:containerRef,offset:[\"start end\",\"end start\"]});const{scrollYProgress:parentScrollYProgress}=useScroll({target:parentTargetRef,offset:[\"start end\",\"end center\"]});const{scrollYProgress:stackViewportYProgress}=useScroll({target:parentTargetRef,offset:[\"start end\",\"end end\"]});// Transform progress to height/width percentage with mode-aware source\nconst progressSource=useTransform(()=>{const scrollValue=scrollYProgress.get();const parentScrollValue=parentScrollYProgress.get();const stackViewportValue=stackViewportYProgress.get();if(animationType===\"parentScroll\")return parentScrollValue;if(animationType===\"stackViewport\")return stackViewportValue;return scrollValue;});const progress=useTransform(progressSource,[0,1],[\"0%\",\"100%\"]);const isVertical=orientation===\"vertical\";const isStackViewport=animationType===\"stackViewport\";const thicknessPx=`${thickness}px`;return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...style,position:\"relative\",width:isVertical?thicknessPx:\"100%\",height:isVertical?isStackViewport?\"100vh\":\"100%\":thicknessPx,display:\"flex\",justifyContent:\"center\",alignItems:\"center\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:isStackViewport?\"sticky\":\"relative\",top:isStackViewport?0:undefined,left:0,width:isVertical?thicknessPx:\"100%\",height:isVertical?isStackViewport?\"100vh\":\"100%\":thicknessPx},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:isVertical?0:\"50%\",left:isVertical?\"50%\":0,width:isVertical?thicknessPx:\"100%\",height:isVertical?\"100%\":thicknessPx,backgroundColor:baseColor,opacity:baseOpacity,transform:isVertical?\"translateX(-50%)\":\"translateY(-50%)\"}}),/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:isVertical?0:\"50%\",left:isVertical?\"50%\":0,width:isVertical?thicknessPx:progress,height:isVertical?progress:thicknessPx,backgroundColor:progressColor,transformOrigin:isVertical?\"top center\":\"left center\",transform:isVertical?\"translateX(-50%)\":\"translateY(-50%)\"}})]})});}addPropertyControls(ScrollLine,{animationType:{type:ControlType.Enum,title:\"Animation\",options:[\"scroll\",\"parentScroll\",\"stackViewport\"],optionTitles:[\"Scroll\",\"Parent Scroll\",\"Stack Viewport\"],defaultValue:\"scroll\"},orientation:{type:ControlType.Enum,title:\"Orientation\",options:[\"vertical\",\"horizontal\"],optionTitles:[\"Vertical\",\"Horizontal\"],defaultValue:\"vertical\",displaySegmentedControl:true},scrollSection:{type:ControlType.Object,title:\"Scroll Section\",hidden:props=>props.animationType!==\"scroll\",controls:{enabled:{type:ControlType.Boolean,title:\"Trigger\",defaultValue:false,enabledTitle:\"Section in View\",disabledTitle:\"Page Scroll\"},sectionId:{type:ControlType.String,title:\"Section\",defaultValue:\"\",placeholder:\"Select...\",hidden:({enabled})=>!enabled},containerAlign:{type:ControlType.Enum,title:\"Viewport\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],defaultValue:\"start\",displaySegmentedControl:true,hidden:({enabled})=>!enabled},targetAlign:{type:ControlType.Enum,title:\" \",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],defaultValue:\"end\",displaySegmentedControl:true,hidden:({enabled})=>!enabled}}},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:.1,max:3,step:.1},baseColor:{type:ControlType.Color,title:\"Base Color\",defaultValue:\"#FFFFFF\"},baseOpacity:{type:ControlType.Number,title:\"Base Opacity\",defaultValue:.3,min:0,max:1,step:.1},progressColor:{type:ControlType.Color,title:\"Progress Color\",defaultValue:\"#FFFFFF\"},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:4,min:.1,max:20,step:.1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollLine\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerIntrinsicWidth\":\"5\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollLine.map"],"mappings":"sQAgBG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,gBAAc,SAAS,YAAU,UAAU,cAAY,GAAG,gBAAc,UAAU,YAAU,EAAE,cAAY,WAAW,QAAM,EAAE,gBAAc,CAAC,QAAQ,GAAM,UAAU,GAAG,eAAe,QAAQ,YAAY,KAAK,EAAE,SAAO,EAAY,EAAaA,EAAO,IAAI,EAAQ,EAAmBA,EAAO,IAAI,EAAQ,EAAgBA,EAAO,IAAI,EACxX,MAAc,CAAC,GAAG,EAAc,SAAS,EAAc,WAAW,OAAO,SAAW,IAAY,CAAC,IAAM,EAAQ,SAAS,cAAc,sBAAsB,EAAc,UAAU,GAAG,EAAK,IAAS,EAAmB,QAAQ,EAAS,CAAC,EAAE,CAAC,EAAc,QAAQ,EAAc,SAAS,CAAC,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAY,EAAa,QAAY,IAAmB,EAAgB,QAAQ,EAAY,eAAe,EAAY,EAAE,CAAC,CAAC,EACnd,IAAM,EAAY,GAAG,EAAc,eAAe,GAAG,EAAc,cAAoB,EAAU,EAAc,QAAQ,OAAO,EAAc,cAAc,YACrJ,CAAC,mBAAiB,EAAU,EAAc,SAAS,EAAmB,QAAQ,CAAC,OAAO,EAAa,UAAU,EAAmB,OAAO,CAAC,EAAY,CAAS,CAAC,EAAE,CAAC,OAAO,EAAa,OAAO,CAAC,YAAY,WAAW,CAAC,CAAC,EAAO,CAAC,gBAAgB,GAAuB,EAAU,CAAC,OAAO,EAAgB,OAAO,CAAC,YAAY,YAAY,CAAC,CAAC,EAAO,CAAC,gBAAgB,GAAwB,EAAU,CAAC,OAAO,EAAgB,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