Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <section class="hero">
  <div class="grid-container">
    <div class="grid-x">
      <h1>
        This is a hero
      </h1>
    </div>
  </div>
</section>
<section class="statistics">
  <div class="grid-container">
    <div class="grid-x">
      <div class="cell medium-4 statistic-container">
        <div class="number">
          <h4 class="heading h4">
            100
          </h4>
        </div>
        <div class="description">
          <p class="body-big">
            This is a description
          </p>
        </div>
      </div>
      <div class="cell medium-4 statistic-container">
        <div class="number">
          <h4 class="heading h4">
            100
          </h4>
        </div>
        <div class="description">
          <p class="body-big">
            This is a description
          </p>
        </div>
      </div>
      <div class="cell medium-4 statistic-container">
        <div class="number">
          <h4 class="heading h4">
            100
          </h4>
        </div>
        <div class="description">
          <p class="body-big">
            This is a description
          </p>
        </div>
      </div>
    </div>
  </div>
</section>
<section class="timeline">
  <div class="line">
    <svg width="1" height="3610" viewBox="0 0 1 3610" fill="none" xmlns="http://www.w3.org/2000/svg">
      <line x1="0.5" y1="-2.18557e-08" x2="0.500158" y2="3610" stroke="#15182B" />
    </svg>
  </div>
  <div class="grid-container">
    <div class="grid-x title-container">
      <div class="cell small-6 title">
        <h5 class="heading h5">
          Blockchain history
        </h5>
      </div>
      <div class="cell small-6 title">
        <h5 class="heading h5">
          Pantera history
        </h5>
      </div>
    </div>

    <div class="grid-x year-container">

      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus eaque maiores, nemo corporis consequatur temporibus non sapiente suscipit aperiam dolor voluptates necessitatibus velit sunt pariatur animi distinctio laborum ipsa voluptatem?
        </div>
      </div>
      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit eligendi voluptatum iste sint labore. Magnam temporibus hic et, nesciunt similique aliquam, iure officia odio neque eius sint architecto, explicabo provident.
        </div>
      </div>

    </div>
    <div class="grid-x year-container">

      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus eaque maiores, nemo corporis consequatur temporibus non sapiente suscipit aperiam dolor voluptates necessitatibus velit sunt pariatur animi distinctio laborum ipsa voluptatem?
        </div>
      </div>
      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit eligendi voluptatum iste sint labore. Magnam temporibus hic et, nesciunt similique aliquam, iure officia odio neque eius sint architecto, explicabo provident.
        </div>
      </div>

    </div>
    <div class="grid-x year-container">

      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus eaque maiores, nemo corporis consequatur temporibus non sapiente suscipit aperiam dolor voluptates necessitatibus velit sunt pariatur animi distinctio laborum ipsa voluptatem?
        </div>
      </div>
      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit eligendi voluptatum iste sint labore. Magnam temporibus hic et, nesciunt similique aliquam, iure officia odio neque eius sint architecto, explicabo provident.
        </div>
      </div>

    </div>
    <div class="grid-x year-container">

      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus eaque maiores, nemo corporis consequatur temporibus non sapiente suscipit aperiam dolor voluptates necessitatibus velit sunt pariatur animi distinctio laborum ipsa voluptatem?
        </div>
      </div>
      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit eligendi voluptatum iste sint labore. Magnam temporibus hic et, nesciunt similique aliquam, iure officia odio neque eius sint architecto, explicabo provident.
        </div>
      </div>

    </div>
    <div class="grid-x year-container">

      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus eaque maiores, nemo corporis consequatur temporibus non sapiente suscipit aperiam dolor voluptates necessitatibus velit sunt pariatur animi distinctio laborum ipsa voluptatem?
        </div>
      </div>
      <div class="cell small-6">
        <div class="year">
          <h2 class="heading h2">
            2010
          </h2>
        </div>
        <div class="separator">
          <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 1">
            <path class="svg-path" stroke-width="1" stroke="#15182B" d="M0 .5h640" />
          </svg>
        </div>
        <div class="description">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Impedit eligendi voluptatum iste sint labore. Magnam temporibus hic et, nesciunt similique aliquam, iure officia odio neque eius sint architecto, explicabo provident.
        </div>
      </div>

    </div>

  </div>
</section>
              
            
!

CSS

              
                .hero{
  h1{
    padding: 300px 0;
  }
}

.statistics{
    min-height: 260px;

    .statistic-container{
        color: #fff;
        padding: 70px 40px;
        z-index: 10;
        background-color: #000;
    }

    .number h4.heading,
    .description p.body-big{
        text-align: center;
    }

    .description{
        margin-top: 15px;
    }
}

.timeline {
  margin-top: -100px;
  position: relative;
  overflow-y: hidden;
  z-index: 10;

  .line {
    top: 75px;
    left: 50%;
    position: absolute;

    svg {
      height: 100%;
      width: 1px;
    }
  }

  .title-container {
    min-height: 300px;
    border-top: 1px solid #000;

    > div.cell:last-child {
      text-align: right;
    }

    .heading {
      margin-top: 10px;
      padding-bottom: 170px;
    }
  }

  .year-container {
    min-height: 200px;
    position: relative;

    &:last-child {
      min-height: 390px;
    }

    > div.cell:first-child {
      .description {
        padding-bottom: 50px;
      }
    }

    > div.cell:last-child {
      text-align: right;

      .description {
        padding-bottom: 50px;
        text-align: right;
        margin-left: auto;
      }
    }

    .separator {
      width: 100%;
      position: relative;
    }

    .description {
      margin-top: 10px;
      max-width: 415px;
    }
  }
}

              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);
gsap.registerPlugin(DrawSVGPlugin);

let statisticContainerBackwards = Array.prototype.slice.call($('.statistic-container')).reverse();

gsap.timeline({
  scrollTrigger: {
    trigger: '.statistic-container',
    start: ()=>{
      return 'top center';
    },
    scrub: 0.5
  }
})
.to(statisticContainerBackwards, {yPercent: (index)=>{
    return ++index * -50
}})
.from($('.timeline .title'), {yPercent: 20}, '<')


let years = document.querySelectorAll('.year-container')

years.forEach((element, index, array)=>{
   gsap.timeline({
        scrollTrigger: {
            trigger: element,
            scrub: 0.5,
            start: 'top bottom-=15%',
            end: 'top top',
        }
    })
    .to(element, {yPercent: -100})
    .from($(element).find('.year .heading'), {yPercent: 40}, '<')
  
  let svgAnimation = gsap.fromTo($(element).find('.svg-path'), {drawSVG: '0'}, {duration: 1, drawSVG: '100%'});
  
  ScrollTrigger.create({
      trigger: element,
      scrub: false,
      start: 'top bottom-=15%',
    end: 'top center',
    markers: true,
      animation: svgAnimation,
  })
})

              
            
!
999px

Console