frohzinn's picture
download
raw
297 Bytes
/**
* Check if an element is within the current viewport.
*/
export function isElementInViewport(node: HTMLElement): boolean {
const rect = node.getBoundingClientRect();
return (
rect.top < window.innerHeight &&
rect.bottom > 0 &&
rect.left < window.innerWidth &&
rect.right > 0
);
}

Xet Storage Details

Size:
297 Bytes
·
Xet hash:
89c9247a3522aca92c139923e6c613c69bb1c556a611b8d106a4893fbca71524

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.