1/* ================================ 2 GSAP SETUP 3================================ */ 4let mm; 5let stepCleanup = null; 6 7function initGSAPCore() { 8 if (!window.gsap || !window.ScrollTrigger) return; 9 10 gsap.registerPlugin(ScrollTrigger); 11 12 if (window.MotionPathPlugin) { 13 gsap.registerPlugin(MotionPathPlugin); 14 } 15 16 if (!mm) { 17 mm = gsap.matchMedia(); 18 } 19} 20 21 22/* ================================ 23 STICKY HEADER 24================================ */ 25function initStickyHeader() { 26 var header = document.querySelector('.sticky--header'); 27 if (!header) return; 28 29 var scrollPosition = window.scrollY; 30 31 if (scrollPosition > 300) { 32 header.classList.add('sticky-active'); 33 } else { 34 header.classList.remove('sticky-active'); 35 } 36} 37 38 39/* ================================ 40 Mobile Menu Toggler 41================================ */ 42function initMobileToggler() { 43 const toggler = document.querySelector('.mobile_toggler'); 44 const navList = document.querySelector('.header__nav'); 45 46 if (!toggler || !navList) return; 47 48 toggler.addEventListener('click', () => { 49 const isActive = toggler.classList.toggle('active'); 50 navList.classList.toggle('show', isActive); 51 }); 52} 53 54 55/* ================================ 56 MOBILE MENU 57================================ */ 58function initMobileMenu() { 59 60 document.querySelectorAll('.header__item--dropdown > a, .submenu__item--dropdown > a').forEach(link => { 61 62 if (link.dataset.init) return; 63 link.dataset.init = "true"; 64 65 link.addEventListener('click', function (e) { 66 67 if (window.innerWidth > 1191) return; 68 69 e.preventDefault(); 70 71 const parent = link.parentElement; 72 const container = parent.parentElement; 73 74 container.querySelectorAll(':scope > li.open').forEach(item => { 75 if (item !== parent) item.classList.remove('open'); 76 }); 77 78 parent.classList.toggle('open'); 79 80 link.setAttribute( 81 'aria-expanded', 82 parent.classList.contains('open') 83 ); 84 85 }); 86 }); 87} 88 89 90/* ================================ 91 ACCORDION 92================================ */ 93function initAccordion() { 94 95 document.querySelectorAll('.ba26_providers_accordion').forEach(accordion => { 96 97 if (accordion.dataset.init === "true") { 98 accordion.querySelectorAll('.ba26_providers_accordion__item.active').forEach(item => { 99 const collapse = item.querySelector('.ba26_providers_accordian__collapse'); 100 collapse.style.maxHeight = collapse.scrollHeight + "px"; 101 }); 102 return; 103 } 104 105 accordion.dataset.init = "true"; 106 107 accordion.querySelectorAll('.ba26_providers_accordian__btn').forEach(btn => { 108 109 btn.addEventListener('click', function () { 110 111 const item = this.parentElement; 112 const collapse = item.querySelector('.ba26_providers_accordian__collapse'); 113 114 accordion.querySelectorAll('.ba26_providers_accordion__item').forEach(el => { 115 if (el !== item) { 116 el.classList.remove('active'); 117 el.querySelector('.ba26_providers_accordian__collapse').style.maxHeight = null; 118 } 119 }); 120 121 if (item.classList.contains('active')) { 122 item.classList.remove('active'); 123 collapse.style.maxHeight = null; 124 } else { 125 item.classList.add('active'); 126 collapse.style.maxHeight = collapse.scrollHeight + "px"; 127 } 128 129 }); 130 131 }); 132 133 }); 134} 135 136 137/* ================================ 138 STEPS ANIMATION 139================================ */ 140function initSteps() { 141 142 let stepCleanup = null; 143 144 const stepLogo = document.getElementById("stepLogo"); 145 const stepLogoPath = document.querySelector("#stepLogoPath"); 146 const journeySection = document.querySelector(".ba26_providers_journey"); 147 const rows = document.querySelectorAll(".ba26_providers_journey_step"); 148 149 if (!stepLogo || !stepLogoPath || !journeySection) return; 150 151 const thresholds = [0.10, 0.25, 0.45, 0.70, 0.85]; 152 153 ScrollTrigger.matchMedia({ 154 "(min-width: 991px)": function () { 155 156 const tl = gsap.to(stepLogo, { 157 scrollTrigger: { 158 trigger: journeySection, 159 start: "top 15%", 160 end: "bottom+=10% bottom", 161 scrub: true, 162 //markers: true, 163 invalidateOnRefresh: true, 164 165 onUpdate: (self) => { 166 167 const progress = self.progress; 168 169 rows.forEach((row, i) => { 170 row.classList.toggle("active", progress >= thresholds[i]); 171 }); 172 173 const rotation = gsap.getProperty(stepLogo, "rotation"); 174 175 gsap.set("#stepLogo img", { 176 rotation: -rotation 177 }); 178 } 179 }, 180 181 motionPath: { 182 path: stepLogoPath,
183 align: stepLogoPath, 184 alignOrigin: [0.5, 0.5], 185 autoRotate: true, 186 start: 0.10, 187 end: 0.90 188 }, 189 190 ease: "none" 191 }); 192 193 stepCleanup = () => { 194 tl.scrollTrigger?.kill(); 195 tl.kill(); 196 }; 197 }, 198 }); 199 return () => { 200 if (stepCleanup) stepCleanup(); 201 ScrollTrigger.getAll().forEach((st) => { 202 if ( 203 st.trigger && 204 st.trigger.classList && 205 st.trigger.classList.contains("ba26_providers_journey") 206 ) { 207 st.kill(); 208 } 209 }); 210 }; 211} 212 213 214/* ================================ 215 FOOTER TABS 216================================ */ 217function initFooterTab() { 218 const tabs = document.querySelectorAll(".ba26_footer_location_tab"); 219 const contents = document.querySelectorAll(".ba26_footer_location_content"); 220 221 if (!tabs) return; 222 223 tabs.forEach(tab => { 224 tab.addEventListener("click", () => { 225 226 tabs.forEach(t => t.classList.remove("ba26_footer_active")); 227 contents.forEach(c => c.classList.remove("ba26_footer_active")); 228 229 tab.classList.add("ba26_footer_active"); 230 document.getElementById(tab.dataset.tab).classList.add("ba26_footer_active"); 231 }); 232 }); 233} 234 235 236/* ================================ 237 DATA SPEED 238================================ */ 239function initDataSpeed() { 240 241 if (!mm) return; 242 243 mm.add("(min-width: 992px)", () => { 244 245 const triggers = []; 246 247 gsap.utils.toArray('[data-speed]').forEach((el) => { 248 249 const speed = parseFloat(el.dataset.speed); 250 251 const tween = gsap.to(el, { 252 y: () => -window.innerHeight * (speed - 1), 253 ease: "none", 254 scrollTrigger: { 255 trigger: el, 256 start: "top bottom", 257 end: "bottom top", 258 scrub: 1 259 } 260 }); 261 262 triggers.push(tween); 263 }); 264 265 return () => { 266 triggers.forEach(t => { 267 t.scrollTrigger?.kill(); 268 t.kill(); 269 }); 270 }; 271 }); 272} 273 274 275/* ================================ 276 About Leadership Swiper 277================================ */ 278function initAboutLeadershipSwiper() { 279 280 const aboutLeadershipSwiper = document.querySelector(".about_leadership_swiper"); 281 if (!aboutLeadershipSwiper) return; 282 283 var swiper = new Swiper(aboutLeadershipSwiper, { 284 slidesPerView: 2, 285 spaceBetween: 20, 286 navigation: { 287 nextEl: ".about_leadership-next", 288 prevEl: ".about_leadership-prev", 289 }, 290 breakpoints: { 291 320: { 292 slidesPerView: 1 293 }, 294 1024: { 295 slidesPerView: 2 296 }, 297 }, 298 }); 299} 300 301 302/* ================================ 303 Purpose Accordion 304================================ */ 305function initPurposeAccordion() { 306 307 const cards = document.querySelectorAll(".ba26_about_purpose-accordion-card"); 308 const image = document.getElementById("ba26_about_purpose-media"); 309 310 if (!cards.length || !image) return; 311 312 cards.forEach(card => { 313 card.addEventListener("click", () => { 314 315 cards.forEach(c => c.classList.remove("ba26_about_purpose-active")); 316 317 card.classList.add("ba26_about_purpose-active"); 318 319 const newImg = card.getAttribute("data-img"); 320 if (newImg) image.src = newImg; 321 322 }); 323 }); 324} 325 326 327/* ================================ 328 Counters 329================================ */ 330function initCounters() { 331 332 const counters = document.querySelectorAll(".counter"); 333 if (!counters.length || !window.gsap) return; 334 335 counters.forEach(counter => { 336 337 const countValue = counter.dataset.count; 338 const suffix = counter.dataset.suffix || ""; 339 const prefix = counter.dataset.prefix || ""; 340 341 const cleanValue = countValue.replace(/,/g, ""); 342 343 // Range Counter (17-27) 344 if (cleanValue.includes("-")) { 345 346 const [end1, end2] = cleanValue.split("-").map(Number); 347 348 let obj = { 349 val1: 0, 350 val2: 0 351 }; 352 353 gsap.to(obj, { 354 val1: end1, 355 val2: end2, 356 duration: 2, 357 ease: "power1.out", 358 scrollTrigger: { 359 trigger: counter, 360 start: "top 110%", 361 toggleActions: "play none none none" 362 }, 363 onUpdate: () => { 364 counter.innerHTML = ` 365 ${prefix}${Math.floor(obj.val1).toLocaleString()}-${Math.floor(obj.val2).toLocaleString()} 366 <span class="counter-suffix">${suffix}</span> 367 `; 368 } 369 }); 370 371 return; 372 } 373 374 const endValue = parseFloat(cleanValue); 375 376 let obj = { 377 val: 0 378 }; 379 380 gsap.to(obj, { 381 val: endValue, 382 duration: 2, 383 ease: "power1.out", 384 scrollTrigger: { 385 trigger: counter, 386 start: "top 110%", 387 toggleActions: "play none none none" 388 },
389 onUpdate: () => { 390 391 let value; 392 393 if (endValue % 1 !== 0) { 394 value = Number(obj.val.toFixed(1)).toLocaleString(); 395 } else { 396 value = Math.floor(obj.val).toLocaleString(); 397 } 398 399 counter.innerHTML = ` 400 ${prefix}${value} 401 <span class="counter-suffix">${suffix}</span> 402 `; 403 } 404 }); 405 }); 406} 407 408 409/* ================================ 410 Assignment Swiper 411================================ */ 412function initAssignmentSwiper() { 413 414 const assignmentSwiper = document.querySelector(".ba26_home_assignment__swiper"); 415 if (!assignmentSwiper) return; 416 417 var swiper = new Swiper(assignmentSwiper, { 418 slidesPerView: 'auto', 419 spaceBetween: 0, 420 navigation: { 421 nextEl: ".ba26_home_assignment-next", 422 prevEl: ".ba26_home_assignment-prev", 423 } 424 }); 425} 426 427 428/* ================================ 429 Smooth Anchor Scroll 430 ================================ */ 431function initSmoothAnchorScroll() { 432 document.querySelectorAll('a[href^="#"]:not([href="#"])').forEach(anchor => { 433 anchor.addEventListener('click', function (e) { 434 e.preventDefault(); 435 const target = document.querySelector( 436 this.getAttribute('href') 437 ); 438 if (target) { 439 target.scrollIntoView({ 440 behavior: 'smooth', 441 block: 'start' 442 }); 443 } 444 }); 445 }); 446} 447 448 449/* ================================ 450 Blog Reaction 451================================ */ 452function initBlogReaction() { 453 454 const buttons = document.querySelectorAll('.ba26_blog_reaction_emoji_btn'); 455 if (!buttons.length) return; 456 buttons.forEach((button) => { 457 button.addEventListener('click', function () { 458 buttons.forEach((btn) => { 459 btn.classList.remove('active'); 460 }); 461 462 this.classList.add('active'); 463 }); 464 }); 465} 466 467 468/* ================================ 469 STICKY HEADER 470================================ */ 471function initBlogSearchBnrSticky() { 472 const blogSearchBnrSticky = document.querySelector('.ba26_blog_search_bnr--sticky'); 473 474 if (!blogSearchBnrSticky) return; 475 476 let lastScroll = window.scrollY; 477 478 function handleScroll() { 479 480 const currentScroll = window.scrollY; 481 482 if (currentScroll > 500) { 483 if (currentScroll < lastScroll) { 484 blogSearchBnrSticky.classList.add('sticky-active'); 485 } 486 else { 487 blogSearchBnrSticky.classList.remove('sticky-active'); 488 } 489 490 } else { 491 blogSearchBnrSticky.classList.remove('sticky-active'); 492 } 493 494 lastScroll = currentScroll; 495 496 } 497 498 window.addEventListener('scroll', handleScroll); 499} 500 501 502/* ================================ 503 Blog Filter Swiper 504================================ */ 505function initBlogSwiper() { 506 507 const ba26BlogSwiper = document.querySelector(".ba26_blog_swiper"); 508 if (!ba26BlogSwiper) return; 509 510 var swiper = new Swiper(ba26BlogSwiper, { 511 slidesPerView: 1, 512 spaceBetween: 12, 513 navigation: { 514 nextEl: ".ba26_blog_swiper-next", 515 prevEl: ".ba26_blog_swiper-prev", 516 }, 517 pagination: { 518 el: ".ba26_blog_swiper-pagination", 519 }, 520 breakpoints: { 521 320: { 522 slidesPerView: "auto", 523 }, 524 591: { 525 slidesPerView: 1.5 526 }, 527 767: { 528 slidesPerView: 2 529 }, 530 991: { 531 slidesPerView: 2.5 532 }, 533 1191: { 534 slidesPerView: 3, 535 spaceBetween: 20, 536 } 537 }, 538 }); 539} 540 541 542/* ================================ 543 BA26ACCORDION 544================================ */ 545function initBa26Accordion() { 546 547 document.querySelectorAll('.ba26_accordion').forEach(accordion => { 548 549 if (accordion.dataset.init === "true") { 550 accordion.querySelectorAll('.ba26_accordion__item.active').forEach(item => { 551 const collapse = item.querySelector('.ba26_accordion__collapse'); 552 553 if (collapse) { 554 collapse.style.maxHeight = collapse.scrollHeight + "px"; 555 } 556 }); 557 return; 558 } 559 560 accordion.dataset.init = "true"; 561 562 accordion.querySelectorAll('.ba26_accordion__btn').forEach(btn => { 563 564 btn.addEventListener('click', function () { 565 566 const item = this.parentElement; 567 if (!item) return; 568 569 const collapse = item.querySelector('.ba26_accordion__collapse'); 570 571 accordion.querySelectorAll('.ba26_accordion__item').forEach(el => { 572 if (el !== item) { 573 el.classList.remove('active'); 574 575 const otherCollapse = el.querySelector('.ba26_accordion__collapse'); 576 577 if (otherCollapse) { 578 otherCollapse.style.maxHeight = null; 579 } 580 581 } 582 }); 583 584 if (!collapse) return; 585 586 if (item.classList.contains('active')) { 587 item.classList.remove('active'); 588 collapse.style.maxHeight = null; 589 } else { 590 item.classList.add('active'); 591 collapse.style.maxHeight = collapse.scrollHeight + "px"; 592 } 593 594 }); 595 596 }); 597 598 }); 599} 600 601 602/* ================================ 603 BA26TABS 604================================ */ 605function initBa26Tab() { 606 const tabs = document.querySelectorAll(".ba26_tab_link"); 607 const contents = document.querySelectorAll(".ba26_tab_content"); 608 609 if (!tabs.length) return; 610
611 tabs.forEach(tab => { 612 if (tab.dataset.init === "true") return; 613 tab.dataset.init = "true"; 614 615 tab.addEventListener("click", () => { 616 const targetId = tab.dataset.tab; 617 if (!targetId) return; 618 619 const targetContent = document.getElementById(targetId); 620 if (!targetContent) return; 621 622 tabs.forEach(t => t.classList.remove("ba26_tab_active")); 623 contents.forEach(c => c.classList.remove("ba26_tab_active")); 624 625 tab.classList.add("ba26_tab_active"); 626 targetContent.classList.add("ba26_tab_active"); 627 }); 628 }); 629} 630 631/* ================================ 632 ba26_cv_interview_tips_hero_icon_bx 633================================ */ 634function initBa26CVInterviewTipsHeroIconBX() { 635 636 // Box Fade In 637 gsap.from(".ba26_cv_interview_tips_hero_icon_bx", { 638 opacity: 0, 639 scale: 0.5, 640 duration: 0.8, 641 ease: "power2.out", 642 stagger: 0.15 643 }); 644 645 document.querySelectorAll('.ba26_cv_interview_tips_hero_icon_bx').forEach((box) => { 646 647 gsap.to(box, { 648 x: gsap.utils.random(-20, 20), 649 y: gsap.utils.random(-20, 20), 650 duration: gsap.utils.random(2, 5), 651 ease: "sine.inOut", 652 repeat: -1, 653 yoyo: true, 654 delay: gsap.utils.random(0, 2) 655 }); 656 657 }); 658 659 // SVG Draw Animation 660 document.querySelectorAll('.ba26_cv_interview_tips_hero_icon_bx .animated-icon').forEach((icon) => { 661 662 const paths = icon.querySelectorAll('path[stroke]'); 663 664 paths.forEach((path) => { 665 const length = path.getTotalLength(); 666 667 gsap.set(path, { 668 strokeDasharray: length, 669 strokeDashoffset: length + 1 670 }); 671 }); 672 673 // Start hidden 674 gsap.set(icon, { 675 opacity: 0 676 }); 677 678 // First time animation 679 const introTl = gsap.timeline({ 680 delay: 1 681 }); 682 683 introTl 684 .set(icon, { 685 opacity: 1 686 }) 687 .to(paths, { 688 strokeDashoffset: 0, 689 duration: 1.5, 690 ease: "power2.out", 691 stagger: 0.08 692 }); 693 694 // Hover Animation 695 icon.addEventListener("mouseenter", () => { 696 697 gsap.timeline() 698 .to(paths, { 699 strokeDashoffset: (i, el) => el.getTotalLength() + 1, 700 duration: 0.8, 701 ease: "power2.in", 702 stagger: 0.05 703 }) 704 .to(paths, { 705 strokeDashoffset: 0, 706 duration: 1, 707 ease: "power2.out", 708 stagger: 0.08 709 }); 710 711 }); 712 713 }); 714} 715 716 717/* ================================ 718 initBa26WebinarTimeZone 719================================ */ 720function initBa26WebinarTimeZone() { 721 722 const countdown = document.querySelector(".ba26_webinar_timezone"); 723 if (!countdown) return; 724 725 const targetDate = countdown.dataset.dateTime; 726 if (!targetDate) return; 727 728 const targetTime = new Date(targetDate).getTime(); 729 730 const second = 1000, 731 minute = second * 60, 732 hour = minute * 60, 733 day = hour * 24; 734 735 const daysEl = document.getElementById("days"); 736 const hoursEl = document.getElementById("hours"); 737 const minutesEl = document.getElementById("minutes"); 738 const secondsEl = document.getElementById("seconds"); 739 740 if (!daysEl || !hoursEl || !minutesEl || !secondsEl) return; 741 742 function updateCountdown() { 743 const now = Date.now(); 744 const distance = targetTime - now; 745 746 if (distance <= 0) { 747 clearInterval(timer); 748 749 daysEl.textContent = "00"; 750 hoursEl.textContent = "00"; 751 minutesEl.textContent = "00"; 752 secondsEl.textContent = "00"; 753 return; 754 } 755 756 daysEl.textContent = String(Math.floor(distance / day)).padStart(2, "0"); 757 hoursEl.textContent = String(Math.floor((distance % day) / hour)).padStart(2, "0"); 758 minutesEl.textContent = String(Math.floor((distance % hour) / minute)).padStart(2, "0"); 759 secondsEl.textContent = String(Math.floor((distance % minute) / second)).padStart(2, "0"); 760 } 761 762 updateCountdown(); 763 764 const timer = setInterval(updateCountdown, 1000); 765} 766 767 768/* ================================ 769 initBa26CredentialingVerificationBadge 770================================ */ 771function initBa26CredentialingVerificationBadge() { 772 773 if (!mm) return; 774 775 mm.add("(min-width: 592px)", () => { 776 777 const tweens = []; 778 779 document.querySelectorAll(".ba26_credentialing_verification_badge").forEach((box, i) => { 780 781 const tween = gsap.to(box, { 782 x: i % 2 === 0 ? 10 : -10, 783 duration: 2.5, 784 ease: "sine.inOut", 785 repeat: -1, 786 yoyo: true, 787 delay: i * 0.08 788 }); 789 790 tweens.push(tween); 791 792 }); 793 794 return () => { 795 tweens.forEach(tween => tween.kill()); 796 gsap.set(".ba26_credentialing_verification_badge", { 797 clearProps: "all" 798 }); 799 }; 800 801 }); 802 803} 804 805function ba26Dropdown() { 806 807 const dropdowns = document.querySelectorAll(".ba26_dropdown"); 808 809 if (!dropdowns.length) return; 810 811 dropdowns.forEach(dropdown => { 812 813 const btn = dropdown.querySelector(".ba26_dropdown_btn"); 814 const menu = dropdown.querySelector(".ba26_dropdown_menu"); 815 816 if (!btn || !menu) return; 817 818 btn.addEventListener("click", function (e) { 819 e.stopPropagation(); 820 const isOpen = dropdown.classList.contains("show"); 821 822 dropdowns.forEach(item => { 823 item.classList.remove("show"); 824 }); 825 826 if (isOpen) return; 827 828 dropdown.classList.add("show"); 829 830 // Reset position 831 menu.style.left = "0"; 832 menu.style.right = "auto"; 833 menu.style.top = "100%"; 834 menu.style.bottom = "auto"; 835 836 requestAnimationFrame(() => { 837 const gap = 10; 838 839 let rect = menu.getBoundingClientRect(); 840 if (rect.right > window.innerWidth - gap) { 841 menu.style.left = "auto"; 842 menu.style.right = "0"; 843 } 844 845 846 rect = menu.getBoundingClientRect(); 847 if (rect.left < gap) { 848 menu.style.left = `${gap - rect.left}px`; 849 menu.style.right = "auto"; 850 } 851 852 rect = menu.getBoundingClientRect(); 853 if (rect.right > window.innerWidth - gap) { 854 menu.style.left = `${parseFloat(menu.style.left || 0) - (rect.right - (window.innerWidth - gap))}px`; 855 } 856 857 rect = menu.getBoundingClientRect(); 858 if (rect.bottom > window.innerHeight - gap) { 859 menu.style.top = "auto"; 860 menu.style.bottom = "100%"; 861 } 862 863 rect = menu.getBoundingClientRect(); 864 if (rect.top < gap) { 865 menu.style.top = "100%"; 866 menu.style.bottom = "auto"; 867 } 868 869 }); 870 871 }); 872 873 menu.addEventListener("click", function (e) { 874 e.stopPropagation(); 875 }); 876 877 }); 878 879 document.addEventListener("click", function () { 880 dropdowns.forEach(dropdown => { 881 dropdown.classList.remove("show"); 882 }); 883 }); 884 885 window.addEventListener("resize", function () { 886 dropdowns.forEach(dropdown => { 887 dropdown.classList.remove("show"); 888 889 const menu = dropdown.querySelector(".ba26_dropdown_menu"); 890 891 if (!menu) return; 892 893 menu.style.left = ""; 894 menu.style.right = ""; 895 menu.style.top = ""; 896 menu.style.bottom = ""; 897 }); 898 }); 899 900} 901 902function ba26JobModal() { 903 904 const modal = document.querySelector(".ba26_job_modal"); 905 if (!modal) return; 906 907 document.querySelectorAll(".ba26_job_card").forEach(card => { 908 909 card.addEventListener("click", () => { 910 911 if (window.innerWidth > 991) return; 912 913 document.querySelector(".ba26_job_card.active")?.classList.remove("active"); 914 915 card.classList.add("active"); 916 modal.classList.add("show"); 917 document.body.style.overflow = "hidden"; 918 919 }); 920 921 }); 922 923 modal.querySelector(".ba26_job_modal_close")?.addEventListener("click", () => { 924 925 modal.classList.remove("show"); 926 document.body.style.overflow = ""; 927 928 }); 929 930} 931 932function initMapSvgAnimation() { 933 const svg = document.getElementById("mapSvg"); 934 935 if (!svg) return; 936 svg.pauseAnimations(); 937 938 ScrollTrigger.create({ 939 trigger: svg, 940 start: "top 70%", 941 once: true, 942 onEnter: () => { 943 svg.setCurrentTime(0); 944 svg.unpauseAnimations(); 945 } 946 }); 947} 948 949function initStaffingTestimonialSwiper() { 950 951 const ba26TestimonialSwiper = document.querySelector(".ba26_staffing_testimonial_swiper"); 952 if (!ba26TestimonialSwiper) return; 953 954 var swiper = new Swiper(ba26TestimonialSwiper, { 955 slidesPerView: 1, 956 spaceBetween: 12, 957 navigation: { 958 nextEl: ".ba26_staffing_testimonial_swiper_next", 959 prevEl: ".ba26_staffing_testimonial_swiper_prev", 960 }, 961 pagination: { 962 el: ".ba26_staffing_testimonial_swiper_pagination", 963 } 964 }); 965} 966 967function initStaffingTabsWrapper() { 968 const mobileDropdown = document.querySelector('.ba26_staffing_tabs_wrapper'); 969 970 if (mobileDropdown) { 971 972 const selectedButton = mobileDropdown.querySelector('.ba26_staffing_mobile_selected'); 973 const selectedText = selectedButton.querySelector('span'); 974 975 selectedButton.addEventListener('click', function () { 976 mobileDropdown.classList.toggle('ba26_dropdown_open'); 977 }); 978 979 mobileDropdown.querySelectorAll('.ba26_staffing_tab_link').forEach(function (tab) { 980 tab.addEventListener('click', function () { 981 selectedText.textContent = tab.textContent; 982 mobileDropdown.classList.remove('ba26_dropdown_open'); 983 984 const targetId = tab.getAttribute('data-tab'); 985 const target = document.getElementById(targetId); 986 987 if (!target) return; 988 989 setTimeout(() => { 990 const top = target.getBoundingClientRect().top + window.scrollY - 100; 991 992 window.scrollTo({ 993 top: top, 994 behavior: 'smooth' 995 }); 996 }, 50); 997 }); 998 }); 999 } 1000} 1001 1002function initStaffingStickyCard() { 1003 1004 const section = document.querySelector(".ba26_staffing_coverage"); 1005 const heading = document.querySelector(".ba26_section_heading__sticky"); 1006 1007 if (!section || !heading) return; 1008 1009 ScrollTrigger.getById("sticky-heading")?.kill(); 1010 1011 if (window.innerWidth < 768) return; 1012 1013 let endValue = "bottom 700px"; 1014 1015 if (window.innerWidth < 991) { 1016 endValue = "bottom 550px"; 1017 } else if (window.innerWidth < 1192) { 1018 endValue = "bottom 450px"; 1019 } 1020 1021 ScrollTrigger.create({ 1022 trigger: section, 1023 start: "top top", 1024 end: endValue, 1025 pin: heading, 1026 pinSpacing: false, 1027 markers: false, 1028 id: "sticky-heading" 1029 }); 1030 1031 ScrollTrigger.refresh(); 1032} 1033 1034function initStaffingNetworkAnimation() { 1035 const networks = gsap.utils.toArray(".ba26_staffing_network"); 1036 1037 if (!networks.length) return; 1038 1039 networks.forEach((network) => { 1040 ScrollTrigger.create({ 1041 trigger: network, 1042 start: "top 80%", 1043 onEnter: () => { 1044 network.classList.add("active"); 1045 } 1046 }); 1047 }); 1048} 1049 1050 1051/* ================================ 1052 INIT ALL 1053================================ */ 1054function initApp() { 1055 initGSAPCore(); 1056 initAccordion(); 1057 initSteps(); 1058 initMobileToggler(); 1059 initMobileMenu(); 1060 initFooterTab(); 1061 initDataSpeed(); 1062 initAboutLeadershipSwiper(); 1063 initPurposeAccordion(); 1064 initCounters(); 1065 initAssignmentSwiper(); 1066 initSmoothAnchorScroll(); 1067 initBlogReaction(); 1068 initBlogSearchBnrSticky(); 1069 initBlogSwiper(); 1070 initBa26Accordion(); 1071 initBa26Tab(); 1072 initBa26CVInterviewTipsHeroIconBX(); 1073 initBa26WebinarTimeZone(); 1074 //initBa26CredentialingVerificationBadge(); 1075 ba26Dropdown(); 1076 ba26JobModal(); 1077 initMapSvgAnimation(); 1078 initStaffingTestimonialSwiper(); 1079 initStaffingTabsWrapper(); 1080 initStaffingStickyCard(); 1081 initStaffingNetworkAnimation(); 1082} 1083document.addEventListener('DOMContentLoaded', () => { 1084 try { 1085 initApp(); 1086 } catch (e) { 1087 console.error('Init Error:', e); 1088 } 1089}); 1090 1091 1092/* ================================ 1093 LOAD + REFRESH 1094================================ */ 1095window.addEventListener("load", () => { 1096 if (window.ScrollTrigger) { 1097 ScrollTrigger.refresh(); 1098 } 1099}); 1100 1101 1102window.addEventListener('scroll', () => { 1103 initStickyHeader(); 1104}, 100); 1105 1106 1107/* ================================ 1108 RESIZE HANDLER 1109================================ */ 1110let resizeTimeout; 1111window.addEventListener("resize", () => { 1112 initBa26Accordion(); 1113 initStaffingStickyCard(); 1114 1115 clearTimeout(resizeTimeout); 1116 resizeTimeout = setTimeout(() => { 1117 if (window.ScrollTrigger) { 1118 ScrollTrigger.refresh(true); 1119 } 1120 }, 250); 1121});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.