<header class="page-header" data-sticky-header>
    <div class="container-lg">
        <div class="page-header__main d-flex justify-content-between">
            <a role="button" href="#" class="brand-link">
                <i class="brand-logo" title="">
                    <svg height="73" viewBox="0 0 337 73" width="337" xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision">
                        <g fill="none" shape-rendering="geometricPrecision">
                            <path shape-rendering="geometricPrecision" d="m36.339 6.026c-3.21 6.42-9.768 20.901-12.5 29.371h-6.831c-2.391-7.307-9.016-22.403-12.636-29.37l-4.372-.891.41-3.96h18.374l-.341 3.96-5.67.89c2.254 4.78 6.831 15.163 8.948 21.517 2.118-6.49 6.216-16.532 8.539-21.518l-5.67-.889.342-3.96h15.574l.341 3.96zm27.427 29.167.273-3.962 5.26-.889c-.82-1.707-1.913-4.029-2.732-6.079h-12.09c-.684 1.778-2.118 4.713-2.733 6.08l4.986.888.41 3.962h-15.983l.273-3.962 4.167-.889c3.756-7.24 9.836-21.447 12.636-29.166h7.172c2.46 6.967 9.29 22.815 12.774 29.166l4.166.89.274 3.961zm-3.142-26.98h-.342c-1.024 3.073-3.074 8.743-4.303 11.75h9.084c-1.57-3.963-3.346-8.61-4.439-11.75zm73.606-3.076-4.782.89v29.03l-5.054.75c-6.01-7.582-16.462-20.149-22.609-26.503l.341 21.038 6.762.89.205 3.961h-18.1l.272-3.96 5.738-.89v-24.317l-6.01-.89.41-3.96h12.5c6.761 6.692 15.368 16.53 20.764 23.496l-.34-18.646-7.037-.89.41-3.96h16.871l-.34 3.96zm27.37 30.739c-10.656 0-19.877-6.146-19.877-17.145 0-12.5 9.768-18.238 19.809-18.238 4.44 0 10.11.684 13.456 2.188l-1.093 10.927-4.03.546-.683-8.058c-1.844-.821-4.508-1.366-6.967-1.366-6.49 0-11.886 4.166-11.886 14.07 0 8.333 5.738 12.843 12.228 12.843 2.39 0 5.122-.617 6.762-1.368l1.57-8.402 4.099.48v11.337c-2.801 1.298-8.402 2.186-13.388 2.186m45.545-.683.272-3.962 5.26-.889c-.819-1.707-1.913-4.029-2.732-6.079h-12.09c-.683 1.778-2.117 4.713-2.732 6.08l4.986.888.41 3.962h-15.983l.273-3.962 4.166-.889c3.757-7.24 9.836-21.447 12.637-29.166h7.173c2.46 6.967 9.29 22.815 12.772 29.166l4.166.89.275 3.961zm-3.143-26.98h-.34c-1.026 3.073-3.075 8.743-4.304 11.75h9.085c-1.57-3.963-3.347-8.61-4.44-11.75z" fill="#000" transform="translate(0 37)" />
                            <g fill="#d3ac3f" transform="translate(234 37)">
                                <path shape-rendering="geometricPrecision" d="m21.484 35.602c-2.938 0-10.588-.409-10.588-.409h-9.904l.274-3.962 5.806-.889v-24.316l-6.08-.888.41-3.962h9.222s7.922-.41 10.86-.41c11.749 0 19.535 6.011 19.535 16.804 0 11.886-7.924 18.032-19.535 18.032m-1.229-30.464c-1.709 0-4.167.204-5.534.275v25.544c1.436.137 3.895.274 6.079.274 7.242 0 11.818-4.85 11.818-13.113 0-9.223-5.464-12.98-12.363-12.98m55.671-3.676-.47 5.896c2.401 2.04 3.926 5.533 3.926 10.69 0 8.267-4.234 13.185-10.859 13.185-6.285 0-10.45-4.441-10.45-12.98 0-5.097 1.547-8.58 3.943-10.67l-.469-5.883c-7.184 2.408-12.083 8.34-12.083 17.168 0 10.724 8.743 17.008 18.65 17.008 10.997 0 19.875-6.352 19.875-18.306 0-8.196-5.036-13.933-12.063-16.108" />
                                <path shape-rendering="geometricPrecision" d="m65.765 18.184h5.925l.568-17.51c-.9673234-.12044888-1.9412066-.18056513-2.916-.18000395-1.426 0-2.809.10800395-4.14.32000395z" />
                            </g>
                            <g fill="#d3ac3f" transform="translate(326 38)" shape-rendering="geometricPrecision">
                                <path shape-rendering="geometricPrecision" d="m5.366.213c-2.74016079 0-4.9615 2.22133921-4.9615 4.9615s2.22133921 4.9615 4.9615 4.9615 4.9615-2.22133921 4.9615-4.9615-2.22133921-4.9615-4.9615-4.9615m0 .709c2.34717256.00275522 4.24924478 1.90482744 4.252 4.252-.00275522 2.34717256-1.90482744 4.24924478-4.252 4.252-2.34740074-.00220517-4.24979483-1.90459926-4.252-4.252.00220517-2.34740074 1.90459926-4.24979483 4.252-4.252" />
                                <path shape-rendering="geometricPrecision" d="m5.622 3.185h-1.272v2.13h1.27c.637 0 .827-.254.827-.667v-.794c0-.54-.254-.669-.826-.669zm0 2.83h-1.272v1.747h-.762v-5.275h2.033c1.145 0 1.59.51 1.59 1.367v.794c0 .571-.192.953-.764 1.208l1.43 1.906h-.922l-1.333-1.748z" />
                            </g>
                            <g fill="#000" transform="translate(112)" shape-rendering="geometricPrecision">
                                <path shape-rendering="geometricPrecision" d="m7.61 6.472c-1.005-.2-2.232-.335-2.992-.335-1.249 0-1.762.58-1.762 1.897v4.441c0 1.116.357 1.674 1.673 1.674 1.072 0 2.277-.58 3.08-1.294v-6.383zm-6.63 1.562c0-2.165.983-3.548 3.527-3.548.958 0 2.23.156 3.101.334v-4.552l1.878-.268v15.578h-1.586l-.157-.982c-.893.714-2.164 1.204-3.593 1.204-2.143 0-3.169-1.138-3.169-3.325v-4.44zm12.523 7.544h1.874v-10.868h-1.874zm0-12.61h1.874v-2.7h-1.874zm9.352 3.058c-1.808 0-2.477.603-2.477 2.21v.47c0 1.65.692 2.163 2.477 2.163 1.786 0 2.477-.737 2.477-2.164v-.47c0-1.584-.67-2.209-2.477-2.209zm4.955-.224-1.295.245c.402.56.58 1.318.603 2.167v.491c0 2.342-1.43 3.703-4.263 3.703-.402 0-.781-.022-1.116-.066-.38.312-.781.692-.781 1.16 0 .424.223.58.714.625 1.139.112 1.719.178 3.08.312 1.964.201 2.723.96 2.723 2.611 0 2.367-.826 3.147-4.754 3.147-1.004 0-2.722-.178-3.95-.513l.268-1.472c1.138.267 2.544.445 3.637.445 2.768 0 3.035-.379 3.035-1.518 0-.914-.334-1.07-1.606-1.182-1.206-.11-1.607-.157-2.88-.268-1.606-.134-2.12-.98-2.12-1.986 0-.804.447-1.473 1.027-1.919-1.027-.58-1.517-1.652-1.517-3.079v-.49c0-2.368 1.138-3.729 4.24-3.729.558 0 1.317.067 1.83.224h3.125zm2.97 9.776h1.875v-10.868h-1.875zm0-12.61h1.875v-2.7h-1.875zm11.56 12.431c-.7296569.2634009-1.4992581.3990537-2.275.401-1.83 0-2.701-.669-2.701-2.476v-7.053h-1.92v-1.56h1.92v-2.681l1.875-.269v2.949h3.08l-.156 1.561h-2.923v6.74c0 .804.112 1.205 1.116 1.205.513 0 1.049-.089 1.74-.267l.246 1.45zm8.84-4.218h-2.767c-1.16 0-1.585.357-1.585 1.451 0 1.115.202 1.562 1.54 1.562.937 0 1.986-.358 2.812-.893zm1.875 4.396h-1.585l-.11-.803c-.96.67-2.21 1.026-3.527 1.026-2.03 0-2.879-1.205-2.879-3.124 0-2.254 1.138-3.057 3.325-3.057h2.901v-1.697c0-1.36-.603-1.829-2.365-1.829-1.049 0-2.41.178-3.259.357l-.2-1.496c1.026-.267 2.41-.468 3.57-.468 3.103 0 4.13 1.205 4.13 3.526v7.565z" />
                                <path shape-rendering="geometricPrecision" d="m56.808 15.578v-15.31l1.874-.268v15.578z" />
                                <path shape-rendering="geometricPrecision" d="m79.395 15.578v-8.302c0-.715-.357-1.005-1.05-1.005-.892 0-2.476.492-3.637 1.094v8.213h-1.875v-8.302c0-.715-.356-1.005-1.048-1.005-.804 0-2.477.492-3.64 1.094v8.213h-1.872v-10.868h1.518l.177.937c1.206-.581 3.08-1.161 4.374-1.161 1.117 0 1.763.425 2.076 1.16 1.295-.625 3.125-1.16 4.486-1.16 1.74 0 2.366 1.094 2.366 2.768v8.324zm11.61-4.397h-2.769c-1.16 0-1.585.357-1.585 1.451 0 1.115.202 1.562 1.541 1.562.937 0 1.986-.358 2.812-.893v-2.12zm1.874 4.396h-1.585l-.112-.803c-.959.67-2.209 1.026-3.526 1.026-2.03 0-2.879-1.205-2.879-3.124 0-2.254 1.138-3.057 3.326-3.057h2.901v-1.697c0-1.36-.603-1.829-2.366-1.829-1.049 0-2.41.178-3.258.357l-.2-1.496c1.025-.267 2.41-.468 3.57-.468 3.102 0 4.13 1.205 4.13 3.526v7.565zm8.728-9.373c-1.026.49-2.21 1.25-3.103 1.875v7.499h-1.874v-10.868h1.63l.112 1.517c.9200576-.70290997 1.924545-1.28779683 2.99-1.741l.246 1.718zm10.693-1.494-3.885 5.378 4.064 5.49h-2.21l-3.974-5.49 3.84-5.378zm-8.348 10.868v-15.31l1.876-.268v15.578zm12.39-6.272h4.665v-.893c0-1.517-.516-2.366-2.278-2.366s-2.387.85-2.387 2.366zm2.589 4.888c1.07 0 2.253-.2 3.435-.513l.247 1.494c-1.027.38-2.477.625-3.838.625-3.215 0-4.308-1.539-4.308-3.994v-3.258c0-2.255 1.026-4.062 4.263-4.062 3.213 0 4.084 1.852 4.084 4.106v2.276h-6.472v.916c0 1.717.469 2.41 2.589 2.41zm13.838 1.384v-8.302c0-.715-.357-1.005-1.05-1.005-.804 0-2.477.492-3.637 1.094v8.213h-1.875v-10.868h1.518l.18.937c1.204-.581 3.078-1.161 4.373-1.161 1.74 0 2.365 1.094 2.365 2.768v8.324zm22.03 0v-8.302c0-.715-.357-1.005-1.05-1.005-.891 0-2.476.492-3.636 1.094v8.213h-1.875v-8.302c0-.715-.357-1.005-1.05-1.005-.804 0-2.478.492-3.638 1.094v8.213h-1.874v-10.868h1.518l.178.937c1.206-.581 3.08-1.161 4.374-1.161 1.117 0 1.763.425 2.076 1.16 1.293-.625 3.124-1.16 4.487-1.16 1.74 0 2.365 1.094 2.365 2.768v8.324zm11.609-4.397h-2.768c-1.16 0-1.584.357-1.584 1.451 0 1.115.202 1.562 1.539 1.562.938 0 1.987-.358 2.813-.893zm1.874 4.396h-1.584l-.111-.803c-.96.67-2.21 1.026-3.527 1.026-2.031 0-2.88-1.205-2.88-3.124 0-2.254 1.14-3.057 3.327-3.057h2.9v-1.697c0-1.36-.603-1.829-2.365-1.829-1.048 0-2.41.178-3.258.357l-.2-1.496c1.026-.267 2.41-.468 3.57-.468 3.102 0 4.128 1.205 4.128 3.526zm3.083-3.726v-3.415c0-2.499.937-3.95 4.329-3.95.96 0 2.03.156 2.589.334l-.156 1.563c-.785112-.16589057-1.585557-.24834845-2.388-.246-1.875 0-2.5.536-2.5 2.232v3.548c0 1.697.625 2.232 2.5 2.232.759 0 1.54-.068 2.388-.245l.178 1.561c-.557.18-1.651.335-2.611.335-3.481 0-4.33-1.45-4.33-3.949m16.808 3.727v-8.302c0-.715-.357-1.005-1.05-1.005-.803 0-2.476.514-3.637 1.117v8.19h-1.875v-15.31l1.874-.268v5.624c1.205-.58 2.924-1.138 4.196-1.138 1.74 0 2.366 1.094 2.366 2.768v8.324h-1.875zm7.1-6.272h4.663v-.893c0-1.517-.514-2.366-2.276-2.366-1.763 0-2.388.85-2.388 2.366v.893zm2.588 4.888c1.07 0 2.254-.2 3.436-.513l.246 1.494c-1.027.38-2.477.625-3.838.625-3.214 0-4.308-1.539-4.308-3.994v-3.258c0-2.255 1.027-4.062 4.263-4.062 3.214 0 4.084 1.852 4.084 4.106v2.276h-6.472v.916c0 1.717.47 2.41 2.59 2.41zm12.254-7.99c-1.026.49-2.21 1.25-3.103 1.875v7.499h-1.874v-10.868h1.629l.112 1.517c.920198-.70270044 1.924658-1.28757145 2.99-1.741z" />
                            </g>
                        </g>
                    </svg>
                </i> </a>

            <button class="navbar-toggler d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#navigation" aria-expanded="false" aria-label="Toggle navigation">
                <i class="base-icon" title="">
                    <svg class="icon" preserveAspectRatio="xMaxYMin">
                        <use xlink:href="/static/symbol-defs.svg#icon-hamburger" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0"></use>
                    </svg>
                </i> </button>
        </div>
    </div>

    <div class="page-header__nav offcanvas offcanvas-end" id="navigation">
        <nav class="nav nav--meta">
            <div class="container-lg">
                <menu class="nav__list d-lg-flex">
                    <li class="nav__item nav__item--pipe">
                        <a class="nav__link py-3 py-lg-2 px-lg-3" href="javascript:void(0);">MetaNav Item 01</a>
                    </li>
                    <li class="nav__item nav__item--pipe">
                        <a class="nav__link py-3 py-lg-2 px-lg-3" href="javascript:void(0);">MetaNav Item 02</a>
                    </li>
                    <li class="nav__item nav__item--pipe">
                        <a class="nav__link py-3 py-lg-2 px-lg-3" href="javascript:void(0);">MetaNav Item 03</a>
                    </li>
                    <li class="nav__item nav__item--pipe">
                        <a class="nav__link py-3 py-lg-2 px-lg-3" href="javascript:void(0);">MetaNav Item 04</a>
                    </li>
                    <li class="nav__item nav__item--pipe">
                        <a class="nav__link py-3 py-lg-2 px-lg-3" href="javascript:void(0);">MetaNav Item 05</a>
                    </li>
                </menu>
            </div>
        </nav>
        <nav class="nav nav--main">
            <div class="container-lg">
                <menu class="nav__list d-lg-flex">
                    <li class="nav__item ">
                        <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">Nav Item 01</a>
                        <nav class="nav nav--sub">
                            <div class="container-lg">
                                <menu class="nav__list d-lg-flex">
                    <li class="nav__item ">
                        <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">SubNav Item 01</a>
                    </li>
                    <li class="nav__item ">
                        <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">SubNav Item 02</a>
                    </li>
                    <li class="nav__item ">
                        <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">SubNav Item 03</a>
                    </li>
                    <li class="nav__item ">
                        <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">SubNav Item 04</a>
                    </li>
                    <li class="nav__item ">
                        <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">SubNav Item 05</a>
                    </li>
                </menu>
            </div>
        </nav>
        </li>
        <li class="nav__item ">
            <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">Nav Item 02</a>
        </li>
        <li class="nav__item ">
            <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">Nav Item 03</a>
        </li>
        <li class="nav__item ">
            <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">Nav Item 04</a>
        </li>
        <li class="nav__item ">
            <a class="nav__link py-3 p-lg-3" href="javascript:void(0);">Nav Item 05</a>
        </li>
        </menu>
    </div>
    </nav>
    </div>

    </button>
</header>
<header class="page-header" {{#if sticky}} data-sticky-header{{/if}}>
  <div class="container-lg">
    <div class="page-header__main d-flex justify-content-between">
      <a role="button" href="#" class="brand-link">
        {{> @logo }}
      </a>

      <button
        class="navbar-toggler d-lg-none"
        type="button"
        data-bs-toggle="offcanvas"
        data-bs-target="#navigation"
        aria-expanded="false"
        aria-label="Toggle navigation"
        >
        {{> @icon symbol="hamburger" }}
      </button>
    </div>
  </div
  >

  <div class="page-header__nav offcanvas offcanvas-end" id="navigation">
    {{> @nav metaNav }}
    {{> @nav mainNav }}
  </div>

  </button>
</header>
{
  "sticky": true,
  "metaNav": {
    "id": "nav",
    "class": "nav--meta",
    "items": [
      {
        "link": {
          "text": "MetaNav Item 01",
          "href": "javascript:void(0);",
          "class": "py-3 py-lg-2 px-lg-3"
        },
        "class": "nav__item--pipe"
      },
      {
        "link": {
          "text": "MetaNav Item 02",
          "href": "javascript:void(0);",
          "class": "py-3 py-lg-2 px-lg-3"
        },
        "class": "nav__item--pipe"
      },
      {
        "link": {
          "text": "MetaNav Item 03",
          "href": "javascript:void(0);",
          "class": "py-3 py-lg-2 px-lg-3"
        },
        "class": "nav__item--pipe"
      },
      {
        "link": {
          "text": "MetaNav Item 04",
          "href": "javascript:void(0);",
          "class": "py-3 py-lg-2 px-lg-3"
        },
        "class": "nav__item--pipe"
      },
      {
        "link": {
          "text": "MetaNav Item 05",
          "href": "javascript:void(0);",
          "class": "py-3 py-lg-2 px-lg-3"
        },
        "class": "nav__item--pipe"
      }
    ],
    "type": "meta"
  },
  "mainNav": {
    "id": "nav",
    "class": "nav--main",
    "items": [
      {
        "link": {
          "text": "Nav Item 01",
          "href": "javascript:void(0);",
          "class": "py-3 p-lg-3"
        },
        "nav": {
          "id": "nav",
          "class": "nav--sub",
          "items": [
            {
              "link": {
                "text": "SubNav Item 01",
                "href": "javascript:void(0);",
                "class": "py-3 p-lg-3"
              }
            },
            {
              "link": {
                "text": "SubNav Item 02",
                "href": "javascript:void(0);",
                "class": "py-3 p-lg-3"
              }
            },
            {
              "link": {
                "text": "SubNav Item 03",
                "href": "javascript:void(0);",
                "class": "py-3 p-lg-3"
              }
            },
            {
              "link": {
                "text": "SubNav Item 04",
                "href": "javascript:void(0);",
                "class": "py-3 p-lg-3"
              }
            },
            {
              "link": {
                "text": "SubNav Item 05",
                "href": "javascript:void(0);",
                "class": "py-3 p-lg-3"
              }
            }
          ],
          "type": "sub"
        }
      },
      {
        "link": {
          "text": "Nav Item 02",
          "href": "javascript:void(0);",
          "class": "py-3 p-lg-3"
        }
      },
      {
        "link": {
          "text": "Nav Item 03",
          "href": "javascript:void(0);",
          "class": "py-3 p-lg-3"
        }
      },
      {
        "link": {
          "text": "Nav Item 04",
          "href": "javascript:void(0);",
          "class": "py-3 p-lg-3"
        }
      },
      {
        "link": {
          "text": "Nav Item 05",
          "href": "javascript:void(0);",
          "class": "py-3 p-lg-3"
        }
      }
    ],
    "type": "main"
  }
}
  • Content:
    import { Offcanvas } from 'bootstrap'; 
    import Headroom from '@pluginjs/headroom';
    import '@pluginjs/headroom/dist/headroom.css';
    
    export const StickyHeader = (() => {
      window.addEventListener('load', function () {
        const header = document.querySelector('[data-sticky-header]');
        if (header) {
          document.documentElement.dataset.withStickyHeader  = true;
    
          const headroom = new Headroom(header, {
            classes: {
              initial : "page-header",
              pinned : "page-header--pinned",
              unpinned : "page-header--unpinned",
            }
          });
        }
      });
    })( window, document );
    
    export default StickyHeader;
  • URL: /components/raw/page-header/page-header.js
  • Filesystem Path: src/components/organisms/page-header/page-header.js
  • Size: 640 Bytes
  • Content:
    :root,
    *::before,
    *::after {
      --page-header-sm-height: #{$page-header-sm-height};
      --page-header-lg-height: #{$page-header-lg-height};
      --page-header-height: var(--page-header-sm-height);
      @include media-breakpoint-up(lg) {
        --page-header-height: var(--page-header-lg-height);
      }
    }
    
    .page-header {
      display: flex;
      flex-direction: column;
      &__main {
        height: var(--page-header-height);
        @include media-breakpoint-up($nav-breakpoint) {
          height: auto;
          position: relative;
          .brand-link {
            position: absolute;
            left: 0;
            top: 0;
            z-index: 1;
          }
        }
      }
    
      &__nav {
        display: flex;
        @include media-breakpoint-down($nav-breakpoint) {
          height: 0;
          &.show {
            flex-direction: column-reverse;
            justify-content: flex-end;
            overflow-y: auto;
            height: calc(100vh - var(--page-header-height));
          }
        }
        @include media-breakpoint-up($nav-breakpoint) {
          flex-direction: column;
          .nav__list {
            justify-content: flex-end;
          }
        }
      }
    
      .brand-logo {
        display: block;
        max-width: 12rem;
        height: var(--page-header-height);
        flex: none;
        display: grid;
        place-content: center;
        svg {
          max-width: 100%;
          max-height: 100%;
        }
      }
    }
    
    .offcanvas-end {
      @include media-breakpoint-down(lg) {
        transform: translateX(100%);
        transition: transform 180ms ease-in-out;
        &.show {
          transform: translateX(0);
        }
      }
    }
    
    .page-header {
      &[data-sticky-header] {
        position: fixed;
        z-index: 10;
        right: 0;
        left: 0;
        top: 0;
    
        will-change: transform;
        transition: transform 200ms linear;
      }
    
      &--pinned {
        transform: translateY(0%);
      }
      &--unpinned {
        transform: translateY(-100%);
      }
    }
    
    html[data-with-sticky-header] {
      scroll-padding-top: var(--page-header-height); 
      body {
        scroll-padding-top: var(--page-header-height); 
        padding-top: var(--page-header-height);
      }
    
      .page--main {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - var(--page-header-height));
      }  
    }
  • URL: /components/raw/page-header/page-header.scss
  • Filesystem Path: src/components/organisms/page-header/page-header.scss
  • Size: 2.1 KB

No notes defined.