jQuery(function ($) { if ($('body.page-id-25').length) { gsap.registerPlugin(ScrollTrigger) function initSticky() { ScrollTrigger.getById('heroImagePin')?.kill() const $pin = $('.box-1 .col-2') const $end = $('.box-2 .row') if (!$pin.length || !$end.length) return const $row = $pin.closest('.row') $row.css('min-height', $('img', $pin).outerHeight()) ScrollTrigger.create({ id: 'heroImagePin', trigger: $pin[0], pin: true, start: 'top top', end: () => { const pinTop = $pin.offset().top const pinH = $pin.outerHeight() const endBottom = $end.offset().top + $end.outerHeight() return '+=' + Math.max(0, endBottom - pinTop - pinH) }, scrub: 0.5, anticipatePin: 1, invalidateOnRefresh: true, pinSpacing: true, pinReparent: true, }) } if ($(window).width() > 992) { $(window).on('load', initSticky) $(window).on('resize orientationchange', () => ScrollTrigger.refresh()) } if ($(window).width() <= 576) { const box = document.querySelector('.box-1') const col2 = box.querySelector('.col-2') const row = box.querySelector('.row') const moveX = row.offsetLeft - col2.offsetLeft - 30 gsap.to(col2, { x: moveX, ease: 'none', scrollTrigger: { trigger: box, start: 'top-=15px top', end: () => `+=${box.offsetHeight}`, scrub: true, pin: true, markers: false, }, }) } } }) jQuery(function ($) { if (!$('body').hasClass('page-id-47')) return const $body = $('body') $body.on('click', '.tile .tile--wrapper .tile--btn', function (e) { e.preventDefault() $body.addClass('no-scroll') const $tile = $(this).closest('.tile') const $sidebar = $tile.find('.tile-sidebar') $('.tile') .not($tile) .removeClass('active') .find('.tile-sidebar') .fadeOut(200) $sidebar.fadeToggle(200) $tile.toggleClass('active') }) $body.on( 'click', '.tile .tile-sidebar .tile--btn, .tile .tile-sidebar-bg', function (e) { e.preventDefault() $body.removeClass('no-scroll') $(this) .closest('.tile-sidebar') .fadeOut(200) .closest('.tile') .removeClass('active') } ) }) jQuery(function ($) { $('body').on('click', '.c-tabs .c-tabs--nav li', function (e) { e.preventDefault() let tabId = $(this).attr('tab_id') $(this) .closest('.c-tabs') .find('.c-tabs--nav li') .not(this) .removeClass('active') $(this).addClass('active') $(this) .closest('.c-tabs') .find('.c-tabs--content [tab_id]') .not('[tab_id=' + tabId + ']') .hide() $(this) .closest('.c-tabs') .find('.c-tabs--content [tab_id=' + $(this).attr('tab_id') + ']') .show() }) $('.c-tabs .c-tabs--nav li:first-child').trigger('click') $('body').on('click', '.c-acc .c-acc--item .c-acc--head', function (e) { e.preventDefault() $(this) .closest('.c-acc') .find('.c-acc--item') .not($(this).closest('.c-acc--item')) .removeClass('active') $(this).closest('.c-acc--item').toggleClass('active') $(this) .closest('.c-acc') .find('.c-acc--item .c-acc--body') .not($(this).next('.c-acc--body')) .slideUp(200) $(this).next('.c-acc--body').slideToggle(200) }) }) // jQuery(function ($) { // $('body').on( // 'click', // '.c-acc-advanced .c-acc--item .c-acc--head', // function (e) { // e.preventDefault() // let $head = $(this) // let $acc = $head.closest('.c-acc-advanced') // let $item = $head.closest('.c-acc--item') // let acc_parent_id = $acc.attr('acc_parent_id') // let acc_parent_item_id = $item.attr('acc_parent_item_id') // $acc.find('.c-acc--item').not($item).removeClass('active') // $item.toggleClass('active') // $acc // .find('.c-acc--item .c-acc--item') // .not($head.next('.c-acc--item')) // .slideUp(200) // $head.next('.c-acc--item').slideToggle(200) // let $targetBody = $head // .closest('.c-acc-group') // .find(`.c-acc-advanced[acc_child_id='${acc_parent_id}']`) // .find(`.c-acc--item[acc_child_item_id='${acc_parent_item_id}']`) // $targetBody // .addClass('active') // .siblings('.c-acc--item') // .removeClass('active') // .slideUp(200) // $targetBody.slideToggle(200) // } // ) // }) jQuery(function ($) { $('body').on( 'click', '.c-acc-advanced .c-acc--item .c-acc--head', function (e) { e.preventDefault() let $head = $(this) let $acc = $head.closest('.c-acc-advanced') let $item = $head.closest('.c-acc--item') let acc_parent_id = $acc.attr('acc_parent_id') let acc_parent_item_id = $item.attr('acc_parent_item_id') $acc.find('.c-acc--item').not($item).removeClass('active') $item.toggleClass('active') $acc .find('.c-acc--item .c-acc--item') .not($head.next('.c-acc--item')) .stop(true, true) .slideUp(200) $head.next('.c-acc--item').stop(true, true).slideToggle(200) if ( typeof acc_parent_id !== 'undefined' && typeof acc_parent_item_id !== 'undefined' ) { let $childAdvanced = $head .closest('.c-acc-group') .find(`.c-acc-advanced[acc_child_id='${acc_parent_id}']`) if ($childAdvanced.length) { let $targetItem = $childAdvanced.find( `.c-acc--item[acc_child_item_id='${acc_parent_item_id}']` ) $childAdvanced .find('.c-acc--item') .not($targetItem) .stop(true, true) .slideUp(200) .removeClass('active') if ($targetItem.length) { $targetItem.stop(true, true).slideToggle(200).toggleClass('active') } } } } ) $('.c-acc-advanced').each(function () { let $acc = $(this) if ($acc.find('.c-acc--item.active').length === 0) { let $firstHead = $acc.find('.c-acc--item .c-acc--head').first() if ($firstHead.length) { $firstHead.trigger('click') } } }) }) jQuery(function ($) { $('body').on('click', '#nav-menu-toggle', function (e) { e.preventDefault() $(this).toggleClass('active') $('#masthead').toggleClass('active') $('#masthead .site-branding').toggleClass('active') $('#site-navigation').stop().delay(250).slideToggle() $('#site-navigation').toggleClass('active') $('body').toggleClass('no-scroll') }) }) jQuery(function ($) { document.querySelectorAll('.animate-text').forEach((block) => { gsap.fromTo( block.querySelectorAll('.word .char'), { opacity: 0.2, }, { scrollTrigger: { trigger: block, start: 'top 80%', toggleActions: 'play none none none', }, opacity: 1, duration: 0.3, stagger: { each: 0.02, from: 'start', }, ease: 'power2.out', } ) }) }) jQuery(function ($) { gsap.fromTo( document.querySelectorAll('.animate-text-linear .word .char'), { opacity: 0.2, }, { scrollTrigger: { trigger: '.animate-text-linear', start: 'top 80%', toggleActions: 'play none none none', }, opacity: 1, duration: 0.25, stagger: { each: 0.015, from: 'start', }, ease: 'power2.out', } ) })