<div class="horizontal-timeline">
    <div class="horizontal-timeline__bg" style="background-image: url(/img/placeimg_1000_650_people.jpg)"></div>
    <h2>What to expect when you apply...</h2>
    <div class="timeline-slider">
        <div class="timeline-slider__carousel">
            <div class="slide">
                <div class="timeline-pod ">

                    <div class="timeline-pod__title">
                        <div class="title">2015</div>
                    </div>
                    <div class="progress-bar"></div>
                    <div class="active-dot"><span></span></div>
                    <div class="timeline-pod__content">
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt..</p>
                    </div>
                </div>
            </div>
            <div class="slide">
                <div class="timeline-pod ">

                    <div class="timeline-pod__title">
                        <div class="title">2016</div>
                    </div>
                    <div class="progress-bar"></div>
                    <div class="active-dot"><span></span></div>
                    <div class="timeline-pod__content">
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, ed do eiusmod tempor incididunt.</p>
                        <br>
                        <a href="#modal-timeline-2" data-modal-open class="timeline-pod__read-more cta cta--link">
                              <span class="cta__label">Read more
                                  <svg data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                                    <path d="M14.54 7.63l-1.5 1.13.67 2.21H5.18v2h8.53l-.67 2.2 1.5 1.13 5.32-3.5v-1.67l-5.32-3.5z"/>
                                  </svg>
                              </span>
                            </a>

                        <div id="modal-timeline-2" class="modal-hider timeline-pod__popup">
                            <p style="text-align: center;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, ed do eiusmod tempor incididunt.</p>
                            <p style="text-align: center;"><a href="#" class="cta cta--primary"><span class="cta__label">Really?<svg data-name="Calque 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.54 7.63l-1.5 1.13.67 2.21H5.18v2h8.53l-.67 2.2 1.5 1.13 5.32-3.5v-1.67l-5.32-3.5z"/></svg></span></a></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="slide">
                <div class="timeline-pod ">

                    <div class="timeline-pod__title">
                        <div class="title">2017</div>
                    </div>
                    <div class="progress-bar"></div>
                    <div class="active-dot"><span></span></div>
                    <div class="timeline-pod__content">
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.</p>
                    </div>
                </div>
            </div>
            <div class="slide">
                <div class="timeline-pod ">

                    <div class="timeline-pod__title">
                        <div class="title">2018</div>
                    </div>
                    <div class="progress-bar"></div>
                    <div class="active-dot"><span></span></div>
                    <div class="timeline-pod__content">
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, do eiusmod tempor magna aliqua.</p>
                    </div>
                </div>
            </div>
            <div class="slide">
                <div class="timeline-pod ">

                    <div class="timeline-pod__title">
                        <div class="title">2019</div>
                    </div>
                    <div class="progress-bar"></div>
                    <div class="active-dot"><span></span></div>
                    <div class="timeline-pod__content">
                        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
  • Content:
    /* @horizontal-timeline */
    
    .horizontal-timeline {
      background-color: $astronaut;
      position: relative;
      overflow: hidden;
    
      @include poly-padding--large;
    
      .horizontal-timeline__bg {
        background-size: cover !important;
        background-position: center center !important;
        transition: 0.7s;
        width: 120%;
        height: 120%;
        position: absolute;
        left: 0;
        top: 0;
      }
    
      &::after {
        content: '';
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 100%;
        z-index: 0;
        background-image: linear-gradient(to top, rgba(57, 51, 84, 0.3), #04032a);
      }
    
      h2 {
        color: white;
        font-size: 30px;
        position: relative;
        z-index: 1;
    
        @include poly-margin--large;
    
        @media (min-width: $medium-screen) {
          @include poly-padding-left--large;
        }
      }
    
      .timeline-slider {
        position: relative;
        z-index: 1;
    
        @include poly-margin--large;
    
        &__carousel {
          max-width: 1024px;
          margin: 0 auto;
        }
    
        .flickity-viewport {
          box-sizing: unset;
          background-color: white;
          padding: 0;
          box-shadow: rgba(0, 0, 0, 0.7) 5px 5px 20px;
    
          @media (min-width: $medium-screen) {
            background-color: transparent;
            padding: 20px;
            box-shadow: none;
          }
        }
    
        .slide {
          transition: $transition-basic;
          width: 100%;
          height: 450px;
    
          @media (min-width: $medium-screen) {
            width: 300px;
            height: 637px;
          }
    
          .timeline-pod {
            height: 100%;
            display: flex;
            flex-direction: column;
    
            &__title,
            &__content {
              height: 50%;
              flex-grow: 1;
              display: flex;
              flex-direction: column;
              color: black;
              transition: $transition-basic;
    
              @media (min-width: $medium-screen) {
                color: white;
              }
    
              @include poly-padding--large;
            }
    
            &__read-more {
              margin-left: -1.5rem;
            }
    
            &__image {
              margin: 0.5em 0;
              width: 100%;
              opacity: 0;
              transition: 0.3s;
            }
    
            &__popup {
              visibility: hidden;
            }
    
            &__title {
              flex-direction: column-reverse;
              font-size: 20px;
              font-family: 'Biryani', sans-serif;
              font-weight: 900;
              line-height: 1.2;
    
              img {
                width: 100%;
              }
            }
    
            &__content {
              border-left: 1px solid rgba(255, 255, 255, 0.4);
    
              p {
                font-size: 14px;
              }
            }
    
            &.reverse {
              .timeline-pod__content {
                order: -1;
              }
    
              .timeline-pod__title {
                order: 2;
                align-items: flex-start;
                .title {
                  margin-bottom: auto;
                }
              }
            }
    
            .progress-bar {
              width: 100%;
              height: 3px;
              box-shadow: rgba(255, 255, 255, 0.7) 3px 0 10px;
              background: $blue-ribbon;
              position: relative;
              overflow: hidden;
    
              @media (max-width: $medium-screen) {
                box-shadow: rgba(0, 111, 238, 0.7) 3px 0 10px;
              }
    
              @media (min-width: $medium-screen) {
                background: white;
              }
    
              &::after {
                content: '';
                width: 0;
                height: 100%;
                background-color: $blue-ribbon;
                display: block;
                transition: $transition-basic;
              }
            }
    
            .active-dot {
              width: 40px;
              height: 40px;
              border: 1px solid rgba(0, 111, 238, 0.1);
              border-radius: $border-radius-circle;
              position: absolute;
              top: 50%;
              transform: translate(-50%, -50%);
              transition: $transition-basic;
              z-index: 5;
              opacity: 0;
    
              @include poly-margin-left--large;
    
              &::before {
                content: '';
                width: 24px;
                height: 24px;
                border: 1px solid rgba(0, 111, 238, 0.3);
                border-radius: $border-radius-circle;
                display: block;
                margin-top: 6px;
                margin-left: 6px;
              }
    
              span {
                border: 2px solid $blue-ribbon;
                background-color: white;
                border-radius: $border-radius-circle;
                box-shadow: rgba(0, 111, 238, 0.7) 1px 1px 10px;
                display: block;
                width: 14px;
                height: 14px;
                position: absolute;
                top: 12px;
                left: 12px;
              }
            }
          }
    
          &:first-child {
            .progress-bar {
              @include poly-margin-left--large;
    
              width: calc(100% - #{$small-spacing*2});
    
              @media (min-width: $medium-screen) {
                width: calc(100% - #{$base-spacing*2});
              }
            }
    
            .timeline-pod__content {
              border-left: none;
            }
          }
    
          &:last-child {
            .progress-bar {
              @include poly-margin-right--large;
    
              width: calc(100% - #{$small-spacing*2});
    
              @media (min-width: $medium-screen) {
                width: calc(100% - #{$base-spacing*2});
              }
            }
          }
    
          &:not(.is-selected) {
            .cta {
              &__label {
                color: white;
              }
    
              svg {
                fill: white;
              }
            }
          }
    
          &.is-selected {
            background-color: white;
    
            .timeline-pod__image {
              opacity: 1;
            }
    
    
            @media (min-width: $medium-screen) {
              box-shadow: rgba(0, 0, 0, 0.7) 5px 5px 20px;
            }
    
            .timeline-pod__content {
              color: $blue-ribbon;
            }
    
            .timeline-pod__title {
              font-size: 30px;
              color: $blue-ribbon;
            }
    
            .progress-bar {
              box-shadow: rgba(0, 111, 238, 0.7) 3px 0 10px;
    
              &::after {
                width: 100%;
              }
            }
    
            .active-dot {
              opacity: 1;
            }
          }
    
          &.has-been {
            .progress-bar {
              box-shadow: rgba(0, 111, 238, 0.7) 3px 0 10px;
    
              &::after {
                width: 100%;
              }
            }
          }
        }
      }
    }
    
  • URL: /components/raw/horizontal-timeline/_horizontal-timeline.scss
  • Filesystem Path: src/components/_support-blocks/visuals/horizontal-timeline/_horizontal-timeline.scss
  • Size: 6.2 KB
  • Content:
    /* horizontal-timeline */
    import $ from 'jQuery'
    import shave from 'shave'
    import Flickity from 'flickity'
    import fizzyUIUtils from 'fizzy-ui-utils'
    
    var realshadow = require('real-shadow')
    
    $.fn.parallaxH = function () {
      return $(this).each(function () {
        let plxContainer = $(this)
        let plxBackground = plxContainer.children('.horizontal-timeline__bg')
        let plxSlider = plxContainer.find('.timeline-slider').outerWidth()
        let plxPercentage = (plxSlider / 100) * 4
        let plxRelativeScroll = plxContainer.find('.is-selected').index()
    
        plxBackground.css({
          'transform': 'translate3d(' + -(plxPercentage * plxRelativeScroll) + 'px, 0px, 0px )'
        })
      })
    }
    
    function shaveYourOverflow () {
      const largeShave = 250
      const smallShave = 170
      if ( $(window).outerWidth() < "1024" ) {
        shave('.timeline-pod__content p', smallShave)
      } else  {
        shave('.timeline-pod__content p', largeShave)
      }
    }
    
    
    $(document).ready(function () {
    
      shaveYourOverflow()
    
      $(window).resize(function() {
        shaveYourOverflow()
      });
    
      if ($('.timeline-slider').length) {
        var flkty = new Flickity('.timeline-slider__carousel', {
          freeScroll: true,
          contain: true,
          pageDots: false
        })
    
        var flag = false
        var offsetParent = $('.timeline-slider').offset()
    
        if ($('.timeline-slider .slide:last-child').hasClass('has-been') && !flag) {
          $('.timeline-slider .slide:last-child').removeClass('has-been')
          flag = true
        }
    
        $('.timeline-slider').on('click', '.slide', function () {
          var index = $(this).index()
          flkty.select(index)
          $( '.timeline-slider .slide:lt( ' + index + ' )' ).addClass('has-been')
          $( '.timeline-slider .slide:gt( ' + index + ' )' ).removeClass('has-been')
        })
    
        flkty.on('change', function (index) {
    
          if ($('.timeline-slider .is-next:not(:first-child)').hasClass('has-been')) {
            $('.timeline-slider slide:not(:first-child).is-next').removeClass('has-been')
          }
    
          if ($(window).outerWidth() > 768) {
            $('.horizontal-timeline').parallaxH()
          }
        })
      }
    })
    
  • URL: /components/raw/horizontal-timeline/horizontal-timeline.js
  • Filesystem Path: src/components/_support-blocks/visuals/horizontal-timeline/horizontal-timeline.js
  • Size: 2.1 KB