1document.addEventListener('DOMContentLoaded', function () { 2 // Create the button element 3 const navButton = document.createElement('button'); 4 navButton.id = 'mobile-nav-button'; 5 6 navButton.setAttribute('aria-label', 'Close navigation menu'); 7 8 // Create the span elements and add them to the button 9 const spanOne = document.createElement('span'); 10 spanOne.classList.add('toggle', 'one'); 11 12 const spanTwo = document.createElement('span'); 13 spanTwo.classList.add('toggle', 'two'); 14 15 const spanThree = document.createElement('span'); 16 spanThree.classList.add('toggle', 'three'); 17 18 navButton.appendChild(spanOne); 19 navButton.appendChild(spanTwo); 20 navButton.appendChild(spanThree); 21 22 // Wrap the button inside an li 23 const navLi = document.createElement('li'); 24 navLi.classList.add('menu-item', 'menu-item-button'); // optional classes 25 navLi.appendChild(navButton); 26 27 // Insert the button inside #menu-header 28 const menuHeader = document.querySelector('#menu-header'); 29 menuHeader.appendChild(navLi); 30}); 31 32jQuery(document).ready(function(){ 33 var $mobileNavButton = jQuery('#mobile-nav-button'); 34 var $mainNav = jQuery('.main-nav'); 35 var $mobileOverlay = jQuery('.mobilemenu-overlay'); 36 var $bodyClass = jQuery('body'); 37 38 $mobileNavButton.click(function(){ 39 $mainNav.toggleClass('open'); 40 $mobileOverlay.toggleClass('open'); 41 $bodyClass.toggleClass('overlay-menu-active'); 42 jQuery(this).hide(); 43 }); 44 45 jQuery('.menu-item-has-children > a').each(function(){ 46 jQuery(this).after('<span class="menu_arrow"></span>'); 47 }); 48 jQuery('.main-nav.open #menu-header').each(function(){ 49 jQuery(this).before('<span class="menu_arrow"></span>'); 50 }); 51 52 jQuery('.main-nav .menu-item-has-children .menu_arrow').click(function(e){ 53 e.preventDefault(); 54 var $parentLi = jQuery(this).parent(); 55 $parentLi.siblings('.menu-item-has-children').removeClass('open'); 56 $parentLi.toggleClass('open'); 57 e.stopPropagation(); 58 }); 59 60 61 jQuery('#menu-header #mobile-nav-button').on('click', function () { 62 jQuery('.main-nav').removeClass('open'); 63 jQuery('.mobilemenu-overlay').removeClass('open'); 64 jQuery('#mobile-nav-button').show(); 65 jQuery('.menu-item').removeClass('open'); 66 }); 67 68 const $links = jQuery('.portal-login-list .portal-link'); 69// const $displayText = jQuery('.selected-portal .selected-text'); 70 const $dropdown = jQuery('.portal-login-list'); 71 const $arrow = jQuery('.selected-portal .dropdown-arrow'); 72 73 // ð¹ Show first item on page load 74 const firstText = $links.first().text(); 75// $displayText.text(firstText); 76 77 // ð¹ Toggle dropdown on arrow click 78 jQuery('.selected-portal').on('click', function() { 79 $dropdown.slideToggle(200); 80 $arrow.toggleClass('open'); 81 }); 82 83 // ð¹ Handle click on link 84 $links.on('click', function(e) { 85 e.preventDefault(); 86 87 const clickedText = jQuery(this).text(); 88 const linkUrl = jQuery(this).attr('href'); 89// $displayText.text(clickedText); 90 $dropdown.slideUp(200); 91 92// $displayText.text(clickedText); // Update selected text 93 $dropdown.slideUp(200); // Close dropdown 94 $arrow.removeClass('open'); // Reset arrow direction 95 96 setTimeout(() => { 97 window.open(linkUrl, '_blank'); // Open in new window/tab 98 }, 000); 99 100 101 }); 102 jQuery(document).on('click', function (e) { 103 const $target = jQuery(e.target);
104 const isInside = $target.closest('.selected-portal').length > 0; 105 106 if (!isInside) { 107 $dropdown.slideUp(200); 108 $arrow.removeClass('open'); 109 } 110 }); 111 112 113 114 115 /*Hero Banner Module Main Slider*/ 116 117 jQuery(".hero-banner-sec .hero-slider-rep").slick({ 118 slidesToShow: 1, 119 slidesToScroll: 1, 120 arrows: false, 121 dots: false, 122 speed: 2000, 123 infinite: true, 124 autoplaySpeed: 3500, 125 autoplay: true, 126 accessibility: false, 127 128 }); 129 130 /*Hero Banner Module Bottom Slider*/ 131 /*jQuery(".hero-banner-sec .hero-bottom-slider").slick({ 132 slidesToShow: 4, 133 slidesToScroll: 1, 134 arrows: false, 135 dots: false, 136 speed: 2500, 137 cssEase: 'linear', 138 infinite: true, 139 autoplay: true, 140 autoplaySpeed: 0, 141 responsive: [ 142 { breakpoint: 480, settings: { slidesToShow: 2 } } 143 ] 144 });*/ 145 146 /*Hero Banner Module Bottom Slider*/ 147 const $slider = jQuery(".hero-banner-sec .hero-bottom-slider"); 148 if ($slider.length > 0) { 149 150 $slider.slick({ 151 slidesToShow: 4, 152 slidesToScroll: 1, 153 arrows: false, 154 dots: false, 155 speed: 2500, 156 cssEase: 'linear', 157 infinite: true, 158 autoplay: true, 159 autoplaySpeed: 0, 160 accessibility: false, 161 responsive: [ 162 { breakpoint: 991, settings: { slidesToShow: 2 } }, 163 { breakpoint: 767, settings: { slidesToShow: 2 } } 164 ] 165 }); 166 } 167 168}); 169 170jQuery(document).ready(function ($) { 171 let lastScrollTop = 0; 172 const $header = jQuery('.header-outer'); 173 if (jQuery('body').hasClass('home')) { 174 175 $header.css('position', 'fixed'); 176 $header.css('width', '100%'); 177 } 178 // Scroll behavior 179 $(window).on('scroll', function () { 180 const st = $(this).scrollTop(); 181 const headerHeight = $header.outerHeight(); 182 183 if (st > lastScrollTop) { 184 // Scrolling down 185 $header.stop().animate({ top: "-196px" }, 400); 186 } else { 187 // Scrolling up 188 $header.stop().animate({ top: "0px" }, 400); 189 } 190 191 lastScrollTop = st <= 0 ? 0 : st; // Prevent negative scroll 192 }); 193 194}); 195 196 197//Testimonial Module Slider 198jQuery(document).ready(function () { 199 jQuery('.testimonial-slider').on('init', function(event, slick){ 200 jQuery(slick.$dots).attr('role', 'group').attr('aria-label', 'Testimonial navigation'); 201 }); 202 jQuery(".testimonial-slider").slick({ 203 slidesToShow: 1, 204 slidesToScroll: 1, 205 arrows: true, 206 accessibility: false, 207 dots: true, 208 customPaging: function(slider, i) { 209 return '<button type="button" aria-label="Go to testimonial ' + (i + 1) + '"></button>'; 210 }, 211 speed: 2000, 212 infinite: true, 213 autoplay: true, 214 autoplaySpeed: 15000, 215 prevArrow: "<span class='page-numbers prev'></span>", 216 nextArrow: "<span class='page-numbers next'></span>" 217 }); 218 // Accessibility fix 219 jQuery('.testimonial-slider').on('afterChange', function(event, slick, currentSlide){ 220 jQuery('.slick-slide').removeAttr('aria-live'); 221 jQuery(slick.$slides[currentSlide]).attr('aria-live', 'polite'); 222 }); 223 224 225 226 jQuery(".hd-topbar-outer .search-bar-outer").click(function () { 227 jQuery("body").addClass("open-search-modal"); 228 }); 229 jQuery("#secondary-header .search-icon").click(function () { 230 jQuery("body").addClass("open-search-modal"); 231 }); 232 jQuery(".search-modal-close-btn").click(function () { 233 jQuery("body").removeClass("open-search-modal"); 234 }); 235 236 const mediaHolders = document.querySelectorAll('.media-holder'); // Get all 237 238 const observer = new IntersectionObserver((entries, observer) => { 239 entries.forEach(entry => { 240 if (entry.isIntersecting) { 241 entry.target.classList.add('visible'); 242 observer.unobserve(entry.target); // Optional: triggers only once 243 } 244 }); 245 }, { 246 root: null, 247 threshold: 0.3 // Triggers slightly earlier 248 }); 249 250 mediaHolders.forEach(el => observer.observe(el)); // Observe each one 251}); 252 253//Search Toggle 254jQuery(document).ready(function ($) { 255 $('#search-toggle').on('click', function () { 256 $('#search-form-wrapper').slideToggle(function (){ 257 $('#search-form-wrapper').find('input[type="search"]').focus(); 258 }); 259 $('.search-trigger').toggleClass('actiive'); 260 const currentText = $(this).text().trim(); 261 const newText = currentText === 'Search' ? 'Close' : 'Search'; 262 $(this).text(newText); 263 }); 264 if ($('body').hasClass('search')) { 265 $('#search-form-wrapper').show(); 266 $('.search-trigger').addClass('actiive'); 267 $('#search-toggle').text('Close'); 268 $('#search-form-wrapper').find('input[type="search"]').focus(); 269 } 270}); 271//Custom Search Input 272jQuery(document).ready(function ($) { 273 const $field = $('.search-form input[type="search"]'); 274 const $clearIcon = $('.clear-icon'); 275 const $searchclearIcon = $('.search-modal-close-btn'); 276 277 278 // Show/Hide the clear icon based on input 279 $field.on('input', function () { 280 if ($(this).val().length > 0) { 281 $clearIcon.show(); 282 } else { 283 $clearIcon.hide(); 284 } 285 }); 286 287 // Clear input when the icon is clicked 288 $clearIcon.on('click', function () { 289 $field.val('').trigger('input').focus(); 290 }); 291 292 $searchclearIcon.on('click', function () { 293 $field.val('').trigger('input').focus(); 294 }); 295 296}); 297 298//archive and taxxonomy page select dropdown 299jQuery(document).ready(function($) { 300 $('#resource-tab-select').on('change', function() { 301 var selectedUrl = $(this).val(); 302 if (selectedUrl) { 303 window.location.href = selectedUrl; 304 } 305 }); 306}); 307 308//common counter animation 309jQuery(document).ready(function($) { 310 let hasAnimatedSections = new Set(); 311 function animateCounters($section) { 312 $section.find('.counter-value').each(function() { 313 const $this = $(this); 314 const countTo = parseInt($this.text(), 10); 315 $({ countNum: 0 }).animate( 316 { countNum: countTo }, 317 { 318 duration: 2500, // Universal duration â customize if needed 319 easing: 'swing', 320 step: function() { 321 $this.text(Math.floor(this.countNum)); 322 }, 323 complete: function() { 324 $this.text(this.countNum); 325 } 326 } 327 ); 328 }); 329 } 330 331 const observer = new IntersectionObserver((entries) => {
332 entries.forEach(entry => { 333 const target = entry.target; 334 335 if (entry.isIntersecting && !hasAnimatedSections.has(target)) { 336 animateCounters($(target)); 337 hasAnimatedSections.add(target); 338 } 339 }); 340 }, { 341 threshold: 0.4 342 }); 343 // Add all counter sections here 344 const sections = ['.banner-counter-outer', '#card-counter-sec']; 345 346 sections.forEach(selector => { 347 const el = document.querySelector(selector); 348 if (el) { 349 observer.observe(el); 350 } 351 }); 352 353 // ð Tab change support â animate counters when tab is activated 354 jQuery('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) { 355 const targetSelector = jQuery(e.target).attr('href'); // e.g., "#tab1-content" 356 const $target = $(targetSelector); 357 358 // Only animate if not already animated 359 if (!hasAnimatedSections.has($target[0])) { 360 animateCounters($target); 361 hasAnimatedSections.add($target[0]); 362 } 363 }); 364 365 366 if (jQuery(".wow").length) { 367 var wow = new WOW({ 368 boxClass: "wow", // animated element css class (default is wow) 369 animateClass: "animated", // animation css class (default is animated) 370 offset: 150, 371 mobile: true, // trigger animations on mobile devices (default is true) 372 live: true, // act on asynchronously loaded content (default is true) 373 }); 374 wow.init(); 375 } 376 let lastScrollTop = 0; 377 let ticking = false; 378 379 function handleScroll() { 380 const st = jQuery(window).scrollTop(); 381 const footerOffset = jQuery('#footer').offset().top; 382 const windowBottom = st + jQuery(window).height(); 383 384 // Scroll direction 385 if (st < lastScrollTop) { 386 jQuery('#sticky-nav-bar').removeClass('hide'); 387 } else { 388 jQuery('#sticky-nav-bar').addClass('hide'); 389 } 390 391 // Footer detection 392 if (windowBottom >= footerOffset) { 393 jQuery('#sticky-nav-bar').addClass('disable-fixed'); 394 } else { 395 jQuery('#sticky-nav-bar').removeClass('disable-fixed'); 396 } 397 398 lastScrollTop = st <= 0 ? 0 : st; 399 ticking = false; 400 } 401 402 jQuery(window).on('scroll', function () { 403 if (!ticking) { 404 window.requestAnimationFrame(handleScroll); 405 ticking = true; 406 } 407 }); 408 409 jQuery('#sticky-nav-bar').removeClass('hide disable-fixed'); 410 411// var firstLabel = jQuery('#resource-tab-list li:first a').text(); 412// jQuery('#dropdownToggle').text(firstLabel); 413 414 // Toggle dropdown 415 jQuery('#dropdownToggle').on('click', function () { 416 jQuery('#resource-tab-list').slideToggle(200); 417 jQuery('#resource-tab-list').toggleClass('open'); 418 jQuery('#dropdownToggle').toggleClass('open'); 419 }); 420 421 // Update button text when category selected 422 jQuery('#resource-tab-list li a').on('click', function () { 423 jQuery('#dropdownToggle').text($(this).text()); 424 jQuery('#resource-tab-list').addClass('hidden'); 425 }); 426 427 // Optional: Hide dropdown when clicking outside 428 jQuery(document).on('click', function (e) { 429 if (!$(e.target).closest('.mobile-dropdowns').length) { 430 jQuery('#resource-tab-list').addClass('hidden'); 431 } 432 }); 433 434 435 // Toggle dropdown open/close for faq page 436 var firstLabelfaq = jQuery('#faqDropdownList li:first a').text(); 437 jQuery('#dropdownTogglefaq').text(firstLabelfaq); 438 jQuery('#dropdownTogglefaq').on('click', function () { 439 jQuery('#faqDropdownList').slideToggle(200); 440 jQuery('#faqDropdownList').toggleClass('open'); 441 jQuery('#dropdownTogglefaq').toggleClass('open'); 442 }); 443 444 // Switch tab content when a dropdown item is clicked 445 jQuery('.dropdown-tab-link').on('click', function (e) { 446 e.preventDefault(); 447 jQuery('#dropdownTogglefaq').removeClass('open'); 448 jQuery('#faqDropdownList').removeClass('open'); 449 450 const target = jQuery(this).attr('href'); 451 452 // Hide all tab panes 453 jQuery('.tab-pane').removeClass('show active'); 454 455 // Show the selected one 456 jQuery(target).addClass('show active'); 457 458 // Update dropdown button text 459 jQuery('#dropdownTogglefaq').text(jQuery(this).text()); 460 461 // Close dropdown list 462 jQuery('#faqDropdownList').slideUp(200); 463 }); 464 465 jQuery('.footer-newsletter .footer-right-content .news-btn-outer .ht-btns2').on('click', function () { 466 console.log('start'); 467 jQuery('.footer-right-content .mailpoet_form .mailpoet_submit').trigger('click'); 468 console.log('end'); 469 }); 470 471
472 // custom dropdown for contact form 473 jQuery('.dropdown-trigger').on('click', function(e) { 474 e.stopPropagation(); // Prevent bubbling 475 var $dropdown = $(this).closest('.custom-dropdown'); 476 jQuery('.dropdown-options').not($dropdown.find('.dropdown-options')).slideUp(200); // Close others 477 $dropdown.find('.dropdown-options').slideToggle(200); 478 $dropdown.toggleClass('open'); 479 }); 480 481 // Select option 482 jQuery('.dropdown-options li').on('click', function(e) { 483 e.stopPropagation(); 484 const selectedText = $(this).text(); 485 const selectedValue = $(this).data('value'); 486 487 const $dropdown = $(this).closest('.custom-dropdown'); 488 $dropdown.find('.dropdown-trigger').text(selectedText); 489 490 // Find the hidden input inside this dropdown and set its value 491 $dropdown.find('input[type="hidden"]').val(selectedValue); 492 493 $dropdown.find('.dropdown-options li').removeClass('selected'); 494 $(this).addClass('selected'); 495 496 $dropdown.find('.dropdown-options').slideUp(200); 497 $dropdown.removeClass('open'); 498 }); 499 500 // Close dropdown when clicking outside 501 jQuery(document).on('click', function() { 502 jQuery('.dropdown-options').slideUp(200); 503 jQuery('.custom-dropdown').removeClass('open'); 504 }); 505 506 /* home page parallex section scroll on mouse wheel */ 507 if( $('#parallax-sec').length > 0 ) { 508 let currentIndex = 0; 509 const parallax_sections = $('#parallax-sec .parallex-rows .parallex-items'); 510 const totalParallaxSections = parallax_sections.length; 511 console.log('totalParallaxSections', totalParallaxSections); 512 $(window).on('wheel', function (e) { 513 const delta = e.originalEvent.deltaY; 514 var parallaxTop = $('#parallax-sec').offset().top; 515 if( parallaxTop > $(window).scrollTop()) { 516 if (delta > 0) { 517 // Scroll down 518 if (currentIndex < totalParallaxSections - 1) { 519 currentIndex++; 520 // scrollToSection(currentIndex); 521 } 522 } else { 523 // Scroll up 524 if (currentIndex > 0) { 525 currentIndex--; 526 // scrollToSection(currentIndex); 527 } else { 528 // Scroll parent out of view if at top 529 // $('#parallax-sec .parallex-rows').css('transform', 'translateY(-100vh)'); 530 } 531 } 532 } 533 534 }); 535 536 537 } 538 539 function scrollToSection(index) { 540 // const offset = index * 100; 541 var $targetDiv = $('#parallax-sec .parallex-rows .parallex-items:nth-child('+index+')'); 542 var targetPosition = $targetDiv.offset().top; 543 $('html, body').animate({ 544 scrollTop: targetPosition - $(window).height() // Scroll to a point above the div's top 545 }, 1000); 546 /* 547 $('#parallax-sec .parallex-rows .parallex-items').each(function (i) { 548 var $targetDiv = $(this); 549 var targetPosition = $targetDiv.offset().top; 550 $('html, body').animate({ 551 scrollTop: targetPosition - $(window).height() // Scroll to a point above the div's top 552 }, 1000); // 1000 milliseconds for a smooth animation 553 // $(this).css('transform', `translateY(-${offset}vh)`); 554 }); 555 */ 556 /* 557 const offset = 100; 558 $('#parallax-sec .parallex-rows .parallex-items').each(function (i) { 559 $(this).css('transform', `translateY(-${offset}vh)`); 560 }); 561 $('#parallax-sec .parallex-rows').css('transform', 'translateY(0)'); 562 */ 563 } 564 565 566}); 567 568 // Hello Bar close with cookies 569 function setCookie(name, value, days) { 570 var expires = new Date(Date.now() + days * 864e5).toUTCString(); 571 document.cookie = name + "=" + encodeURIComponent(value) + "; expires=" + expires + "; path=/"; 572 } 573 574 // Get cookie (without optional chaining) 575 function getCookie(name) { 576 var cookies = document.cookie.split('; '); 577 for (var i = 0; i < cookies.length; i++) { 578 var parts = cookies[i].split('='); 579 if (parts[0] === name) { 580 return decodeURIComponent(parts[1]); 581 } 582 } 583 return null; 584 } 585 586 // jQuery DOM Ready 587 jQuery(document).ready(function () { 588 var $helloBar = jQuery('.hello-bar-sec'); 589 // Show bar only if cookie is not set 590 if (getCookie('bannerdismis') === 'true') { 591 $helloBar.hide(); // Use .hide() instead of .css('display', 'none') 592 } else { 593 $helloBar.show(); // Show only if cookie is not set 594 } 595 596 function updateHeights() { 597 if (jQuery("body").hasClass("home")) { 598 var topbar = jQuery(".header-topbar").length && jQuery(".header-topbar").is(":visible") 599 ? jQuery(".header-topbar").outerHeight() 600 : 0; 601 602 var hellobar = jQuery(".hello-bar-sec").length && jQuery(".hello-bar-sec").is(":visible") 603 ? jQuery(".hello-bar-sec").outerHeight() 604 : 0; 605 606 var total = topbar + hellobar; 607 608 console.log("topbar:", topbar, "hellobar:", hellobar, "total:", total); 609 610 jQuery('.hero-banner-sec').css('margin-top', total + 'px'); 611 jQuery('.hero-banner-sec').addClass('new-space'); 612 } 613 } 614 615 616 // On close icon click 617 jQuery('.hello-bar-sec .hello-bar-close-icon').on('click', function () { 618 $helloBar.slideUp(500, function () {
619 setCookie('bannerdismis', 'true', 1); // Cookie expires in 1 day 620 setTimeout(updateHeights, 1000); 621 }); 622 623 }); 624 625 jQuery('.search-field').on('focus', function () { 626 jQuery(this).data('placeholder', jQuery(this).attr('placeholder')); 627 jQuery(this).attr('placeholder', ''); 628 }).on('blur', function () { 629 jQuery(this).attr('placeholder', jQuery(this).data('placeholder')); 630 }); 631 632 setTimeout(updateHeights, 1000); 633 634 if(jQuery("body").hasClass("home")){ 635 jQuery("body").addClass("trasparent-bg"); 636 jQuery(window).on("scroll", function() { 637 if (jQuery(this).scrollTop() > 0) { 638 jQuery("body").removeClass("trasparent-bg"); 639 } else { 640 jQuery("body").addClass("trasparent-bg"); 641 } 642 updateHeights(); 643 }); 644 } 645 646 var form = jQuery(".mailpoet_form"); // adjust to your form selector 647 648 // MutationObserver handles showing/hiding during CAPTCHA and after success 649 var observer = new MutationObserver(function() { 650 if (form.find(".mailpoet_message_success").length) { 651 console.log("Success message detected, hiding button"); 652 jQuery(".news-btn-outer").hide(); 653 } else if (form.find(".mailpoet_captcha_container").length) { 654 console.log("CAPTCHA detected, hiding button"); 655 jQuery(".news-btn-outer").hide(); 656 } 657 }); 658 659 observer.observe(form[0], { childList: true, subtree: true }); 660 661 662 var $dialog = jQuery('#cookie-notice'); 663 if (!$dialog.length) return; 664 665 // Add ARIA attributes to the dialog 666 $dialog.attr({ 667 'role': 'dialog',
668 'aria-modal': 'true', 669 'aria-label': 'Cookie Consent', 670 'aria-live': 'polite' 671 }); 672 673 var $focusableEls = $dialog.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'); 674 var $firstEl = $focusableEls.first(); 675 var $lastEl = $focusableEls.last(); 676 677 // Move focus to first element when banner shows 678 $dialog.on('cnShown', function(){ 679 if ($firstEl.length) { 680 $firstEl.focus(); 681 } 682 }); 683 684 // Trap focus inside the dialog 685 $dialog.on('keydown', function(e){ 686 if (e.key === 'Tab') { 687 if (e.shiftKey) { 688 if (jQuery(document.activeElement).is($firstEl)) { 689 e.preventDefault(); 690 $lastEl.focus(); 691 } 692 } else { 693 if (jQuery(document.activeElement).is($lastEl)) { 694 e.preventDefault(); 695 $firstEl.focus(); 696 } 697 } 698 } 699 }); 700 701 // Return focus to trigger when closed 702 $dialog.on('cnClosed', function(){ 703 var $trigger = jQuery('.cookie-notice-trigger'); 704 if ($trigger.length) { 705 $trigger.focus(); 706 } 707 }); 708 709 });
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.