Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="spacer"></div>

<div class="side-scrolling-wrapper">

  <div class="side-scrolling-title">
    <div class="row center-xs">
          <div class="col-xs-12">
            <h1 class="fadeInUp">A cool title</h1>
          </div>
        </div>
  </div>

  <div class="container">
    <section class="panel">
      <div class="row">
        <div class="col-xs-12">
          <div class="margin-75px"></div>
          <div class="row">
            <div class="col-xs-6">
              <img src="https://dummyimage.com/600x600/f1f1f1/454545.png&text=A" alt="">
            </div>

            <div class="col-xs-6">
              <p class="step-number">Item A</p>
              <p class="step-description">
                Austin fixie banh mi hell of yr sustainable taxidermy fashion axe man braid. Art party sustainable prism synth.
              </p>
            </div>
          </div>
        </div>
      </div>
    </section>

    <section class="panel">
      <div class="row">
        <div class="col-xs-12">
          <div class="margin-75px"></div>
          <div class="row">
            <div class="col-xs-6">
              <img src="https://dummyimage.com/600x600/27aa67/ffffff.png&text=B" alt="">
            </div>

            <div class="col-xs-6">
              <p class="step-number">Item B</p>
              <p class="step-description">
                Authentic ugh migas yuccie tofu tote bag. Bicycle rights vinyl mlkshk ugh single-origin coffee williamsburg vaporware paleo put a bird on it.
              </p>
            </div>
          </div>
        </div>
      </div>
    </section>

    <section class="panel">
      <div class="row">
        <div class="col-xs-12">
          <div class="margin-75px"></div>
          <div class="row">
            <div class="col-xs-6">
              <img src="https://dummyimage.com/600x600/f08e29/ffffff.png&text=C" alt="">
            </div>

            <div class="col-xs-6">
              <p class="step-number">Item C</p>
              <p class="step-description">
                Ramps fixie paleo jianbing brunch coloring book intelligentsia blue bottle fashion axe cronut hammock food truck seitan man bun.
              </p>
            </div>
          </div>
        </div>
      </div>
    </section>

    <section class="panel">
      <div class="row">
        <div class="col-xs-12">
          <div class="margin-75px"></div>
          <div class="row">
            <div class="col-xs-6">
              <img src="https://dummyimage.com/600x600/32c4e4/ffffff.png&text=D" alt="">
            </div>

            <div class="col-xs-6">
              <p class="step-number">Item D</p>
              <p class="step-description">
                Prism snackwave portland fanny pack. Blue bottle hashtag hammock man bun, tbh paleo XOXO activated charcoal celiac viral narwhal shaman portland crucifix.
              </p>
            </div>
          </div>
        </div>
      </div>
    </section>

    <section class="panel">
      <div class="row">
        <div class="col-xs-12">
          <div class="margin-75px"></div>
          <div class="row">
            <div class="col-xs-6">
              <img src="https://dummyimage.com/600x600/e031de/ffffff.png&text=E" alt="">
            </div>

            <div class="col-xs-6">
              <p class="step-number">Item D</p>
              <p class="step-description">
                Chillwave selfies bushwick, tacos chartreuse iceland synth +1 swag roof party occupy. Freegan meditation normcore, bushwick kinfolk church-key microdosing cliche lo-fi vexillologist cold-pressed hell of.
              </p>
            </div>
          </div>
        </div>
      </div>
    </section>
  </div>

</div>

<div class="spacer"></div>
              
            
!

CSS

              
                .side-scrolling-wrapper {
  position: relative;
    width: 100%;
    height: auto;
    padding: 100px 0px 100px 0px;
    overflow: hidden;
    display: block;
}

.side-scrolling-title {
  background: #ccc;
}

.container {
  width: 500%;
  height: 70vh;
  display: flex;
  flex-wrap: nowrap;
  padding: 0px;
  overflow: hidden;
}

.panel {
  width: 100%;
  height: 100%;
  text-align: left;
  color: white;
  position: relative;
  overflow: hidden;
  
  img {
    max-width: 100%;
    height: auto;
    display: block;
  }

  p {
    font-weight: 300;
  }

  .step-number {
    font-size: 24px;
    line-height: 27px;
    color: blue;
    font-weight: 800;
  }
  
  .step-description {
    font-size: 21px;
    line-height: 30px;
    color: black;
  }
}

.spacer {
  position: relative;
  display: block;
  background: gray;
  height: 100vh;
}
              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

let sections = gsap.utils.toArray(".container .panel");

gsap.to(sections, {
  xPercent: -100 * (sections.length - 1),
  ease: "none",
  scrollTrigger: {
    trigger: ".side-scrolling-wrapper",
    pin: true,
    start: "top +=10px",
    markers: true,
    scrub: 1,
    snap: {
      snapTo: 1 / (sections.length - 1),
      duration: {min: 0.2, max: 0.3},
      delay: 0
    },
    // Base vertical scrolling on how wide the container is so it feels more natural.
    end: () => "+=" + (document.querySelector(".container").offsetWidth / 5)
  }
});
              
            
!
999px

Console