1( () => { 2 const navAnchors = document.querySelectorAll( 'a.nav-anchor' ); 3 4 /** 5 * Set up IntersectionObserver to detect when a nav anchor is in view. 6 * When a nav anchor is in view, dispatch a custom event to tell the nav blocks to update state. 7 */ 8 let observerOptions = { 9 root: null, 10 rootMargin: '0px', 11 threshold: 0 12 } 13 14 let observer = new IntersectionObserver( ( entries ) => { 15 entries.forEach( ( entry ) => { 16 if ( entry.isIntersecting ) { 17 document.dispatchEvent( new CustomEvent( 'fp-blocks/nav-anchor/in-view', { 18 detail: { 19 navAnchor: entry.target 20 } 21 } ) ); 22 } 23 } ); 24 }, observerOptions ); 25 26 navAnchors && navAnchors.forEach( ( navAnchor ) => { 27 observer.observe( navAnchor ); 28 } ); 29} )(); 30; 31( () => { 32 const blocks = document.querySelectorAll( '.block-container' ); 33 blocks.length && blocks.forEach( ( block ) => { 34 /** 35 * If the block is fixed and has a bottom value of 0px, then we need to 36 * add bottom padding to the body to prevent the block from overlapping 37 */ 38 if ( 39 block.classList.contains( 'make-fixed' ) 40 && getComputedStyle( block ).bottom === '0px' 41 ) { 42 document.querySelector( 'body' ).style.paddingBottom = block.offsetHeight + 'px'; 43 } 44 } ); 45} )(); 46; 47( ( $ ) => { 48 function initHeader() { 49 let observerOptions = { 50 root: null, 51 rootMargin: '0px 0px 0px 0px', 52 threshold: 0.66, 53 }; 54 55 let observer = new IntersectionObserver( function( entries ) { 56 $( entries ).each( function() { 57 const videoOverlay = $( '.block-background-video__video-container-overlay' ); 58 const arrow = $( '.block-background-video__arrow' ); 59 if ( this.isIntersecting ) { 60 videoOverlay.css( 'background-color', videoOverlay.data( 'initial-background' ) ); 61 arrow.show( () => { arrow.css( 'opacity', 1 ) } ); 62 } else { 63 videoOverlay.css( 'background-color', videoOverlay.data( 'final-background' ) ); 64 arrow.css( 'opacity', 0, () => { arrow.hide(); } ); 65 } 66 } ); 67 }, observerOptions ); 68 69 let observedElement = $( '.block-background-video .wp-block-group' ).get( 0 ); 70 if ( observedElement ) { 71 observer.observe( $( '.block-background-video .wp-block-group' ).get( 0 ) ); 72 } 73 } 74 75 function initVimeo() { 76 if ( $( '.block-background-video__video-container iframe' ).length ) { 77 const Vimeo = window.Vimeo || { Player: function() {} }; 78 const bgVideo = new Vimeo.Player( $( '.block-background-video__video-container iframe' ) ); 79 80 $( '.modal' ).on( 'hidden.bs.modal', function () { 81 bgVideo.play(); 82 83 var iframe = $( this ).find( 'iframe' ).get( 0 ); 84 var player = new Vimeo.Player( iframe ); 85 player.pause(); 86 } ); 87 $( '.modal' ).on( 'shown.bs.modal', function () { 88 bgVideo.pause(); 89 90 var iframe = $( this ).find( 'iframe' ).get( 0 ); 91 var player = new Vimeo.Player( iframe ); 92 player.play(); 93 } ); 94 } 95 } 96 97 initHeader(); 98 initVimeo(); 99} )( jQuery ); 100; 101let debounceTimer; 102window.debounce = window.debounce || function( callback, time ) { 103 window.clearTimeout( debounceTimer ); 104 debounceTimer = window.setTimeout( callback, time ); 105}; 106; 107( () => { 108 const blocks = document.querySelectorAll( '.block-parallax-scroller' ); 109 blocks.forEach( ( block ) => { 110 const sectionContainer = block.querySelector( '.block-parallax-scroller__sections' ); 111 const background = sectionContainer.querySelector( '.block-parallax-scroller__bg' ); 112 const backgroundMobile = sectionContainer.querySelector( '.block-parallax-scroller__bg--mobile' ); 113 const backgroundDuration = 0; //( getComputedStyle( background ).transitionDuration.replace( /s/, '' ) * 1000 ) * 0.5; 114 const sections = sectionContainer.querySelectorAll( '.block-parallax-scroller__section' ); 115 const sectionObserver = new IntersectionObserver( 116 ( entries ) => { 117 entries.forEach( ( entry ) => { 118 jQuery( entry.target ).hide().show( 0 ); 119 120 if ( entry.isIntersecting ) { 121 const curBg = background.style.backgroundImage; 122 const newBg = 'url("' + entry.target.dataset.bg + '")'; 123 124 if ( newBg !== curBg ) { 125 // background.classList.add( 'inactive' ); 126 // setTimeout( () => background.style.backgroundImage = 'url(' + entry.target.dataset.bg + ')', backgroundDuration ); 127 // setTimeout( () => background.classList.remove( 'inactive' ), backgroundDuration ); 128 background.style.backgroundImage = 'url(' + entry.target.dataset.bg + ')'; 129 130 // backgroundMobile.classList.add( 'inactive' ); 131 // setTimeout( () => backgroundMobile.style.backgroundImage = 'url(' + (entry.target.dataset.bgMobile || entry.target.dataset.bg) + ')', backgroundDuration ); 132 // setTimeout( () => backgroundMobile.classList.remove( 'inactive' ), backgroundDuration ); 133 backgroundMobile.style.backgroundImage = 'url(' + (entry.target.dataset.bgMobile || entry.target.dataset.bg) + ')'; 134 } 135 } 136 } ); 137 }, 138 { 139 root: null, 140 rootMargin: '0px 0px 50% 0px', 141 threshold: 0.5, 142 } 143 ); 144 145 sections.forEach( ( section ) => { 146 sectionObserver.observe( section ); 147 } ); 148 } ); 149} )(); 150; 151( () => { 152 const interval = setInterval( () => { 153 const blocks = document.querySelectorAll( '.block-expandable' ); 154 blocks.length && blocks.forEach( ( block ) => { 155 const trigger = block.querySelector( '.block-expandable__label' ); 156 157 trigger && trigger.addEventListener( 'click', ( e ) => { 158 e.preventDefault(); 159 block.classList.toggle( 'block-expandable--open' ); 160 } ); 161 } ); 162 163 clearInterval( interval ); 164 }, 500 ); 165} )(); 166;
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.