<section class="container large-signpost-carousel ">
    <div class="container__content">
        <div class="carousel-container">
            <div class="carousel" data-behavior="large-signpost-carousel">
                <div data-glide-el="track">
                    <ul class="glide__slides">
                        <li>
                            <a class="large-signpost-carousel__slide" href="#" tabindex="0">
                                <img class="large-signpost-carousel__img" src="/assets/example-content/large-signpost-carousel-1.png" alt="">
                                <div class="large-signpost-carousel--gradient"></div>
                                <div class="large-signpost-carousel__overlay">
                                    <div class="large-signpost-carousel__titleblock">
                                        <div class="large-signpost-carousel__totalslides--count"></div>
                                        <h3 class="large-signpost-carousel__title">pickford to the RESCUE</h3>
                                    </div>
                                    <div class="large-signpost-carousel__tag">
                                        <p>11 Oct 2020 <span>|</span> 5 min read</p>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a class="large-signpost-carousel__slide" href="#" tabindex="0">
                                <img class="large-signpost-carousel__img" src="/assets/example-content/large-signpost-carousel-2.png" alt="">
                                <div class="large-signpost-carousel--gradient"></div>
                                <div class="large-signpost-carousel__overlay">
                                    <div class="large-signpost-carousel__titleblock">
                                        <div class="large-signpost-carousel__totalslides--count"></div>
                                        <h3 class="large-signpost-carousel__title">lioness roar into the final</h3>
                                    </div>
                                    <div class="large-signpost-carousel__tag">
                                        <p>11 Oct 2020 <span>|</span> 5 min read</p>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a class="large-signpost-carousel__slide" href="#" tabindex="0">
                                <img class="large-signpost-carousel__img" src="/assets/example-content/large-signpost-carousel-3.png" alt="">
                                <div class="large-signpost-carousel--gradient"></div>
                                <div class="large-signpost-carousel__overlay">
                                    <div class="large-signpost-carousel__titleblock">
                                        <div class="large-signpost-carousel__totalslides--count"></div>
                                        <h3 class="large-signpost-carousel__title">&#x27;PLAYING AS A KID WERE THE BEST TIMES OF MY LIFE’</h3>
                                    </div>
                                    <div class="large-signpost-carousel__tag">
                                        <p>11 Oct 2020 <span>|</span> 5 min read</p>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a class="large-signpost-carousel__slide" href="#" tabindex="0">
                                <img class="large-signpost-carousel__img" src="/assets/example-content/large-signpost-carousel-2.png" alt="">
                                <div class="large-signpost-carousel--gradient"></div>
                                <div class="large-signpost-carousel__overlay">
                                    <div class="large-signpost-carousel__titleblock">
                                        <div class="large-signpost-carousel__totalslides--count"></div>
                                        <h3 class="large-signpost-carousel__title">lioness roar into the final</h3>
                                    </div>
                                    <div class="large-signpost-carousel__tag">
                                        <p>11 Oct 2020 <span>|</span> 5 min read</p>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a class="large-signpost-carousel__slide" href="#" tabindex="0">
                                <img class="large-signpost-carousel__img" src="/assets/example-content/large-signpost-carousel-1.png" alt="">
                                <div class="large-signpost-carousel--gradient"></div>
                                <div class="large-signpost-carousel__overlay">
                                    <div class="large-signpost-carousel__titleblock">
                                        <div class="large-signpost-carousel__totalslides--count"></div>
                                        <h3 class="large-signpost-carousel__title">pickford to the RESCUE</h3>
                                    </div>
                                    <div class="large-signpost-carousel__tag">
                                        <p>11 Oct 2020 <span>|</span> 5 min read</p>
                                    </div>
                                </div>
                            </a>
                        </li>
                        <li>
                            <a class="large-signpost-carousel__slide" href="#" tabindex="0">
                                <img class="large-signpost-carousel__img" src="/assets/example-content/large-signpost-carousel-3.png" alt="">
                                <div class="large-signpost-carousel--gradient"></div>
                                <div class="large-signpost-carousel__overlay">
                                    <div class="large-signpost-carousel__titleblock">
                                        <div class="large-signpost-carousel__totalslides--count"></div>
                                        <h3 class="large-signpost-carousel__title">&#x27;PLAYING AS A KID WERE THE BEST TIMES OF MY LIFE’</h3>
                                    </div>
                                    <div class="large-signpost-carousel__tag">
                                        <p>11 Oct 2020 <span>|</span> 5 min read</p>
                                    </div>
                                </div>
                            </a>
                        </li>
                    </ul>
                    <div class="large-signpost-carousel__navigation" data-glide-el="controls">
                        <button aria-label="Previous" class="large-signpost-carousel__cta large-signpost-carousel__cta--prev" data-glide-dir="<"><span class="visually-hidden">Previous
                                page</span><svg width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M18.0002 8.00034L3.90024 8.00034L8.20056 12.2997L6.79995 13.7003L0.100587 6.99999L6.79995 0.299672L8.20056 1.70029L3.90024 5.99965L18.0002 5.99965L18.0002 8.00034Z" fill="currentColor" />
                            </svg></button>
                        <button aria-label="Next" class="large-signpost-carousel__cta large-signpost-carousel__cta--next" data-glide-dir=">"><span class="visually-hidden">Next
                                page</span><svg width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M-0.000240326 5.99966H14.0998L9.79944 1.7003L11.2001 0.299683L17.8994 7L11.2001 13.7003L9.79944 12.2997L14.0998 8.00035H-0.000240326V5.99966Z" fill="currentColor" />
                            </svg></button>
                    </div>
                    <div class="large-signpost-carousel__playpause">
                        <button aria-label="Play" class="large-signpost-carousel__cta large-signpost-carousel__cta--play hidden"><span class="visually-hidden">Play</span><svg width="16" height="19" viewBox="0 0 16 19" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <path d="M0.666504 16.6252C0.701482 18.3155 2.28225 19.3378 3.66658 18.5336L14.8019 11.6143C15.4086 11.238 15.8203 10.5456 15.8203 9.73584C15.8203 8.92613 15.4086 8.23364 14.8019 7.85742L3.66658 0.94752C2.28225 0.143256 0.701461 1.15608 0.666504 2.84639V16.6252Z" fill="currentColor" />
                            </svg></button>
                        <button aria-label="Pause" class="large-signpost-carousel__cta large-signpost-carousel__cta--pause"><span class="visually-hidden">Pause</span><svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg">
                                <rect x="0.666504" y="0.333313" width="4" height="17.3333" fill="currentColor" />
                                <rect x="6.666504" y="0.333313" width="4" height="17.3333" fill="currentColor" />
                            </svg></button>
                    </div>
                    <div class="carousel-nav-block">
                        <div class="carousel-nav-wrapper">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

No notes defined.

{
  "article": [
    {
      "image": "/assets/example-content/large-signpost-carousel-1.png",
      "caption": "pickford to the RESCUE",
      "totalslide": true
    },
    {
      "image": "/assets/example-content/large-signpost-carousel-2.png",
      "caption": "lioness roar into the final",
      "totalslide": true
    },
    {
      "image": "/assets/example-content/large-signpost-carousel-3.png",
      "caption": "'PLAYING AS A KID WERE THE BEST TIMES OF MY LIFE’",
      "totalslide": true
    },
    {
      "image": "/assets/example-content/large-signpost-carousel-2.png",
      "caption": "lioness roar into the final",
      "totalslide": true
    },
    {
      "image": "/assets/example-content/large-signpost-carousel-1.png",
      "caption": "pickford to the RESCUE",
      "totalslide": true
    },
    {
      "image": "/assets/example-content/large-signpost-carousel-3.png",
      "caption": "'PLAYING AS A KID WERE THE BEST TIMES OF MY LIFE’",
      "totalslide": true
    }
  ]
}
  • Content:
    import debounce from 'lodash.debounce';
    import Glide from '@glidejs/glide';
    
    export default ({
      largeSignpostCarouselElement,
      responsive = [],
      ...options
    }) => {
      const slides = largeSignpostCarouselElement.querySelectorAll(
        '.glide__slides > li'
      );
      // let glide = '';
      let transformCount = 0;
      const breakpointSettings = {
        500: {
          perView: 1,
        },
        954: {
          perView: 1,
        },
        1200: {
          perView: 1,
        },
        ...responsive,
      };
    
      const getCurrentSettings = () => {
        const screenWidth = window.innerWidth;
    
        // Because the `perView` changes at different breakpoints, find
        // the relevant setting for the current screensize.
        // Filter out any settings that are smaller than the current size, and
        // then use the first in the list, as this will be the most relevant.
        // If none are available, assume we are using the biggest setting.
    
        // TODO: We should be able to reuse this, if we want to change the pagination
        // to scroll full pages, rather than individual items
        const breakpointSettingsForCurrentSize =
          Object.keys(breakpointSettings).filter(
            i => parseInt(i, 10) > screenWidth
          )[0] || Object.keys(breakpointSettings).slice(-1);
    
        return breakpointSettings[breakpointSettingsForCurrentSize];
      };
    
      const updateBulletSize = (dot, action) => {
        if (action === 'add') {
          largeSignpostCarouselElement
            .querySelector(
              `.glide-carousel__pagination > [data-glide-dir='=${dot}']`
            )
            .classList.add('small');
        } else {
          largeSignpostCarouselElement
            .querySelector(
              `.glide-carousel__pagination > [data-glide-dir='=${dot}']`
            )
            .classList.remove('small');
        }
      };
    
      const setBulletDefaultSize = () => {
        const maxDots = 5;
        const totalCount = slides.length;
        const navigationElements = largeSignpostCarouselElement.querySelectorAll(
          `.glide-carousel__pagination > [data-glide-dir]`
        );
    
        if (totalCount > maxDots) {
          navigationElements.forEach(item => {
            item.classList.remove('small');
          });
          transformCount = 0;
          // eslint-disable-next-line no-param-reassign
          largeSignpostCarouselElement.querySelector(
            '.glide-carousel__pagination'
          ).style.transform = 'translateX(0)';
          updateBulletSize(4, 'add');
        }
      };
    
      const setBulletSize = (currentSlide, nextSlide) => {
        const maxDots = 5;
        const transformXIntervalNext = -24;
        const transformXIntervalPrev = 24;
        const totalCount = slides.length;
    
        if (totalCount > maxDots) {
          if (nextSlide > currentSlide) {
            if (
              largeSignpostCarouselElement
                .querySelector(
                  `.glide-carousel__pagination > [data-glide-dir='=${nextSlide}']`
                )
                .classList.contains('small')
            ) {
              if (
                !largeSignpostCarouselElement
                  .querySelector(
                    `.glide-carousel__pagination > [data-glide-dir]:last-child`
                  )
                  .classList.contains('small')
              ) {
                // eslint-disable-next-line operator-assignment
                transformCount = transformCount + transformXIntervalNext;
                updateBulletSize(nextSlide, 'remove');
                const nextSlidePlusOne = nextSlide + 1;
    
                updateBulletSize(nextSlidePlusOne, 'add');
                // eslint-disable-next-line no-param-reassign
                largeSignpostCarouselElement.querySelector(
                  '.glide-carousel__pagination'
                ).style.transform = `translateX(${transformCount}px)`;
                const pPointer = nextSlide - 3;
                const pPointerMinusOne = pPointer - 1;
    
                updateBulletSize(pPointerMinusOne, 'remove');
                updateBulletSize(pPointer, 'add');
              }
            } else {
              // eslint-disable-next-line no-lonely-if
              if (nextSlide === slides.length - 1) {
                const navigationElements = largeSignpostCarouselElement.querySelectorAll(
                  `.glide-carousel__pagination > [data-glide-dir]`
                );
    
                navigationElements.forEach(item => {
                  item.classList.remove('small');
                });
                updateBulletSize(slides.length - 5, 'add');
                transformCount = (slides.length - 5) * transformXIntervalNext;
                // eslint-disable-next-line no-param-reassign
                largeSignpostCarouselElement.querySelector(
                  '.glide-carousel__pagination'
                ).style.transform = `translateX(${transformCount}px)`;
              }
            }
          } else {
            // eslint-disable-next-line no-lonely-if
            if (
              largeSignpostCarouselElement
                .querySelector(
                  `.glide-carousel__pagination > [data-glide-dir='=${nextSlide}']`
                )
                .classList.contains('small')
            ) {
              if (
                !largeSignpostCarouselElement
                  .querySelector(
                    `.glide-carousel__pagination > [data-glide-dir]:first-child`
                  )
                  .classList.contains('small')
              ) {
                // eslint-disable-next-line operator-assignment
                transformCount = transformCount + transformXIntervalPrev;
                updateBulletSize(nextSlide, 'remove');
                const nextSlidePlusOne = nextSlide - 1;
    
                updateBulletSize(nextSlidePlusOne, 'add');
                // eslint-disable-next-line no-param-reassign
                largeSignpostCarouselElement.querySelector(
                  '.glide-carousel__pagination'
                ).style.transform = `translateX(${transformCount}px)`;
                const nPointer = currentSlide + 3;
                const nPointerMinusOne = nPointer - 1;
    
                // console.log(`${nPointer} - ${nPointerMinusOne}`);
                updateBulletSize(nPointer, 'remove');
                updateBulletSize(nPointerMinusOne, 'add');
              }
            } else {
              // eslint-disable-next-line no-lonely-if
              if (nextSlide === 0) {
                setBulletDefaultSize();
              }
            }
          }
        }
      };
    
      const setSlideCount = currentIndex => {
        const slideCountBlock = largeSignpostCarouselElement.querySelector(
          `li:nth-child(${currentIndex +
            1}) .large-signpost-carousel__totalslides--count`
        );
    
        slideCountBlock.innerHTML = `${currentIndex + 1} / ${slides.length}`;
      };
    
      const showPaginationByPage = () => {
        // Glide shows a pagination button for each item, and doesn't provide
        // an option to navigate whole pages at a time.
        // This function hides extra individual dots, so that only the first item of
        // each page is shown. (Based on the `perView` setting).
        const { perView } = getCurrentSettings();
    
        const paginationElements = largeSignpostCarouselElement.querySelectorAll(
          `.glide-carousel__pagination button:not(:nth-child(${perView}n + 1))`
        );
    
        paginationElements.forEach(item => {
          item.classList.add('hidden');
        });
    
        setSlideCount(0);
        setBulletDefaultSize();
      };
    
      const showHideNavigation = () => {
        const maxPerView = getCurrentSettings().perView;
        const navigationElements = largeSignpostCarouselElement.querySelectorAll(
          '[data-glide-dir]'
        );
    
        if (!slides || slides.length <= maxPerView) {
          navigationElements.forEach(item => item.classList.add('hidden'));
          // eslint-disable-next-line no-param-reassign
          largeSignpostCarouselElement.querySelector(
            '.image-gallery__navigation'
          ).style.display = 'none';
          // eslint-disable-next-line no-param-reassign
          largeSignpostCarouselElement.querySelector(
            '.image-gallery__totalslides'
          ).style.display = 'none';
          largeSignpostCarouselElement
            .querySelector('.glide__slides')
            .classList.add('singleslide');
          return;
        }
        navigationElements.forEach(item => item.classList.remove('hidden'));
    
        showPaginationByPage();
      };
    
      const addRemoveFocusEvent = (eventObj, action) => {
        if (action === 'focus') {
          eventObj.forEach(element => {
            element.addEventListener('focus', () => {
              largeSignpostCarouselElement
                .querySelector('.large-signpost-carousel__navigation')
                .classList.add('active');
              largeSignpostCarouselElement
                .querySelector('.large-signpost-carousel__playpause')
                .classList.add('active');
            });
          });
        } else {
          eventObj.forEach(element => {
            element.addEventListener('focusout', () => {
              largeSignpostCarouselElement
                .querySelector('.large-signpost-carousel__navigation')
                .classList.remove('active');
              largeSignpostCarouselElement
                .querySelector('.large-signpost-carousel__playpause')
                .classList.remove('active');
            });
          });
        }
      };
    
      const createPagination = () => {
        const bulletContainer = document.createElement('div');
    
        bulletContainer.classList.add('glide-carousel__pagination');
        bulletContainer.dataset.glideEl = 'controls[nav]';
    
        slides.forEach((slide, index) => {
          const button = document.createElement('button');
    
          button.dataset.glideDir = `=${index}`;
          button.tabIndex = '-1';
          bulletContainer.appendChild(button);
    
          addRemoveFocusEvent([slide.querySelector('a')], 'focus');
          addRemoveFocusEvent([slide.querySelector('a')], 'focusout');
        });
    
        largeSignpostCarouselElement
          .querySelector('.carousel-nav-wrapper')
          .appendChild(bulletContainer);
        showHideNavigation();
      };
    
      createPagination();
    
      window.addEventListener(
        'resize',
        debounce(() => {
          // Hide the navigation when we don't have more items than we can show on screen
          showHideNavigation();
        }, 250)
      );
    
      const glide = new Glide(largeSignpostCarouselElement, {
        perView: 1,
        autoplay: 10000,
        animationTimingFunc: 'ease-out',
        breakpoints: breakpointSettings,
        ...options,
      });
    
      const playBtn = largeSignpostCarouselElement.querySelector(
        '.large-signpost-carousel__cta--play'
      );
      const pauseBtn = largeSignpostCarouselElement.querySelector(
        '.large-signpost-carousel__cta--pause'
      );
      const prevBtn = largeSignpostCarouselElement.querySelector(
        '.large-signpost-carousel__cta--prev'
      );
      const nextBtn = largeSignpostCarouselElement.querySelector(
        '.large-signpost-carousel__cta--next'
      );
    
      glide.mount();
    
      glide.on('run', () => {
        const currentSlide = largeSignpostCarouselElement
          .querySelector(
            '.glide-carousel__pagination > [data-glide-dir].glide__bullet--active'
          )
          .getAttribute('data-glide-dir')
          .substr(1);
        const nextSlide = glide.index;
    
        // console.log(`${currentSlide} - ${nextSlide}`);
        // eslint-disable-next-line radix
        setBulletSize(parseInt(currentSlide), nextSlide);
        setSlideCount(nextSlide);
        updateBulletSize(nextSlide, 'remove');
      });
      playBtn.addEventListener('click', () => {
        // console.log('play');
        glide.play(10000);
        pauseBtn.classList.remove('hidden');
        playBtn.classList.add('hidden');
      });
    
      pauseBtn.addEventListener('click', () => {
        // console.log(glide.pause);
        glide.update({ autoplay: false });
        glide.pause();
        pauseBtn.classList.add('hidden');
        playBtn.classList.remove('hidden');
      });
    
      const focusElements = [playBtn, pauseBtn, prevBtn, nextBtn];
    
      addRemoveFocusEvent(focusElements, 'focus');
      addRemoveFocusEvent(focusElements, 'focusout');
      return glide;
    };
    
  • URL: /components/raw/large-signpost-carousel/large-signpost-carousel.js
  • Filesystem Path: src/library/components/large-signpost-carousel/large-signpost-carousel.js
  • Size: 11.5 KB
  • Content:
    .large-signpost-carousel {
      &.container {
        width: 100%;
        max-width: 100%;
        .container__content {
          padding-left: 0;
          padding-right: 0;
        }
      }
      .carousel-container {
        max-width: 100%;
      }
      [data-glide-el='track'] {
        position: relative;
      }
      [data-behavior='large-signpost-carousel'] {
        border-radius: 0.4rem;
        overflow: hidden;
      }
      .glide__slides > li {
        position: relative;
        overflow: hidden;
        flex-direction: column;
      }
      &__slide {
        position: relative;
        border-radius: 0.8rem;
        display: block;
        text-decoration: none;
        cursor: pointer;
        overflow: hidden;
      }
      &__img {
        object-fit: cover;
        object-position: center;
        width: 100%;
        height: 480px;
        max-height: 480px;
        border-radius: 0.8rem;
        transition: transform 0.3s ease-in-out;
      }
    
      &--gradient {
        background: linear-gradient(
          180deg,
          rgba(var(--brand-primary-rgb), 0) 52.02%,
          rgba(var(--brand-primary-rgb), 0.14) 71.6%,
          var(--brand-primary) 94.79%
        );
        content: '';
        display: block;
        height: 61.1rem;
        bottom: 0;
        width: 100%;
        position: absolute;
        border-radius: 0 0 0.8rem 0.8rem;
      }
      &__titleblock {
        position: inherit;
        bottom: 76px;
        overflow: hidden;
        width: 100%;
      }
      &__totalslides--count {
        @extend .heading-4;
    
        color: $white;
        padding: 0 34px 0 35px;
        width: 100%;
        margin-bottom: 0.2rem;
        text-align: center;
        transition: transform 1s ease-in;
        transform: translateX(100%);
      }
    
      &__title {
        @extend .heading-1;
    
        color: $white;
        letter-spacing: 0.02em;
        z-index: 2;
        width: 100%;
        padding: 0 34px 0 35px;
        white-space: pre-wrap;
        text-align: center;
        transition: transform 1s ease-in;
        transform: translateX(100%);
      }
      .glide__slide--active {
        .large-signpost-carousel__totalslides--count {
          transform: translateX(0);
        }
        .large-signpost-carousel__title {
          transform: translateX(0);
        }
      }
      &__tag {
        position: inherit;
        bottom: 4rem;
        z-index: 2;
        width: 100%;
      }
      &__tag p {
        @include text-s;
    
        color: $white;
        text-align: center;
    
        span {
          margin: 0 8px 0 18px;
          &::after {
            content: '';
            background: url('./assets/images/clock-icon-white.svg') no-repeat center;
            height: 1.4rem;
            width: 1.4rem;
            position: relative;
            display: inline-block;
            top: 0.2rem;
            margin-left: 1.8rem;
          }
        }
      }
    
      &__overlay {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        display: flex;
        flex-direction: column;
        &::before {
          content: '';
          background: linear-gradient(
            180deg,
            rgba(34, 34, 34, 0) 38.98%,
            rgba(34, 34, 34, 0.315) 100%
          );
          width: 100%;
          height: 100%;
          display: block;
        }
      }
      .carousel-nav-block {
        position: absolute;
        z-index: 1;
        bottom: 16px;
        display: flex;
        justify-content: center;
        width: 100%;
        padding-bottom: 0;
        .carousel__pagination {
          button.glide__bullet--active {
            background-color: $white;
          }
          button:not(.active):not(.glide__bullet--active) {
            background-color: $light-blue;
          }
        }
    
        .glide-carousel__pagination {
          button.glide__bullet--active {
            background-color: $white;
          }
          button:not(.active):not(.glide__bullet--active) {
            background-color: $light-blue;
          }
        }
      }
      &__cta {
        align-items: center;
        appearance: none;
        background-color: $grey;
        border: none;
        color: #fff;
        display: flex;
        height: 0.8rem;
        justify-content: center;
        transition: background-color 0.3s ease-in;
        width: 0.8rem;
        white-space: nowrap;
        svg {
          width: 1.3rem;
          height: 2.3rem;
        }
    
        &--prev {
          position: absolute;
          left: 0;
          transform: rotate(180deg) translateX(48px);
          width: 4.8rem !important;
          height: 4.8rem !important;
          background-color: $bold-red !important;
          color: $white !important;
          cursor: pointer;
          transition: transform 0.3s ease-in-out;
          svg {
            position: inherit;
            transform: rotate(180deg);
          }
          &:hover {
            background-color: $white !important;
            color: $bold-red !important;
          }
        }
        &--next {
          position: absolute;
          right: 0;
          width: 4.8rem !important;
          height: 4.8rem !important;
          background-color: $bold-red !important;
          color: $white !important;
          cursor: pointer;
          transform: translateX(48px);
          transition: transform 0.3s ease-in-out;
          svg {
            position: inherit;
          }
          &:hover {
            background-color: $white !important;
            color: $bold-red !important;
          }
        }
        &--play {
          position: absolute;
          right: 0;
          width: 4.8rem !important;
          height: 4.8rem !important;
          background-color: $bold-red !important;
          color: $white !important;
          border-radius: 0 0.4rem 0 0;
          cursor: pointer;
          transform: translateY(-48px);
          transition: transform 0.3s ease-in-out;
          svg {
            position: inherit;
          }
          &:hover {
            background-color: $white !important;
            color: $bold-red !important;
          }
          &.hidden {
            display: none;
          }
        }
        &--pause {
          position: absolute;
          right: 0;
          width: 4.8rem !important;
          height: 4.8rem !important;
          background-color: $bold-red !important;
          color: $white !important;
          border-radius: 0 0.4rem 0 0;
          cursor: pointer;
          transform: translateY(-48px);
          transition: transform 0.3s ease-in-out;
          svg {
            position: inherit;
          }
          &:hover {
            background-color: $white !important;
            color: $bold-red !important;
          }
          &.hidden {
            display: none;
          }
        }
      }
      &__navigation {
        position: absolute;
        top: calc(50% - 24px);
        width: 100%;
        left: 0;
        right: 0;
        margin: 0 auto;
        display: none;
      }
      &__playpause {
        position: absolute;
        top: 0;
        right: 0;
        bottom: initial;
      }
      .carousel-nav-wrapper {
        width: 11.5rem;
        overflow: hidden;
      }
      &.full-width {
        [data-behavior='large-signpost-carousel'] {
          border-radius: 0;
        }
        .large-signpost-carousel {
          border-radius: 0;
        }
        .large-signpost-carousel__slide {
          border-radius: 0;
        }
        .large-signpost-carousel__img {
          border-radius: 0;
        }
        .large-signpost-carousel--gradient {
          border-radius: 0;
        }
        .large-signpost-carousel__cta--play,
        .large-signpost-carousel__cta--pause {
          border-radius: 0;
        }
      }
      [data-glide-el='track']:hover,
      [data-glide-el='track']:focus {
        .large-signpost-carousel__cta--prev {
          transform: rotate(180deg) translateX(0);
        }
        .large-signpost-carousel__cta--next {
          transform: translateX(0);
        }
        .large-signpost-carousel__cta--play,
        .large-signpost-carousel__cta--pause {
          transform: translateY(0);
        }
      }
    
      @media screen and (min-width: $mq-medium) {
        [data-behavior='large-signpost-carousel'] {
          border-radius: 0.8rem;
        }
        .carousel-nav-block {
          bottom: 36px;
        }
        &__img {
          height: 100%;
        }
        &__titleblock {
          width: auto;
        }
        &__totalslides--count {
          width: 760px;
          margin-left: 80px;
          margin-bottom: 0.8rem;
          text-align: left;
          padding-left: 0;
          padding-right: 0;
        }
        &__title {
          margin-left: 80px;
          width: 760px;
          bottom: 92px;
          white-space: pre-wrap;
          padding-left: 0;
          padding-right: 0;
          text-align: left;
          padding-bottom: 1rem;
        }
        &__tag {
          width: 760px;
          bottom: 3.6rem;
        }
        &__tag p {
          margin-left: 80px;
          text-align: left;
        }
        &__cta {
          &--play,
          &--pause {
            border-radius: 0 0 0.4rem 0;
            transform: translateY(48px);
          }
        }
        &.full-width {
          height: 52rem;
          max-height: 52rem;
          .large-signpost-carousel__cta--play,
          .large-signpost-carousel__cta--pause {
            border-radius: 0;
          }
          .large-signpost-carousel__img {
            height: 52rem;
            max-height: 52rem;
          }
        }
        &__navigation {
          display: block;
        }
        &__playpause {
          bottom: 4.8rem;
          right: 0;
          top: initial;
        }
        [data-glide-el='track']:hover,
        [data-glide-el='track']:focus {
          .large-signpost-carousel__cta--play,
          .large-signpost-carousel__cta--pause {
            transform: translateY(0);
          }
          .glide__slide--active {
            .large-signpost-carousel__img {
              transform: scale(1.1);
            }
          }
        }
      }
    }
    
    :root [data-brand=''] {
      .large-signpost-carousel {
        &--gradient {
          background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, #000 100%);
          opacity: 0.8;
        }
        &__overlay {
          &::before {
            display: none;
          }
        }
    
        @media screen and (max-width: $mq-medium) {
          &--gradient {
            height: 22.6rem;
            top: initial;
            bottom: 0;
          }
        }
      }
    }
    
  • URL: /components/raw/large-signpost-carousel/large-signpost-carousel.scss
  • Filesystem Path: src/library/components/large-signpost-carousel/large-signpost-carousel.scss
  • Size: 9.1 KB
<section class="container large-signpost-carousel {{extra-class}}">
  <div class="container__content">
    <div class="carousel-container">
      <div class="carousel" data-behavior="large-signpost-carousel">        
        <div data-glide-el="track"> 
          <ul class="glide__slides">
            {{#each article}}
            <li>
                <a class="large-signpost-carousel__slide" href="#" tabindex="0">
                  <img class="large-signpost-carousel__img" src="{{image}}" alt="">
                  <div class="large-signpost-carousel--gradient"></div>
                  <div class="large-signpost-carousel__overlay">
                    <div class="large-signpost-carousel__titleblock">
                      <div class="large-signpost-carousel__totalslides--count"></div>
                      <h3 class="large-signpost-carousel__title">{{caption}}</h3>
                    </div>
                    <div class="large-signpost-carousel__tag">
                      <p>11 Oct 2020 <span>|</span>  5 min read</p>
                    </div>
                  </div>
                </a>
            </li>
            {{/each}}
          </ul>
          <div class="large-signpost-carousel__navigation" data-glide-el="controls">
            <button aria-label="Previous" class="large-signpost-carousel__cta large-signpost-carousel__cta--prev" data-glide-dir="<"><span
                class="visually-hidden">Previous
                page</span><svg width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M18.0002 8.00034L3.90024 8.00034L8.20056 12.2997L6.79995 13.7003L0.100587 6.99999L6.79995 0.299672L8.20056 1.70029L3.90024 5.99965L18.0002 5.99965L18.0002 8.00034Z"
                fill="currentColor"/>
                </svg></button>
            <button aria-label="Next" class="large-signpost-carousel__cta large-signpost-carousel__cta--next" data-glide-dir=">"><span
                class="visually-hidden">Next
                page</span><svg width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M-0.000240326 5.99966H14.0998L9.79944 1.7003L11.2001 0.299683L17.8994 7L11.2001 13.7003L9.79944 12.2997L14.0998 8.00035H-0.000240326V5.99966Z" 
                fill="currentColor"/>
                </svg></button>
          </div>
          <div class="large-signpost-carousel__playpause">
              <button aria-label="Play" class="large-signpost-carousel__cta large-signpost-carousel__cta--play hidden"><span
                class="visually-hidden">Play</span><svg width="16" height="19" viewBox="0 0 16 19" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M0.666504 16.6252C0.701482 18.3155 2.28225 19.3378 3.66658 18.5336L14.8019 11.6143C15.4086 11.238 15.8203 10.5456 15.8203 9.73584C15.8203 8.92613 15.4086 8.23364 14.8019 7.85742L3.66658 0.94752C2.28225 0.143256 0.701461 1.15608 0.666504 2.84639V16.6252Z"
                fill="currentColor"/>
                </svg></button>
              <button aria-label="Pause" class="large-signpost-carousel__cta large-signpost-carousel__cta--pause"><span
                class="visually-hidden">Pause</span><svg width="12" height="18" viewBox="0 0 12 18" fill="none" xmlns="http://www.w3.org/2000/svg">
                <rect x="0.666504" y="0.333313" width="4" height="17.3333" fill="currentColor"/>
                <rect x="6.666504" y="0.333313" width="4" height="17.3333" fill="currentColor"/>
                </svg></button>
          </div>
          <div class="carousel-nav-block">
            <div class="carousel-nav-wrapper">            
            </div>
          </div>
        </div>    
      </div>
    </div>
  </div>
</section>