All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.util.isElementInView.js.map Maven / Gradle / Ivy

{"version":3,"file":"isElementInView.js","sourceRoot":"","sources":["../../src/util/isElementInView.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,eAAe,GAAG,CAAC,EAAe,EAAE,EAAE;IAC3C,MAAM,IAAI,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;IAExC,OAAO,CACN,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC;WAC3B,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC;WAC5E,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,CAC7E,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["/**\n * Determines if the element is within the viewport.\n * @param el {HTMLElement}\n */\nconst isElementInView = (el: HTMLElement) => {\n\tconst rect = el.getBoundingClientRect();\n\n\treturn (\n\t\trect.top >= 0 && rect.left >= 0\n\t\t\t&& rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n\t\t\t&& rect.right <= (window.innerWidth || document.documentElement.clientWidth)\n\t);\n};\n\nexport default isElementInView;\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy