<section class="megaMenu">
    <span class="mainNav__link megaMenu__trigger">nav label</span>

    <span class="megaMenu__icon megaMenu__trigger"></span>

    <div class="megaMenu__target">
        <div class="megaMenu__inner">
            <div class="megaMenu__links">
            </div>

            <div class="megaMenu__cta">
                <a href="#" class="button">
                    <span class="button__label">mega menu cta</span>
                </a>

            </div>
        </div>
    </div>
</section>
<section class="megaMenu">
  <span class="mainNav__link megaMenu__trigger">{{ label }}</span>

  <span class="megaMenu__icon megaMenu__trigger"></span>

  <div class="megaMenu__target">
    <div class="megaMenu__inner">
      <div class="megaMenu__links">
        {{#each lists }}
          {{#if items }}
            <ul class="megaMenu__list">
              {{#each items }}
                <li class="megaMenu__item">
                  <a href="{{ url }}" class="megaMenu__link">
                    {{#if icon }}
                    <span class="megaMenu__link__icon">
                      {{render (concat '@' icon) }}
                    </span>
                    {{/if}}

                    {{ label }}
                  </a>
                </li>
              {{/each}}
            </ul>
          {{/if}}
        {{/each}}
      </div>

      {{#if banner }}
      <div class="megaMenu__aside">
        <div class="megaMenu__aside__inner">
          <a href="{{ banner.url }}" class="megaMenu__banner" target="">
            <span class="megaMenu__banner__visual responsiveImage--bg">
              <em data-mq="small" href="{{ banner.visual.small }}"></em>
              <em data-mq="large" href="{{ banner.visual.large }}"></em>
            </span>

            <div class="megaMenu__banner__content">
              <p class="megaMenu__banner__title"></p>
              <div class="megaMenu__banner__desc">
                <div style="max-width:160px">
                  {{{ banner.caption }}}
                </div>
              </div>
            </div>
          </a>
        </div>
      </div>
      {{/if}}

      {{#if cta }}
      <div class="megaMenu__cta">
        {{render '@button' cta }}
      </div>
      {{/if}}
    </div>
  </div>
</section>
label: nav label
cta:
  url: '#'
  label: mega menu cta
  • Content:
    if (!window.megaMenu) {  // disabled megaMenu loading twice because it's included in https://preprod.pioneerdj.com/Bundles/JsHeader/?v=BMne-U6Vgal8q3NFbvZfdgOMUnIfzy_RdwlKQDCSjtg1
      var megaMenu = function(n, t, i) {
          "use strict";
          var r = {
              selectors: {
                  theWrap: ".megaMenu",
                  theTrigger: ".megaMenu__trigger",
                  theTarget: ".megaMenu__target",
                  theInner: ".megaMenu__inner",
                  theHeader: ".header__inner",
                  theHeaderNav: ".header__nav",
                  theCookieBar: ".cookie",
                  theVisibles: ".megaMenu-is-visible"//,
                  // theBanner: ".megaMenu__banner__visual"
              },
              classes: {
                  theWrap: "megaMenu",
                  megaMenuIsVisible: "megaMenu-is-visible"
              },
              theOffset: 10
          }
            , u = {}
            , o = function() {
              if (!i) {
                  console.log("jQuery is not loaded!");
                  return
              }
              if (u.theTrigger = i(r.selectors.theTrigger),
              u.theTarget = i(r.selectors.theTarget),
              u.theInner = i(r.selectors.theInner),
              u.theHeader = i(r.selectors.theHeader),
              u.theHeaderNav = i(r.selectors.theHeaderNav),
              u.theCookieBar = i(r.selectors.theCookieBar),
              // u.theBanner = i(r.selectors.theBanner),
              u.theTrigger.length && u.theTarget.length) {
                  r.theHeaderHeight = u.theHeader[0].offsetHeight || 0;
                  r.theCookieBarHeight = u.theCookieBar[0] && u.theCookieBar[0].offsetHeight || 0;
                  u.theTrigger.on("click", function(n) {
                      n.preventDefault();
                      h(i(this))
                  });
                  n.addEventListener("resize", s);
                  f();
                  // TD.responsiveImages(u.theBanner, {
                  //     useBackground: !0,
                  //     mediaQueries: {
                  //         small: "only screen and (max-width: 1023px)",
                  //         large: "only screen and (min-width: 1024px)"
                  //     }
                  // })
              }
          }
            , s = function() {
              clearTimeout(r.theTimer);
              r.theTimer = setTimeout(function() {
                  e();
                  f()
              }, 300)
          }
            , f = function() {
              u.theInner.each(function() {
                  i(this).parents(r.selectors.theTarget)[0].style.height = this.offsetHeight + "px"
              })
          }
            , h = function(n) {
              var t;
              n && (t = n.parents(r.selectors.theWrap),
              t[0].classList.contains(r.classes.megaMenuIsVisible) ? l(n) : c(n))
          }
            , c = function(n) {
              var t;
              n && (t = n.parents(r.selectors.theWrap),
              t[0].classList.add(r.classes.megaMenuIsVisible),
              a(n))
          }
            , l = function(n) {
              var t;
              n && (t = n.parents(r.selectors.theWrap),
              t[0].classList.remove(r.classes.megaMenuIsVisible))
          }
            , e = function() {
              var n = i(r.selectors.theVisibles);
              n.length && n.removeClass(r.classes.megaMenuIsVisible)
          }
            , a = function(t) {
              var i = 0;
              t && (i = t ? t.offset().top - n.scrollY : 0,
              i -= r.theOffset,
              i -= r.theHeaderHeight,
              u.theHeaderNav.animate({
                  scrollTop: i
              }, 300))
          };
          return n.addEventListener("load", o),
          {
              hideAll: e
          }
      }(window, window.document, window.jQuery);
    }
    
  • URL: /components/raw/mega-menu/mega-menu.js
  • Filesystem Path: ../src/03_molecules/mega-menu/mega-menu.js
  • Size: 3.5 KB
  • Content:
    .megaMenu {
      position: relative;
    
      @media (min-width: 1024px) {
        display: flex;
        align-items: center;
      }
    }
    
    .megaMenu__icon {
      position: absolute;
      top: 0;
      right: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      background-color: #2A2937;
    
      .theme-2020 & {
        color: var(--color--action);
        background-color: var(--color--neutrals-10);
      }
    
      @media (min-width: 1024px) {
        transition: transform 300ms;
        position: relative;
        display: block;
        width: 0;
        height: 0;
        margin-left: var(--gap--1);
        border-top: 5px solid #FFF;
        border-right: 4px solid transparent;
        border-left: 4px solid transparent;
        background-color: transparent;
      }
    
      .megaMenu:hover & {
        @media (min-width: 1024px) {
          transform: rotateX(-180deg);
        }
      }
    }
    
    .megaMenu__icon:before,
    .megaMenu__icon:after {
      display: block;
      flex: 0 0 auto;
      width: var(--gap--4);
      height: 2px;
      background-color: #FFF;
      content: '';
    
      .theme-2020 & {
        background-color: currentColor;
      }
    
      @media (min-width: 1024px) {
        display: none;
      }
    }
    
    .megaMenu__icon:after {
      transition: transform 200ms,opacity 200ms;
      transform: scale(1) rotate(-90deg);
      position: absolute;
      top: 50%;
      left: 50%;
      margin-top: -1px;
      margin-left: -8px;
      opacity: 1;
    
      .megaMenu-is-visible & {
        transform: scale(0) rotate(-90deg);
        opacity: 0;
      }
    }
    
    .megaMenu__target {
      transition: height 300ms;
      display: block;
      width: 100%;
      overflow: hidden;
    
      @media (min-width: 1024px) {
        transition: left 0s 450ms;
        position: fixed;
        top: var(--header-height);
        left: 100%;
      }
    
      .megaMenu:not(.megaMenu-is-visible) & {
        height: 0 !important;
    
        @media (min-width: 1024px) {
          transition: left 0s;
          left: 0;
        }
      }
    
      .megaMenu:hover & {
        @media (min-width: 1024px) {
          overflow: visible;
        }
      }
    }
    
    .megaMenu__inner {
      display: flex;
      align-items: flex-start;
      flex-wrap: wrap;
      padding: var(--gap--4);
    
      @media (min-width: 1024px) {
        transition: height 0s 450ms, opacity 300ms 150ms;
        position: relative;
        justify-content: space-between;
        height: 0;
        max-width: 1404px;
        margin: 0 auto;
        padding: var(--gap--12);
        background-color: #3B3B53;
        opacity: 0;
        box-shadow: 0 0 1px rgba(0,0,0,.8);
        pointer-events: none;
        overflow: hidden;
    
        .theme-2020 & {
          background-color: var(--color--neutrals-8);
        }
      }
    
      .megaMenu:hover & {
        @media (min-width: 1024px) {
          transition: height 0s, opacity 300ms;
          height: auto;
          opacity: 1;
          pointer-events: all;
        }
      }
    }
    
    .megaMenu__links {
      flex: 0 0 100%;
      margin: var(--gap--4) 0;
      border-left: 1px solid #A7A9AC;
    
      @media (min-width: 1024px) {
        display: flex;
        flex: 0 0 100%;
        margin: 0 0 82px;
        border-left: none;
      }
    
      @media (min-width: 1140px) {
        flex: 0 0 70%;
      }
    
      .theme-2020 & {
        border-left: none;
      }
    }
    
    .megaMenu__list {
      display: block;
      margin: 0;
      padding: 0;
      list-style-type: none;
    
      @media (min-width: 1024px) {
        position: relative;
        flex: 0 1 33.33333%;
        padding-right: var(--gap--12);
      }
    }
    
    .megaMenu__list:after {
      @media (min-width: 1024px) {
        position: absolute;
        top: 0;
        right: var(--gap--8);
        bottom: 0;
        display: block;
        width: 1px;
        background-color: rgba(167,169,172,.5);
        content: '';
      }
    }
    
    .megaMenu__list:last-child:after {
      display: none;
    }
    
    .megaMenu__item {
      display: block;
      margin-top: var(--gap--8);
      break-inside: avoid;
    
      @media (min-width: 1024px) {
        margin-top: var(--gap--1);
      }
    
      .megaMenu__list:first-child &:first-child {
        margin-top: 0;
      }
    
      &:first-child {
        @media (min-width: 1024px) {
          margin-top: 0;
        }
      }
    }
    
    .megaMenu__link {
      transition: color 150ms;
      display: flex;
      align-items: center;
      width: 100%;
      height: 40px;
      padding-left: var(--gap--4);
      color: #A7A9AC;
      font-weight: 500;
      line-height: 1;
      text-decoration: none;
      pointer-events: all;
    
      @media (min-width: 1024px) {
        padding-left: 0;
      }
    
      &:hover,
      &:active,
      &:focus {
        color: #FFF;
      }
    
      .theme-2020 & {
        height: auto;
        min-height: 30px;
        padding-left: 0;
        line-height: 1.3;
      }
    }
    
    .megaMenu__link__icon {
      display: flex;
      flex: 0 0 40px;
      align-items: center;
      width: 40px;
      height: 40px;
      margin-right: var(--gap--2);
      padding: 5px;
    
      /*.theme-2020 & {
        // display: none;
      }*/
    }
    
    .megaMenu__cta {
      flex: 0 0 100%;
      margin-top: var(--gap--4);
    
      @media (min-width: 1024px) {
        position: absolute;
        bottom: var(--gap--12);
        left: var(--gap--12);
        min-width: 200px;
      }
    }
    
    .megaMenu__aside {
      flex: 0 0 100%;
      margin-top: var(--gap--4);
    
      @media (min-width: 1024px) {
        display: flex;
        flex: 0 0 100%;
        justify-content: flex-end;
        margin-top: 30px;
      }
    
      @media (min-width: 1140px) {
        flex: 0 0 30%;
      }
    }
    
    .megaMenu__aside__inner {
      @media (min-width: 1024px) {
        display: block;
        flex: 1 1 auto;
        width: 100%;
        max-width: 310px;
        padding: 0 var(--gap--12);
      }
    }
    
    .megaMenu__banner {
      position: relative;
      display: block;
      width: 100%;
      height: 0;
      padding-top: 36%;
    
      @media (min-width: 1024px) {
        padding-top: 64.51613%;
      }
    }
    
    .megaMenu__banner__visual {
      position: absolute;
      top: 0;
      left: 0;
      display: block;
      width: 100%;
      height: 100%;
      background: #2A2937 url('') no-repeat center/cover;
    
      .theme-2020 & {
        background-color: var(--color--neutrals-8);
      }
    }
    
    .megaMenu__banner__content {
      display: none;
    
      @media (min-width: 1024px) {
        position: absolute;
        bottom: 0;
        left: 0;
        display: block;
        width: 80%;
        padding: var(--gap--4);
        color: #FFF;
      }
    }
    
    .megaMenu__banner__title {
      display: block;
      width: 100%;
      margin: 0;
      padding: 0;
      font-size: 18px;
      line-height: 1;
    }
    
    .megaMenu__banner__desc p {
      margin: var(--gap--2) 0 0;
      padding: 0;
      font-size: 12px;
      line-height: 1.2;
    }
    
    .megaMenu__banner__icon {
      position: absolute;
      right: 0;
      bottom: 0;
      height: 30px;
    }
    
    // client requested code
    .megaMenu_btnlist {
      display: flex;
      text-align: center;
    }
    
    .megaMenu_btn {
      margin-right: var(--gap--8);
    }
    
    /* Responsive layout - makes a one column-layout instead of a row */
    @media (max-width: 800px) {
      .megaMenu_btnlist {
        flex-direction: column;
      }
    
      .megaMenu_btn {
        margin-bottom: var(--gap--8);
      }
    }
    
  • URL: /components/raw/mega-menu/mega-menu.scss
  • Filesystem Path: ../src/03_molecules/mega-menu/mega-menu.scss
  • Size: 6.4 KB

No notes defined.