{"version":3,"file":"Src_Scripts_components_custom-animation_js.acf02b5d63a54d488cf3.js","sources":["webpack://FinansDanmark/./Src/Scripts/components/custom-animation.js"],"sourcesContent":["export default class CustomAnimation {\r\n constructor(elm, args) {\r\n\r\n if (isInViewport(elm)) {\r\n elm.classList.add('section-animation');\r\n }\r\n\r\n window.addEventListener('scroll', e => {\r\n\r\n if (isInViewport(elm)) {\r\n elm.classList.add('section-animation');\r\n }\r\n });\r\n\r\n function isInViewport(element) {\r\n const rect = element.getBoundingClientRect();\r\n return (\r\n rect.top >= 0 &&\r\n rect.left >= 0 &&\r\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n rect.right <= (window.innerWidth || document.documentElement.clientWidth)\r\n );\r\n }\r\n }\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAxBA;AACA;A;;A;;A","sourceRoot":""}