From 91a7ae64dfb1df8fc815785dbc8a4a91dd99b270 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 28 May 2024 15:30:40 +0200 Subject: [PATCH] refactor: Drop unused files from source Signed-off-by: Ferdinand Thiessen --- src/utils/IsOutOfViewport.js | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 src/utils/IsOutOfViewport.js diff --git a/src/utils/IsOutOfViewport.js b/src/utils/IsOutOfViewport.js deleted file mode 100644 index 2e1b07af00..0000000000 --- a/src/utils/IsOutOfViewport.js +++ /dev/null @@ -1,36 +0,0 @@ -/*! - * Check if an element is out of the viewport - * (c) 2018 Chris Ferdinandi, MIT License, https://gomakethings.com - * @param {Node} elem The element to check - * @return {Object} A set of booleans for each side of the element - */ -const isOutOfViewport = function(elem) { - // Get element's bounding - const bounding = elem.getBoundingClientRect() - const contentHeight = document.documentElement.clientHeight - const contentWidth = document.documentElement.clientWidth - - // Check if it's out of the viewport on each side - const out = Object.assign({}) - out.top = bounding.top < 0 - out.left = bounding.left < 0 - out.bottom = bounding.bottom > contentHeight - out.right = bounding.right > contentWidth - out.any = out.top || out.left || out.bottom || out.right - out.all = out.top && out.left && out.bottom && out.right - - out.offsetY = out.top - ? bounding.top - : out.bottom - ? bounding.bottom - contentHeight - : 0 - out.offsetX = out.left - ? bounding.left - : out.right - ? bounding.right - contentWidth - : 0 - - return out -} - -export default isOutOfViewport