import{useState as e,useEffect as r}from"react";import t from"./useWindowSize.js";import{getPercentageVisible as o}from"../common/helpers.js";let a=({containerBoundingClientRect:a,backgroundBoundingClientRect:l,speed:s=1})=>{let[i,m]=e(0),[u,n]=e(0),{height:f}=t();return r(()=>{l&&a&&m(l.height-a.height)},[a,l]),r(()=>{if(!a||!l||!f)return;let e=o(l,f),r=e/100*i-i/2;n(-(r*s*1))},[i,f,a,l,s]),{translateValue:u}};export{a as default,a as useTranslateValue};
