1/* 2 * @Author: blademann 3 * @Date: 2021-06-10 16:57:40 4 * @Last Modified by: blademann 5 * @Last Modified time: 2023-04-02 00:30:50 6 */ 7'use strict' 8 9// import navToggle from './lib/nav.toggle.min.mjs' 10// navToggle() 11 12 13/** 14 * adds space above content to match header height 15 * @type {Object} 16 */ 17const HeaderSpace = {} 18HeaderSpace.init = function (elem, target) { 19 const header = jQuery(elem) 20 const content = jQuery(target) 21 22 content.css('padding-top', header.outerHeight()) 23 24} 25 26 27const Modal = {} 28Modal.init = function(elem, content) { 29 let body = jQuery('body') 30 let modal = jQuery('.modal') 31 let navBar = jQuery('.masthead-navbar') 32 let closeBtn = jQuery('.js-modal-close', modal) 33 let area = jQuery('.wrapper', modal) 34 // let newcontent = content.clone() 35 36 console.log('modal.init fired') 37 console.log(content) 38 39 if(modal.hasClass('mm')) { 40// console.log(hit) 41 // HeaderSpace.init(masthead, area) 42 } 43 44// elem.on('click', function(){ 45 area.html(content) 46 body.addClass('modal-open') 47 navBar.addClass('modal-open') 48 modal.addClass('reveal'); 49 // html.addClass('modal-open') 50// }) 51 52 closeBtn.on('click', function(){ 53 // modal.hide(); 54 area.empty(); 55 area.remove(content); 56 body.removeClass('modal-open'); 57 modal.removeClass('reveal'); 58 navBar.removeClass('modal-open'); 59 60 if(modal.hasClass('mm')) { 61 modal.removeClass('mm') 62 } 63 if(modal.hasClass('mv')) { 64 modal.removeClass('mv') 65 } 66 67 }) 68 69 70} 71 72 73const ModalVideo = {} 74ModalVideo.init = function() { 75 76 let vidBtn = jQuery('.btn-watch') 77 let modal = jQuery('.modal') 78 79 80 vidBtn.on('click', jQuery(this), function(){ 81 82 let _this = jQuery(this); 83 modal.addClass('mv') 84 85 let modalSRC = _this.closest('.wrapper').find('.modal-video') 86 87 let videoClone = modalSRC.clone(true, true) 88 let video = videoClone.get() 89// var video = jQuery.extend({}, videoClone); 90 91 Modal.init(_this,video) 92 93 }) 94 95// vidBtn.trigger('click', function() { } ) 96 97 98 99} 100 101 102 103 104 105// /** 106// * [MobileMenu description] 107// * toggles mobile navigation 108// * @type {Object} 109// */ 110// const MobileMenu = {} 111// MobileMenu.init = function () { 112 113// const masthead = jQuery('.masthead'); 114// const toggle = jQuery('.btn-menu') 115// const mobile = jQuery('.masthead-menu-mobile') 116// const content = jQuery('.block-accordion-article-content') 117// // const pane = jQuery('.pane') 118// const tierOne = jQuery('', mobile) 119 120 121// toggle.on('click', function (e) { 122// e.preventDefault() 123// (masthead,mobile).toggleClass('is-open') 124 125// }) 126 127 128 129 130// jQuery(accTitle).on('click', function () { 131// const $this = jQuery(this) 132 133// const c = $this.next(content) 134 135// c.toggleClass('open') 136// f.toggleClass('fa-plus') 137// f.toggleClass('fa-minus') 138// }) 139 140 141// } 142 143 144/** 145 * enables animation effect for subnavs 146 * @type {Object} 147 */ 148const SubNavSlide = {} 149SubNavSlide.init = function () { 150 const button = jQuery('.menu-item-has-children') 151 const subnav = jQuery('.sub-menu', button) 152 153 button.hover( 154 function () { 155 subnav.addClass('animated wow fadeIn') 156 }, 157 function () { 158 subnav.removeClass('animated wow fadeIn') 159 } 160 ) 161} 162 163/** 164 * hide #back-top first 165 * @type {Object} 166 */ 167const BackToTop = {} 168BackToTop.init = function () { 169 const btnBackTop = jQuery('.btn-back-to-top') 170 171 btnBackTop.hide() 172 173 // fade in #back-top 174 jQuery(function () { 175 jQuery(window).on('scroll', function () { 176 if (jQuery(this).scrollTop() > 100) { 177 btnBackTop.fadeIn(350) 178 } else { 179 btnBackTop.fadeOut(350) 180 } 181 }) 182 183 // scroll body to 0px on click 184 btnBackTop.on('click', function () { 185 jQuery('body,html').animate( 186 { 187 scrollTop: 0 188 }, 189 350 190 ) 191 return false 192 }) 193 }) 194} 195 196/** 197 * toggles on fixed, following branding + navigation upon scroll 198 * @type {Object} 199 */ 200const GridMasonry = {} 201GridMasonry.init = function () { 202 const grid = jQuery('.flex') 203 // items = jQuery('.post', grid); 204 205 grid.masonry({ 206 itemSelector: '.post' 207 }) 208 209 // // assign masonry to default wordpress galleries 210 // jQuery('.gallery').masonry({ 211 // itemSelector: '.gallery-item' 212 // }); 213} 214 215 216/** 217 * [SearchModal description] 218 * @type {Object} 219 */ 220var SearchModal = {}; 221SearchModal.init = function () { 222 // var html = jQuery('html'), 223 // body = jQuery('body'), 224 // var mask = jQuery('.mask'), 225 var close = jQuery('.js-search-close'), 226 functionNav = jQuery('.masthead-nav-functional'), 227 searchButton = jQuery('.btn-search'), 228 // btnModal = jQuery('.btn-modal'), 229 searchArea = jQuery('.search-area'), 230 searchForm = jQuery('.search-area-form'), 231 input = jQuery('input', searchForm),
232 inputFirst = jQuery('input:first-of-type', '.search-form-container-inner'), 233 notice = jQuery('.notice', searchForm); 234 235 // var loadModal = function () { 236 // mask.fadeIn(350).css({ 237 // display: 'table', 238 // }); 239 // html.addClass('disable-scrolling'); 240 // body.addClass('disable-scrolling'); 241 // }; 242 243 notice.hide(); 244 245 var closeSearch = function () { 246 searchArea.removeClass('active'); 247 inputFirst.val(''); 248 input.val(''); 249 notice.hide(); 250 // closes modal window 251 // mask.hide(); 252 // html.removeClass('disable-scrolling'); 253 // body.removeClass('disable-scrolling'); 254 return false; 255 }; 256 257 // displays modal when image is pressed/clicked 258 // btnModal.on('click', function () { 259 // loadModal(); 260 // input.val(''); 261 // inputFirst.on('focus'); 262 // return false; 263 // }); 264 265 searchButton.on('click', function () { 266 // console.log('hit'); 267 searchArea.addClass('active'); 268 searchArea.removeClass('hide'); 269 inputFirst.val(''); 270 input.val(''); 271 return false; 272 }); 273 274 close.on('click', function () { 275 closeSearch(); 276 notice.removeClass('stay').hide(); 277 jQuery('.fa-refresh', searchForm) 278 .removeClass('fa-refresh') 279 .addClass('fa-search fa-spin'); 280 return false; 281 }); 282 283 notice.on('click', function () { 284 notice.hide(); 285 inputFirst.focus(); 286 }); 287 288 input.on('focus', function () { 289 notice.hide(); 290 }); 291 292 // submit form + prevents empty searches 293 searchForm.on('submit', function (e) { 294 var _this = jQuery(this), 295 s = _this.find(input).val(jQuery.trim(_this.find(input).val())); 296 297 // if input has no value, proceed 298 if (!s.val()) { 299 // remove lingering user alert 300 if (!notice.hasClass('stay')) { 301 notice.hide(); 302 } 303 // remove user alert 304 notice.fadeIn(350).addClass('stay'); 305 // force interaction to input field 306 inputFirst.focus(); 307 308 e.preventDefault(); 309 } else { 310 notice.hide(); 311 jQuery('.fa-search', searchForm) 312 .removeClass('fa-search') 313 .addClass('fa-refresh fa-spin'); 314 } 315 }); 316}; 317 318 319/** 320 * [JumpLinks description] 321 * @type {Object} 322 */ 323const JumpLinks = {} 324JumpLinks.init = function () { 325 // Bind to the click of all links with a #hash in the href 326 jQuery('a[href*="#"]').on('click', function (e) { 327 const location = this.hash 328 // Scroll the window, stop any previous animation, stop on user manual scroll 329 // Check https://github.com/flesler/jquery.scrollTo for more customizability 330 jQuery(window) 331 .stop(true) 332 .scrollTo(location, { 333 duration: 300, 334 interrupt: false, 335 easing: 'swing', 336 offset: { 337 top: -82 338 } 339 }) 340 // Prevent the jump and the #hash from appearing on the address bar 341 e.preventDefault() 342 }) 343} 344 345/** 346 * [SidePanel description] 347 * @type {Object} 348 */ 349const SidePanel = {} 350SidePanel.init = function () { 351 const button = jQuery('.js-button-global') 352 const body = jQuery('body') 353 354 button.on('click', function (e) { 355 e.preventDefault() 356 e.stopPropagation() 357 body.toggleClass('side-panel-open') 358 }) 359} 360 361 362/** 363 * Homepage hero flexslider 364 */ 365const HomeFlexslider = {} 366HomeFlexslider.init = function (container) { 367 jQuery(container).flexslider({ 368 animation: 'fade', 369 pauseOnHover: 1, 370 slideshow: true, 371 directionNav: false, 372 touch: true, 373 // selector: '.hero-home-wrapper > .hero-home-slide' , 374 controlsContainer: '.menu-slides', 375 // smoothHeight: 0, 376 start: function (slider) { 377 jQuery('.flex-active-slide') 378 .find('.hero-home-content-title') 379 .addClass('animate__animated animate__fadeInLeft animate__delay-2s') 380 jQuery('.flex-active-slide') 381 .find('.hero-home-content-button') 382 .addClass('animate__animated animate__fadeInLeft animate__delay-3s') 383 384 jQuery('.flex-active-slide') 385 .find('.hero-home-image') 386 .removeClass('zoom') 387 jQuery('.flex-active-slide') 388 .find('.hero-home-image-slide') 389 .removeClass('zoom') 390 }, 391 before: function (slider) { 392 jQuery('.flex-active-slide') 393 .find('.hero-home-image') 394 .removeClass('zoom') 395 jQuery('.flex-active-slide') 396 .find('.hero-home-image-slide') 397 .removeClass('zoom') 398 399 jQuery('.slide') 400 .not('.flex-active-slide') 401 .find('.hero-home-content-title') 402 .addClass('animate__animated animate__fadeInLeft animate__delay-2s') 403 jQuery('.slide') 404 .not('.flex-active-slide') 405 .find('.hero-home-content-button') 406 .addClass('animate__animated animate__fadeInLeft animate__delay-3s') 407 }, 408 after: function (slider) { 409 jQuery('.flex-active-slide') 410 .find('.hero-home-image') 411 .removeClass('zoom') 412 jQuery('.slide') 413 .not('.flex-active-slide') 414 .find('.hero-home-image') 415 .addClass('zoom') 416 jQuery('.flex-active-slide') 417 .find('.hero-home-image-slide') 418 .removeClass('zoom') 419 jQuery('.slide') 420 .not('.flex-active-slide') 421 .find('.hero-home-image-slide') 422 .addClass('zoom') 423 424 jQuery('.slide') 425 .not('.flex-active-slide') 426 .find('.hero-home-content-title') 427 .removeClass('animate__animated animate__fadeInLeft animate__delay-2s') 428 jQuery('.slide') 429 .not('.flex-active-slide') 430 .find('.hero-home-content-button') 431 .removeClass('animate__animated animate__fadeInLeft animate__delay-3s') 432 }, 433 end: function (slider) {} 434 }) 435} 436 437/** 438 * Homepage hero flexslider 439 */ 440const Flexslider = {} 441Flexslider.init = function (container) { 442 jQuery(container).flexslider({ 443 animation: 'fade', 444 pauseOnHover: 1, 445 slideshow: true, 446 directionNav: true, 447 touch: true, 448 // selector: '.hero-home-wrapper > .hero-home-slide' , 449 controlsContainer: '.menu-slides', 450 // smoothHeight: 0 451 }) 452} 453 454/** 455 * Add fancybox to all default wordpress galleries 456 */ 457const WpGallery = {} 458WpGallery.init = function () { 459 // adds fancybox data type to all gallery image links 460 jQuery('.gallery-item a').attr('data-fancybox', 'group') 461 462 jQuery('.gallery').fancybox({ 463 selector: '.gallery-item a', 464 minHeight: 0, 465 minWidth: 0, 466 animationEffect: 'fade', 467 animationDuration: 350 468 }) 469} 470 471/** 472 * display people info card on click 473 */ 474const CardInfo = {} 475CardInfo.init = function ($block) { 476 const card = jQuery('.card', $block) 477 const closeBtn = jQuery('.js-modal-close') 478 479 closeBtn.on('click', function () { 480 const body = jQuery('body') 481 const infoContainer = jQuery('.card-info') 482 const infoLocation = jQuery('.card-info-content', infoContainer) 483 const modal = jQuery('.modal') 484 const masthead = jQuery('.masthead') 485 const modalWrap = jQuery('.wrapper', modal) 486 487 488 489 // console.log('hit'); 490 491 card.removeClass('active') 492 493 infoLocation.empty() 494 infoContainer.remove() 495 // modal.hide(); 496 body.removeClass('modal-open'); 497 masthead.removeClass('modal-open'); 498 modal.removeClass('reveal'); 499 // modalWrap.remove(content); 500 501 502 return false 503 }) 504 505 // when user clicks on person add content to about section.
506 card.on('click', function () { 507 const _this = jQuery(this) 508 509 510 if(_this.hasClass('js-disable-modal')) { 511 return false; 512 } else { 513 514 const body = jQuery('body') 515 const modal = jQuery('.modal') 516 const modalWrap = jQuery('.wrapper', modal) 517 const masthead = jQuery('.masthead') 518 const cardHeight = _this.innerHeight() 519 const cardPosition = _this.position().top 520 const cardPositionLeft = _this.position().left 521 const arrowPosition = _this.width() * 0.7 + cardPositionLeft + 'px' 522 const info = jQuery('.card-footer', _this) 523 // const contentShell = jQuery('.modal-content').html() 524 const content = info.html() 525 // const section = jQuery(_this.parent()) 526 527 const cardMarkup = '<section class="card-info"><section class="card-info-content"></section></section>' 528 529 // console.log(cardPositionLeft); 530 531 modalWrap.append(cardMarkup); 532 533 const infoContainer = jQuery('.card-info', modal) 534 const arrow = jQuery('.card-info-arrow') 535 const infoLocation = jQuery('.card-info-content', infoContainer) 536 body.addClass('modal-open'); 537 masthead.addClass('modal-open'); 538 539 card.removeClass('active') 540 _this.addClass('active') 541 542 // remove any current content from infoContainer. 543 infoLocation.empty() 544 infoContainer.hide() 545 546 547 // add persons content to infoContainer. 548 549 // modal.html(content) 550 // modal.html(contentShell) 551 552 infoLocation.html(content) 553 // modal.show(); 554 modal.addClass('reveal'); 555 // infoContainer.css('top', cardPosition + cardHeight) 556 // arrow.css('left', arrowPosition) 557 infoContainer.show() 558 // window.addEventListener('resize', function () { 559 // const cardPosition = _this.position().top 560 // const cardPositionLeft = _this.position().left 561 // const cardHeight = _this.innerHeight() 562 // const arrowPosition = _this.width() * 0.7 + cardPositionLeft + 'px' 563 // arrow.css('left', arrowPosition) 564 // infoContainer.css('top', cardPosition + cardHeight) 565 // }) 566 } 567 }) 568 569 return false; 570} 571 572/** 573 * Hide/Show seeds of change info 574 */ 575const SoCToggle = {} 576SoCToggle.init = function () { 577 // adds fancybox data type to all gallery image links 578 const icons = jQuery('.infobox-icons') 579 const info = jQuery('.infobox-expanded') 580 const close = jQuery('.hamburger', info) 581 582 icons.on('click', function () { 583 icons.toggleClass('hide') 584 info.toggleClass('hide') 585 }) 586 close.on('click', function () { 587 icons.toggleClass('hide') 588 info.toggleClass('hide') 589 }) 590} 591 592 593 594/** 595 * [NavToggle description] 596 * @type {Object} 597 */ 598const NavToggle = {} 599NavToggle.init = function () { 600 601 const toggleBtn = jQuery('.button-menu-toggle') 602 const hamburger = jQuery('.hamburger', toggleBtn) 603 const masthead = jQuery('.masthead'); 604 const navBar = jQuery('.masthead-navbar'); 605 const mobile = jQuery('.masthead-menu-mobile') 606 const mobileList = jQuery('.masthead-menu-mobile-list', mobile) 607 608 609 const accordFirstTier = jQuery('.menu-item-has-children', mobileList) 610 const accordFirstTierTitle = jQuery('.menu-item-has-children > a:first-of-type',mobileList) 611 const accordFirstTierContent = accordFirstTierTitle.next('.sub-menu') 612 613 614 toggleBtn.on('click', function () { 615 jQuery(this).toggleClass('is-active') 616 hamburger.toggleClass('is-active') 617 mobile.toggleClass('is-open') 618 masthead.toggleClass('is-open') 619 navBar.toggleClass('is-open') 620 621 622 // mobile.hasClass('is-open') ? '' : mobile.addClass('is-open') 623 // masthead.hasClass('is-open') ? '' : masthead.addClass('is-open') 624 masthead.hasClass('mega') ? masthead.removeClass('mega') : '' 625 626 // navBar.hasClass('is-open') ? '' : navBar.addClass('is-open') 627 628 // accordFirstTier.hasClass('accordion') ? '' : accordFirstTier.addClass('accordion') 629 // accordFirstTierTitle.hasClass('accordion-title') ? '' : accordFirstTierTitle.addClass('accordion-title') 630 // accordFirstTierContent.hasClass('accordion-content') ? '' : accordFirstTierContent.addClass('accordion-content') 631 632 accordFirstTier.toggleClass('accordion') 633 accordFirstTierTitle.toggleClass('accordion-title') 634 accordFirstTierContent.toggleClass('accordion-content') 635 636 Accordion.init() 637 return false 638 }) 639} 640 641 642/** 643 * [MegaMenu description] 644 * @type {Object} 645 */ 646const MegaMenu = {} 647MegaMenu.init = function () { 648 const win = jQuery(window) 649 if (win.width() > 1169) { 650 const html = jQuery('html') 651 const body = jQuery('body') 652 const modal = jQuery('.modal') 653 const modalWrap = jQuery('.wrapper', modal) 654 const closeBtn = jQuery('.js-modal-close', modal) 655 const masthead = jQuery('.masthead') 656 const toggleBtn = jQuery('.button-menu-toggle') 657 const hamburger = jQuery('.hamburger', toggleBtn) 658 const mobile = jQuery('.masthead-menu-mobile') 659 const mobileList = jQuery('.masthead-menu-mobile-list', mobile) 660 const accordFirstTier = jQuery('.menu-item-has-children', mobileList) 661 const accordFirstTierTitle = jQuery('.menu-item-has-children > a:first-of-type',mobileList) 662 const accordFirstTierContent = accordFirstTierTitle.next('.sub-menu') 663 const gLinks = jQuery('.has-subpages a', masthead) 664 const megaMenu = jQuery('.masthead-menu-mega') 665 const megaMenuSection = jQuery('.mega-menu-section', megaMenu) 666 const sectionParentMenu = jQuery('.section-parent-menu', megaMenuSection) 667 const sectionParentMenuLinks = jQuery('.section-parent-links a', sectionParentMenu) 668 const subMenuTarget = jQuery('[data-sub-target]', sectionParentMenu) 669 const subMenuSection = jQuery('.section-submenu') 670 const subMenuParent = jQuery('.section-submenu-parent', subMenuSection) 671 const subMenu = jQuery('.section-submenu-column', subMenuSection) 672 const subMenuLinks = jQuery('a', subMenu) 673 const btnClose = jQuery('.js-menu-close', megaMenu) 674 675 const globalLink = gLinks.attr('data-mega-target') 676 677 678 jQuery(document).on('click', 'a[href="#"]', function (e) { 679 e.preventDefault() 680 }) 681 682 jQuery('.no-page').on('click', 'a[href="#"]', function (e) { 683 e.preventDefault() 684 }) 685 686 subMenuParent.on('click', 'a[href="#"]', function (e) { 687 e.preventDefault() 688 return false 689 }) 690 691 btnClose.on('click', function () { 692 // console.log('hit') 693 masthead.removeClass('is-open') 694 subMenuSection.removeClass('is-open') 695 megaMenuSection.removeClass('is-open') 696 megaMenu.removeClass('is-open') 697 mobile.removeClass('is-open') 698 toggleBtn.removeClass('is-active') 699 hamburger.removeClass('is-active') 700 701 return false 702 }) 703 704 gLinks.each(function(index){ 705 jQuery(this).attr('data-mega-target', '#mega-'+index) 706 // HeaderSpace.init(masthead, '.masthead-nav-mega') 707 }) 708 709 gLinks.on('click', function (e) { 710 e.preventDefault() 711 712 const _this = jQuery(this) 713 const megaTarget = jQuery(_this.attr('data-mega-target')) 714 const megaTargetParent = _this.parent() 715 716 717 _this.parent().removeClass('is-active') 718 gLinks.parent().removeClass('is-active') 719 subMenuSection.removeClass('active') 720 721 // toggleBtn.hasClass('is-active') ? '' : toggleBtn.addClass('is-active') 722 toggleBtn.toggleClass('is-active') 723 hamburger.toggleClass('is-active') 724 725 // mobile.hasClass('is-open') ? '' : mobile.addClass('is-open') 726 mobile.toggleClass('is-open') 727 728 // accordFirstTier.toggleClass('accordion') 729 // accordFirstTierTitle.toggleClass('accordion-title') 730 // accordFirstTierContent.toggleClass('accordion-content') 731 732 // Accordion.init() 733 734 masthead.hasClass('is-open') ? '' : masthead.addClass('is-open') 735 736 megaTargetParent.hasClass('is-active') ? megaTargetParent.removeClass('is-active') : megaTargetParent.addClass('is-active'), 737 megaMenu.hasClass('is-open') ? megaTarget.hasClass('is-open') 738 ? (megaMenu.removeClass('is-open'), 739 megaMenuSection.removeClass('is-open'), 740 megaTargetParent.removeClass('is-is-open'), 741 masthead.removeClass('is-open') 742 ) 743 : (megaMenuSection.not(megaTarget).removeClass('is-open'), 744 megaTarget.addClass('is-open'), 745 jQuery('.has-subpages').not(megaTargetParent).removeClass('is-active')) 746 : (megaMenu.addClass('is-open'), 747 megaTarget.addClass('is-open')) 748 749 // masthead.css('opacity', '1'); 750 // modal.show(); 751 // modal.addClass('reveal'); 752 }) 753 754 // sectionParentMenuLinks.on('click', function (e) { 755 // e.preventDefault() 756 // }) 757 sectionParentMenuLinks.each(function(index){ 758 jQuery(this).attr('data-sub-target', '#section-'+index) 759 }) 760 761 sectionParentMenuLinks.on('click', function (e) { 762 e.preventDefault() 763 const _this = jQuery(this) 764 const subTarget = jQuery(_this.attr('data-sub-target')) 765 subMenuSection.removeClass('is-open') 766 sectionParentMenuLinks.removeClass('is-active') 767 _this.hasClass('is-active') ? '' : _this.addClass('is-active') 768 subTarget.hasClass('is-open') ? subTarget.removeClass('is-open') : subTarget.addClass('is-open') 769 }) 770 771 subMenuLinks.on('click', function () { 772 let _this = jQuery(this) 773 774 _this.hasClass('.no-page') 775 ? e.preventDefault() 776 : (hideMegaMenu(), 777 masthead.removeClass('is-open'), 778 megaMenu.removeClass('is-open'), 779 jQuery('.view-container').addClass('hide'), 780 body.addClass('loading')) 781 }) 782 783 jQuery('a', megaMenu) 784 .not('.mega-section-no-link') 785 .not('.no-page') 786 .on({ 787 click: function (e) { 788 -1 !== jQuery(this).attr('href').indexOf('#'); 789 }, 790 }); 791 792 const hideMegaMenu = function () { 793 jQuery('.mega-menu-section', megaMenu).removeClass('is-open') 794 jQuery('.has-subpages').removeClass('is-active') 795 } 796 797 // closeBtn.on({ 798 // click: function (e) { 799 // // console.log('hit'); 800 // html.hasClass('modal-open') && 801 // (e.preventDefault(), 802 // html.removeClass('modal-open'), 803 // jQuery('.has-subpages').removeClass('is-active'), 804 // megaMenu.removeClass('active'), 805 // megaMenuSection.removeClass('active')), 806 // html.hasClass('modal-visible') && 807 // (html.removeClass('modal-visible'),
808 // jquery('.modal-content, .modal-video').remove()) 809 // modalWrap.find(megaMenu).remove() 810 // } 811 // }) 812 813 // modal.on({ 814 // click: function (e) { 815 // // console.log('hit'); 816 // html.hasClass('modal-open') && 817 // (e.preventDefault(), 818 // html.removeClass('modal-open'), 819 // jQuery('.has-subpages').removeClass('is-active'), 820 // megaMenu.removeClass('active'), 821 // magaMenuSection.removeClass('active')), 822 // html.hasClass('modal-visible') && 823 // (html.removeClass('modal-visible'), 824 // jquery('.modal-content, .modal-video').remove()) 825 // modalWrap.find(megaMenu).remove() 826 // } 827 // }) 828 829 } 830} 831 832 833 834/** 835 * [Accordion description] 836 * @type {Object} 837 */ 838const Accordion = {} 839Accordion.init = function () { 840 const a = jQuery('.accordion') 841 const fa = jQuery('.fa-plus', a) 842 const accTitle = jQuery('.accordion-title', a) 843 const content = jQuery('.accordion-content', a) 844 845 jQuery(accTitle).on('click', function (e) { 846 const $this = jQuery(this) 847 // const t = $this.find(title); 848 // console.log('hit'); 849 e.preventDefault() 850 851 852 const f = $this.find(fa) 853 const c = $this.next(content) 854 855 $this.toggleClass('active') 856 c.toggleClass('open') 857 f.toggleClass('fa-plus') 858 f.toggleClass('fa-minus') 859 return false 860 }) 861} 862 863 864 865 866const Tabs = {} 867Tabs.init = function () { 868 const menu = jQuery('.menu-tabs') 869 const tab = jQuery('.tab', menu) 870 const images = jQuery('.tabs') 871 872 tab.on('click', function () { 873 const $this = jQuery(this) 874 const target = jQuery($this.data('target')) 875 console.log(target) 876 877 tab.removeClass('active') 878 images.removeClass('active animate__') 879 880 $this.addClass('active') 881 target.addClass('active animate__animated') 882 883 return false 884 }) 885} 886 887/** 888 * Slick carousel 889 */ 890const SlickImageCarousel = {} 891SlickImageCarousel.init = function (container, item) { 892 const articles = jQuery(container).find(item).length 893 894 if (articles === 1) { 895 // don't initialize slick.js 896 } else { 897 jQuery(container).slick({ 898 adaptiveHeight: true, 899 arrows: false, 900 autoplay: true, 901 centerMode: true, 902 dots: true, 903 fade: true, 904 infinite: true, 905 slidesToScroll: 1, 906 slidesToShow: 1, 907 speed: 300, 908 lazyLoad: 'ondemand', 909 appendArrows: jQuery('.block-image-gallery-nav'), 910 prevArrow: 911 '<div class="flex-item"><button type="button" class="slick-prev"><i class="fa fa-chevron-left"></i></button></div>', 912 nextArrow: 913 '<div class="flex-item"><button type="button" class="slick-next"><i class="fa fa-chevron-right"></i></button></div>' 914 }) 915 } 916} 917/** 918 * Slick carousel 919 */ 920const SlickNewsCarousel = {} 921SlickNewsCarousel.init = function (container, item) { 922 const articles = jQuery(container).find(item).length 923 924 if (articles === 3) { 925 // don't initialize slick.js 926 } else { 927 jQuery(container).slick({ 928 adaptiveHeight: true, 929 arrows: false, 930 autoplay: false, 931 dots: true, 932 infinite: false, 933 slidesToScroll: 3, 934 slidesToShow: 3, 935 speed: 350, 936 prevArrow: 937 '<div class="flex-item"><button type="button" class="slick-prev"><i class="fa fa-chevron-left"></i></button></div>', 938 nextArrow: 939 '<div class="flex-item"><button type="button" class="slick-next"><i class="fa fa-chevron-right"></i></button></div>', 940 responsive: [ 941 // { 942 // breakpoint: 1024, 943 // settings: { 944 // slidesToShow: 3, 945 // slidesToScroll: 3, 946 // infinite: false, 947 // dots: true, 948 // adaptiveHeight: true, 949 // arrows: false, 950 // }, 951 // }, 952 { 953 breakpoint: 1024, 954 settings: { 955 slidesToShow: 2, 956 slidesToScroll: 2, 957 dots: true, 958 adaptiveHeight: true, 959 arrows: false 960 } 961 }, 962 { 963 breakpoint: 600, 964 settings: { 965 slidesToShow: 1, 966 slidesToScroll: 1, 967 dots: true, 968 adaptiveHeight: true,
969 arrows: false 970 } 971 } 972 // You can unslick at a given breakpoint now by adding: 973 // settings: "unslick" 974 // instead of a settings object 975 ] 976 }) 977 } 978} 979 980/** 981 * Stat Counter 982 */ 983const StatCount = {} 984StatCount.init = function() { 985 986 const statSection = jQuery(".stats"), 987 stats = jQuery(".number"); 988 989 990 statSection.waypoint({ 991 992 handler: function(direction) { 993 994 if (direction === "down") { 995 996 stats.each(function() { 997 var _this = jQuery(this); 998 // console.log('hit'); 999 jQuery({ 1000 Counter: 0 1001 }).animate({ 1002 Counter: _this.text() 1003 }, { 1004 duration: 4000, 1005 easing: 'swing', 1006 step: function(curValue) { 1007 _this.text(Math.ceil(curValue)); 1008 } 1009 }); 1010 }); 1011 1012 } 1013 // trigger once only 1014 this.destroy(); 1015 1016 }, 1017 1018 offset: "10%", 1019 }); 1020}; 1021 1022 1023 1024// const Hamburger = {}; 1025// Hamburger.init = function(){ 1026// var forEach=function(t,o,r){if("[object Object]"===Object.prototype.toString.call(t))for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.call(r,t[c],c,t);else for(var e=0,l=t.length;l>e;e++)o.call(r,t[e],e,t)}; 1027 1028// var hamburgers = document.querySelectorAll(".hamburger"); 1029// if (hamburgers.length > 0) { 1030// forEach(hamburgers, function(hamburger) { 1031// hamburger.addEventListener("click", function() { 1032// this.classList.toggle("is-active"); 1033// }, false); 1034// }); 1035// } 1036// } 1037 1038/** 1039 * load ALL the functions! 1040 * @param {WOW} 1041 * @return {[type]} 1042 */ 1043jQuery(window).on('load', function () { 1044 1045 Accordion.init() 1046 BackToTop.init() 1047 CardInfo.init('.block-cards-bio') 1048 MegaMenu.init() 1049 ModalVideo.init() 1050 NavToggle.init() 1051 SearchModal.init() 1052 Tabs.init() 1053 1054 1055 1056 // GridMasonry.init(); 1057 // Hamburger.init(); 1058 // HeaderSpace.init('.masthead', '.content') 1059 // MobileMenu.init() 1060 // SlickCarousel.init(); 1061 // StatCount.init(); 1062 // SubNavSlide.init(); 1063 // SidePanel.init() 1064 1065 const wow = new WOW({ 1066 boxClass: 'wow', // default 1067 animateClass: 'animated', // default 1068 offset: 0, // default 1069 mobile: false, 1070 live: true // default 1071 }) 1072 wow.init() 1073 1074 jQuery(document).on('click', 'a[href="#"]', function (e) { 1075 e.preventDefault() 1076 }) 1077 1078 1079 jQuery('body').removeClass('loading') 1080 1081// jQuery('.js-donation-overlay').on('click', function(){ 1082// setTimeout(jQuery('.blackbaud-adaptive-donation-form').last().addClass('visible'), 3000); 1083// }); 1084 1085 1086 1087})
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.