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wwwroot/./src/scripts/FloatingCards.js"],"sourcesContent":["import { Swiper, Navigation, Keyboard, A11y } from 'swiper';\r\n\r\nconst floatingCardsSections = document.querySelectorAll(\".adm-section-c10\");\r\n\r\nfor (const floatingCardsSection of floatingCardsSections) {\r\n const scrollableContainer = floatingCardsSection.firstElementChild;\r\n const leftButton = scrollableContainer.nextElementSibling.querySelector(\".adm-btn-c10-left-arrow\");\r\n const rightButton = scrollableContainer.nextElementSibling.querySelector(\".adm-btn-c10-right-arrow\");\r\n const leftAligned = scrollableContainer.classList.contains(\"adm-div-c10-left-aligned\");\r\n let contentContainerLeftMargin;\r\n let cardsContainerLeftMargin;\r\n let contentContainerRightMargin;\r\n let cardsContainerRightMargin;\r\n let scrollerTotalWidth;\r\n let scrollerLimitPosition;\r\n let currentPosition;\r\n let futurePosition;\r\n\r\n activateKeyboardNavigation(floatingCardsSection);\r\n\r\n const componentCTA = floatingCardsSection?.querySelector(\".adm-btn.adm-bg-navy a\");\r\n componentCTA?.addEventListener(\"focus\", () => {\r\n scrollScreen(0);\r\n });\r\n\r\n addRightScrolling();\r\n addLeftScrolling();\r\n \r\n function scrollScreen(position) {\r\n for (const childrenElement of scrollableContainer.children) {\r\n childrenElement.style.transform = `translateX(${position}px)`;\r\n childrenElement.style.transition = `transform 1.5s`;\r\n }\r\n \r\n const isTextStillVisibleLeft = contentContainerLeftMargin + position >= 100;\r\n const isTextStillVisibleRight = contentContainerRightMargin - position >= 100;\r\n switch (true) {\r\n case position < 0 && position !== 0 && isTextStillVisibleLeft:\r\n case position > 0 && position !== 0 && isTextStillVisibleRight:\r\n leftButton.style.opacity = \"0\";\r\n rightButton.style.opacity = \"0\";\r\n window.addEventListener(\"resize\", displaySideButtons);\r\n break;\r\n }\r\n }\r\n \r\n function displaySideButtons() {\r\n leftButton.style.opacity = \"1\";\r\n rightButton.style.opacity = \"1\";\r\n window.removeEventListener(\"resize\", displaySideButtons);\r\n }\r\n \r\n function getFocusedElementC10() {\r\n if (document.activeElement.classList.contains(\"adm-figure-c10-card\")) {\r\n return document.activeElement;\r\n } else if (document.activeElement.parentElement.parentElement.classList.contains(\"adm-div-c10-card-button\")) {\r\n return document.activeElement.parentElement.parentElement;\r\n }\r\n }\r\n \r\n function activateKeyboardNavigation(componentSection) {\r\n for (const figure of componentSection.querySelectorAll(\".adm-figure-c10-img\")) {\r\n figure?.addEventListener(\"keydown\", e => {\r\n if (e.keyCode === 9) {\r\n setTimeout(() => {\r\n updateC10Setting();\r\n const focusedElementC10 = getFocusedElementC10();\r\n const rect = focusedElementC10?.getBoundingClientRect();\r\n const isOutsideScreenLeft = rect?.x < 0;\r\n const isOutsideScreenRight = (rect?.x + rect?.width) > window.innerWidth;\r\n \r\n if (isOutsideScreenRight) {\r\n leftButton.style.display = \"flex\";\r\n futurePosition = currentPosition - (window.innerWidth / 2);\r\n scrollScreen(futurePosition);\r\n } else if (isOutsideScreenLeft) {\r\n rightButton.style.display = \"block\";\r\n futurePosition = currentPosition + (window.innerWidth / 2);\r\n scrollScreen(futurePosition);\r\n }\r\n }, 200);\r\n }\r\n });\r\n }\r\n }\r\n \r\n function addRightScrolling() {\r\n rightButton?.addEventListener(\"click\", () => {\r\n updateC10Setting();\r\n leftButton.style.display = \"flex\";\r\n futurePosition = currentPosition - (window.innerWidth / 2);\r\n \r\n switch (leftAligned) {\r\n case true:\r\n if (futurePosition >= -scrollerLimitPosition) {\r\n scrollScreen(futurePosition);\r\n } else {\r\n rightButton.style.display = \"none\";\r\n scrollScreen(-scrollerLimitPosition - 95);\r\n }\r\n break;\r\n \r\n case false:\r\n if (futurePosition >= contentContainerRightMargin) {\r\n scrollScreen(futurePosition);\r\n } else {\r\n rightButton.style.display = \"none\";\r\n scrollScreen(0);\r\n }\r\n break;\r\n }\r\n })\r\n }\r\n \r\n function addLeftScrolling() {\r\n leftButton?.addEventListener(\"click\", () => {\r\n updateC10Setting();\r\n rightButton.style.display = \"block\";\r\n futurePosition = currentPosition + (window.innerWidth / 2);\r\n \r\n switch (leftAligned) {\r\n case true:\r\n if (futurePosition >= -contentContainerLeftMargin) {\r\n leftButton.style.display = \"none\";\r\n scrollScreen(0);\r\n } else {\r\n scrollScreen(futurePosition);\r\n }\r\n break;\r\n \r\n case false:\r\n if (futurePosition <= scrollerLimitPosition) {\r\n scrollScreen(futurePosition);\r\n } else {\r\n leftButton.style.display = \"none\";\r\n scrollScreen(scrollerLimitPosition + 95);\r\n }\r\n break;\r\n }\r\n })\r\n }\r\n \r\n function updateC10Setting() {\r\n const contentContainer = scrollableContainer?.firstElementChild;\r\n const cardsContainer = contentContainer?.nextElementSibling;\r\n \r\n contentContainerLeftMargin = +window.getComputedStyle(contentContainer).marginLeft?.match(/(\\d+)/)?.[0];\r\n cardsContainerLeftMargin = +window.getComputedStyle(cardsContainer).marginLeft?.match(/(\\d+)/)?.[0];\r\n contentContainerRightMargin = +window.getComputedStyle(contentContainer).marginRight?.match(/(\\d+)/)?.[0];\r\n cardsContainerRightMargin = +window.getComputedStyle(cardsContainer).marginRight?.match(/(\\d+)/)?.[0];\r\n scrollerTotalWidth = contentContainerLeftMargin + cardsContainerLeftMargin + contentContainerRightMargin + cardsContainerRightMargin + contentContainer.offsetWidth + cardsContainer.offsetWidth;\r\n scrollerLimitPosition = scrollerTotalWidth - window.innerWidth;\r\n if (leftAligned) {\r\n currentPosition = -parseFloat(contentContainer?.style?.transform?.match(/(\\d+)/)?.[0]) || 0;\r\n } else {\r\n currentPosition = parseFloat(contentContainer?.style?.transform?.match(/(\\d+)/)?.[0]) || 0;\r\n }\r\n }\r\n}\r\n\r\n//MOBILE\r\nconst floatingCardsMobileSections = document.querySelectorAll(\".adm-section-c10-mobile\");\r\n\r\nArray.prototype.forEach.call(floatingCardsMobileSections, (floatingCardsMobileSection, index) => {\r\n floatingCardsMobileSection.classList.add(`section-${index}`);\r\n\r\n var swiperc10 = new Swiper(`.adm-section-c10-mobile.section-${index} .swiper`, {\r\n modules: [Navigation, Keyboard, A11y],\r\n slidesPerView: 4,\r\n spaceBetween: 16,\r\n slidesPerGroup: 1,\r\n centeredSlides: true,\r\n speed: 1500,\r\n a11y: {\r\n prevSlideMessage: \"Previous slide\",\r\n nextSlideMessage: \"Next slide\"\r\n },\r\n keyboard: {\r\n enabled: true,\r\n onlyInViewPort: false\r\n },\r\n navigation: {\r\n nextEl: `.adm-section-c10-mobile.section-${index} .adm-c10-teaser-floating-arrow-right`,\r\n prevEl: `.adm-section-c10-mobile.section-${index} .adm-c10-teaser-floating-arrow-left`,\r\n disabledClass: \"adm-arrow-disabled\"\r\n }\r\n });\r\n\r\n swiperc10.on(\"realIndexChange\",\r\n function () {\r\n const paginationSwiperc10 = floatingCardsMobileSection.querySelector(\".adm-c10-teaser-floating-currentCard\");\r\n if (swiperc10.realIndex + 1 < 10) {\r\n paginationSwiperc10.innerHTML = `0${swiperc10.realIndex + 1}`;\r\n } else {\r\n paginationSwiperc10.innerHTML = swiperc10.realIndex + 1;\r\n }\r\n });\r\n\r\n function disableFloatingCardsArrows() {\r\n floatingCardsMobileSection.querySelector(\".adm-c10-teaser-floating-arrow-left\").tabIndex = -1;\r\n floatingCardsMobileSection.querySelector(\".adm-c10-teaser-floating-arrow-right\").tabIndex = -1;\r\n }\r\n\r\n swiperc10.on(\"keyPress\",\r\n (s) => {\r\n disableFloatingCardsArrows();\r\n Array.prototype.forEach.call(s.slides,\r\n (slide, slideIndex) => {\r\n slide.addEventListener(\"focusin\",\r\n () => {\r\n disableFloatingCardsArrows();\r\n s.slideTo(slideIndex, 1500);\r\n });\r\n });\r\n });\r\n});"],"names":["floatingCardsSections","document","querySelectorAll","floatingCardsSection","scrollableContainer","firstElementChild","leftButton","nextElementSibling","querySelector","rightButton","leftAligned","classList","contains","contentContainerLeftMargin","cardsContainerLeftMargin","contentContainerRightMargin","cardsContainerRightMargin","scrollerTotalWidth","scrollerLimitPosition","currentPosition","futurePosition","activateKeyboardNavigation","componentCTA","scrollScreen","position","childrenElement","children","style","transform","transition","opacity","window","addEventListener","displaySideButtons","removeEventListener","componentSection","figure","e","keyCode","setTimeout","updateC10Setting","focusedElementC10","activeElement","parentElement","rect","getBoundingClientRect","isOutsideScreenLeft","x","width","innerWidth","display","addRightScrolling","addLeftScrolling","contentContainer","cardsContainer","getComputedStyle","marginLeft","match","marginRight","offsetWidth","parseFloat","floatingCardsMobileSections","Array","prototype","forEach","call","floatingCardsMobileSection","index","add","swiperc10","modules","slidesPerView","spaceBetween","slidesPerGroup","centeredSlides","speed","a11y","prevSlideMessage","nextSlideMessage","keyboard","enabled","onlyInViewPort","navigation","nextEl","prevEl","disabledClass","disableFloatingCardsArrows","tabIndex","on","paginationSwiperc10","realIndex","innerHTML","s","slides","slide","slideIndex","slideTo"],"sourceRoot":""}