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