a:1:{s:16:"site_wide_header";a:1:{i:0;a:14:{s:2:"id";i:8128;s:5:"title";s:19:"Hero scroll snippet";s:4:"code";s:2697:"/**
 * Navbar Background Color on Scroll
 * Transitions navbar from transparent to ivory as you scroll past hero
 * Uses CSS variables instead of classes
 */

(function() {
  // Wait for DOM to be ready
  function initScript() {
    const navbar = document.querySelector('.elementor-element-08fc871');
    const hero = document.getElementById('jaynes-hero');
    
    if (!navbar || !hero) {
      // Retry after a short delay
      setTimeout(initScript, 500);
      return;
    }
    
    // Get initial padding values from computed styles
    const initialStyles = getComputedStyle(navbar);
    const initialPaddingTop = parseFloat(initialStyles.paddingTop);
    const initialPaddingBottom = parseFloat(initialStyles.paddingBottom);
  
    const transitionPoint = hero.offsetHeight;
    let ticking = false;

    function updateNavbarBackground() {
      const currentScroll = window.scrollY;
      const progress = Math.min(currentScroll / transitionPoint, 1);
      
      // Get your primary color from Elementor's CSS variable
      const primaryColor = getComputedStyle(document.documentElement).getPropertyValue('--e-global-color-primary').trim();
      
      // Apply background with opacity
      if (primaryColor) {
        navbar.style.backgroundColor = `rgba(${primaryColor}, ${progress})`;
      } else {
        // Fallback to ivory if variable not found
        navbar.style.backgroundColor = `rgba(245, 241, 237, ${progress})`;
      }
      
      // Add border only when scrolled past hero
      if (progress > 0.65) {
        navbar.style.borderBottom = '1px solid var(--e-global-color-41bbcfd)';
      } else {
        navbar.style.borderBottom = 'none';
      }
      
      // Smooth padding interpolation from initial to final values
      // Top: from initialPaddingTop to 30px
      // Bottom: from initialPaddingBottom to 3px
      const paddingTopValue = initialPaddingTop + (progress * (30 - initialPaddingTop));
      const paddingBottomValue = initialPaddingBottom + (progress * (3 - initialPaddingBottom));
      
      navbar.style.paddingTop = paddingTopValue + 'px';
      navbar.style.paddingBottom = paddingBottomValue + 'px';
      
      ticking = false;
    }

  function onScroll() {
    if (!ticking) {
      window.requestAnimationFrame(updateNavbarBackground);
      ticking = true;
    }
  }

    window.addEventListener('scroll', onScroll, { passive: true });
    updateNavbarBackground();
  }

  // Start checking for elements
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', initScript);
  } else {
    initScript();
  }
})();";s:9:"code_type";s:2:"js";s:8:"location";s:16:"site_wide_header";s:11:"auto_insert";i:1;s:13:"insert_number";i:1;s:9:"use_rules";b:0;s:5:"rules";a:0:{}s:8:"priority";i:10;s:14:"location_extra";s:0:"";s:20:"shortcode_attributes";a:0:{}s:13:"compiled_code";s:0:"";s:8:"modified";s:19:"2026-05-10 10:20:03";}}}