UNPKG

react-scrollsense

Version:

A lightweight scroll sensor to solve your react scroll into viewport issues.

3 lines (2 loc) 396 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getVisibleHeight=function(t){let{wndHeight:e,boundingClientRect:{top:i,bottom:n,height:o}}=t;return n<0||i>=e?0:i<e&&n>e?e-i:i<0&&n>=0?n:o},exports.getVisibleWidth=function(t){let{wndWidth:e,boundingClientRect:{left:i,right:n,width:o}}=t;return n<0||i>=e?0:i<e&&n>e?e-i:i<0&&n>=0?n:o}; //# sourceMappingURL=index.js.map