grahambewley of Design Team
5/5/2020 - 8:40 PM

Pad Intrinsic Hero Images

Pad intrinsic hero images so navigation does not cut the top off

<script>
  // Get the intrinsic hero page background element (only present if "Intrinsic" hero image is selected)
  const intrinsicHero = document.querySelector('.page-bg.is-intrinsic');
  // If this page has an intrinsic header...
  if(intrinsicHero) {
    // Get the height of the navigation bar
    const headerHeight = document.querySelector('#header').offsetHeight;
    // Add top padding to push the intrinsic image down so the top is not cut off
    intrinsicHero.style.paddingTop = headerHeight + 'px';
  }
</script>