let motionOff; function updateAllLotties() { motionOff = $("body").hasClass("userway-s13_offtransition"); // Get Webflow Lottie module let o = Webflow.require("lottie").lottie; // Loop through all Lottie animations motionOff && (o.pause(), Webflow.require("ix2").destroy()); } // Run once on load updateAllLotties(); // Watch for class changes triggered by UserWay toggle const targetClass = "userway-s13_offtransition"; let hadClass = document.body.classList.contains(targetClass); const observer = new MutationObserver(() => { const o = document.body.classList.contains(targetClass); o !== hadClass && ((hadClass = o), updateAllLotties(), console.log(o ? "Motion OFF" : "Motion ON"), o || location.reload()); }); function expandAccordion(o) { o.each(function () { var t = o.siblings(".dropdown-list").length > 0 ? o.siblings(".dropdown-list") : o.find(".dropdown-list"), a = o.find(".accordion-expand-icon"); gsap.to( o, { borderRadius: o.hasClass("faq-dropdown-toggle") ? 0 : "20px 20px 0px 0px", duration: 0.3, }, "<" ), a.length > 0 && gsap.to(a, { rotate: 45, duration: 0.3 }, "<"), gsap.to(t, { height: "auto", duration: 0.3, ease: "power1.out" }, "<"), o.addClass("active"), t.addClass("active"), o.closest(".dropdown").addClass("active"); }), setTimeout(() => { ScrollTrigger.refresh(); }, 400); } function collapseAccordion(o) { o.each(function () { var o = $(this), t = o.siblings(".dropdown-list") ? o.siblings(".dropdown-list") : o.find(".dropdown-list"), a = o.find(".accordion-expand-icon"); gsap.to(t, { height: 0, duration: 0.3, ease: "power1.out" }), a.length > 0 && gsap.to(a, { rotate: 0, duration: 0.3 }, "<"), gsap.to( o, { borderRadius: o.hasClass("faq-dropdown-toggle") ? 0 : "20px", duration: 0.3, }, "<+50%" ), o.removeClass("active"), t.removeClass("active"), o.closest(".dropdown").removeClass("active"); }), setTimeout(() => ScrollTrigger.refresh(), 400); } observer.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), $(".dropdown-toggle").on("click", function () { var o = $(this); o.hasClass("active") ? collapseAccordion(o) : (collapseAccordion($(".dropdown-toggle")), expandAccordion(o)); }), $(document).ready(function () { /** * strategic pillar section */ let o, t, a, e; /** * Back to top */ $(".back-to-top").click(function () { $("html, body").animate({ scrollTop: 0 }); }), $("#hero-scroll-learn-more, #skip-to-content").click(function () { gsap.to(window, { scrollTo: { y: "#long-term-vision", offsetY: 130 } }); }), /** * Scroll trigger */ //gsap.registerPlugin(ScrollTrigger); ScrollTrigger.defaults({ toggleActions: "restart pause resume none", scrub: 1, anticipatePin: 1, }); const i = $(".strategic-pillar-container"); function initSwipablePillar() { expandAccordion($(".pillar-toggle")), i.addClass("swiper"), (e = new Swiper(".strategic-pillar-container.swiper", { slidesPerView: 1, spaceBetween: 32, autoHeight: !1, breakpoints: { 992: { slidesPerView: 5, allowTouchMove: !1, spaceBetween: 0 }, }, navigation: { prevEl: ".pillar-navigation-arrow.left", nextEl: ".pillar-navigation-arrow.right", }, })); } function resetAccordions() { collapseAccordion($(".dropdown-toggle")), // Collapse all items first $(".strategic-pillar-item.expanded").removeClass("expanded"), // Reset grid if collapsing $(".strategic-pillar-grid").css( "grid-template-columns", "repeat(5, 1fr)" ), gsap.to( ".pillar-dropdown-list", { height: 0, duration: 0.3, ease: "power1.out" }, "<" ), setTimeout(function () { $(".pillar-tooltip").fadeIn(); }, 100), $(".pillar-expand-arrow").css("transform", "rotate(0deg)"); } /** * Fixed side navigation bar */ function closePopup() { gsap.to(".regional-focus-item", { autoAlpha: 0, scale: 0.8, ease: "power1.in", duration: 0.2, }), gsap.to(".regional-focus-popups", { autoAlpha: 0, duration: 0.3 }, "<"), gsap.to( "body", { backgroundColor: "rgba(0, 0, 0, 0)", duration: 0.3 }, "<" ), gsap.to( ".regional-focus-item, .regional-focus-popups", { display: "none", duration: 0 }, ">" ), $("html").removeClass("w-lightbox-noscroll"), $(".region-outline").blur(); } /** * Scrolll to top button */ (a = $(window).innerWidth() < 992), !(function isMobile() { const o = "ontouchstart" in window || navigator.maxTouchPoints > 0, t = $(window).innerWidth() < 992; return o && t; })() ? $(window).on("load resize", function () { (t = $(window).innerWidth() < 992), t ? initSwipablePillar() : (function destroySwipablePillar() { resetAccordions(), setTimeout(function () { expandAccordion( $(".dropdown-toggle.aspirations").eq(0) ); }, 400), e && e.destroy(!1, !0); })(); }) : $(window).on("load", function () { initSwipablePillar(); }), $(document).on("click", ".pillar-toggle", function () { if (!t) { const t = $(this), a = t.closest(".strategic-pillar-item"), e = t.find(".pillar-dropdown-list"), i = $(".strategic-pillar-grid"); // Capture current state before changes o = Flip.getState( ".strategic-pillar-item, .strategic-pillar-grid, .strategic-pillar-container" ); const r = a.hasClass("expanded"); $(".pillar-expand-arrow").css("transform", "rotate(0deg)"), gsap.to(".pillar-dropdown-list", { height: 0, duration: 0.3 }), $(".strategic-pillar-item").removeClass("expanded"), r ? // Reset grid if collapsing (i.css("grid-template-columns", "repeat(5, 1fr)"), gsap.to(e, { height: 0, duration: 0.3 }, ">"), $(".pillar-tooltip").fadeIn(), a.find(".pillar-expand-arrow").css("transform", "rotate(0deg)")) : ($(".pillar-tooltip").fadeOut(), // Expand clicked item // Change grid to 6 columns when an item is flipped i.css("grid-template-columns", "repeat(6, 1fr)"), a.addClass("expanded"), a .find(".pillar-expand-arrow") .css("transform", "rotate(180deg)"), gsap.to(e, { height: "auto", duration: 0.3 }, ">")), // Animate the layout changes Flip.from(o, { duration: 0.3, ease: "power1.inOut", //scale: true, onComplete: () => ScrollTrigger.refresh(), }), setTimeout(() => ScrollTrigger.refresh(), 400); } }), $(".pagescroll-indicator-up").click(() => { const o = $(".pagescroll-indicator.w--current"); o.prev(".pagescroll-indicator")?.click(); }), $(".pagescroll-indicator-down").click(() => { const o = $(".pagescroll-indicator.w--current"); o.next(".pagescroll-indicator")?.click(); }), ScrollTrigger.create({ trigger: ".wa-regional-map", start: "top bottom", end: "top 50%", onEnter: () => { motionOff || gsap.from(".wa-regional-map", { xPercent: 100, transform: "rotate(45deg)", duration: 0.6, ease: "back.out", }); }, }), /** * Regional Map * On click of regions, open popup */ $(".region-text-label.region-outline").hover( function () { var o = $(this).data("name"); $('a.region-outline[data-name="' + o + '"]').css("fill", "#00874d"); }, function () { var o = $(this).data("name"); $('a.region-outline[data-name="' + o + '"]').css("fill", "#54b057"); } ), $(document).on("click", ".region-outline", function () { var o = $(this).data("name"), t = '.regional-focus-item[data-region="' + o + '"]'; gsap.to( t + ", .regional-focus-popups", { display: "flex", duration: 0 }, "<" ), gsap.to(".regional-focus-popups", { autoAlpha: 1, duration: 0.3 }), gsap.to( "body", { backgroundColor: "rgba(0, 0, 0, 0.18)", duration: 0.3 }, "<" ), gsap.fromTo( t, { autoAlpha: 0, scale: 0.8 }, { autoAlpha: 1, scale: 1, duration: 0.2, ease: "power1.out" }, "<" ), $("html").addClass("w-lightbox-noscroll"); var a = $('a.region-outline[data-name="' + o + '"]'); a.parent().append(a), a.focus(); }), $(".close-popup").click(function () { closePopup(); }), gsap.to(".back-to-top", { autoAlpha: 0, duration: 0.3 }); let r = window.innerHeight; ScrollTrigger.create({ trigger: "body", start: r + " top", onEnter: () => { gsap.to(".back-to-top", { autoAlpha: 1, duration: 0.3 }); }, onLeaveBack: () => { gsap.to(".back-to-top", { autoAlpha: 0, duration: 0.3 }); }, }), /** * Escape key */ $(document).on("keydown", function (o) { "Escape" === o.key && (resetAccordions(), closePopup()); }); }), /** * Shy header */ (function () { var o = $(".mobile-collapsible-header-wrapper"); if (o.length) { var t = 0, a = !1; window.addEventListener( "scroll", function () { a || (window.requestAnimationFrame(updateHeader), (a = !0)); }, { passive: !0 } ); } function updateHeader() { var e = window.scrollY; Math.abs(e - t) > 5 && (e > t && e > 300 ? (o.addClass("is-hidden"), $(".w-nav-button").hasClass("w--open") && $(".w-nav-button").click()) : o.removeClass("is-hidden"), (t = e)), (a = !1); } })(); //# sourceMappingURL=mhaod-script.js.map