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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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 id="wrap">
  <article id="fixed">
    <div class="topper top"></div>
    <div class="topper bot"></div>
  </article>
  
  <article id="column">
    <div class="new one"></div>
    <div class="new two"></div>
    <div class="new three"></div>
    <div class="new four"></div>
    <div class="new five"></div>
    <div class="new six"></div>
    
    <div class="thumb one">
      <article class="post-wrap">
        <h1>TITLE</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis gravida faucibus nibh, a laoreet ante. Nunc ac justo volutpat, pretium nisl ut, pulvinar diam. Curabitur faucibus vehicula feugiat. Curabitur fringilla lobortis lacus non aliquet. In sodales elementum ligula vel placerat. Ut dolor nulla, hendrerit vitae rhoncus id, pellentesque ut dolor. Aliquam metus dolor, auctor sed ultricies et, scelerisque at ante. </p>
        <button></button>
      </article>
    </div>
    <div class="thumb two">
      <article class="post-wrap">
        <h1>TITLE</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis gravida faucibus nibh, a laoreet ante. Nunc ac justo volutpat, pretium nisl ut, pulvinar diam. Curabitur faucibus vehicula feugiat. Curabitur fringilla lobortis lacus non aliquet. In sodales elementum ligula vel placerat. Ut dolor nulla, hendrerit vitae rhoncus id, pellentesque ut dolor. Aliquam metus dolor, auctor sed ultricies et, scelerisque at ante. </p>
        <button></button>
      </article>
    </div>
    <div class="thumb three">
      <article class="post-wrap">
        <h1>TITLE</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis gravida faucibus nibh, a laoreet ante. Nunc ac justo volutpat, pretium nisl ut, pulvinar diam. Curabitur faucibus vehicula feugiat. Curabitur fringilla lobortis lacus non aliquet. In sodales elementum ligula vel placerat. Ut dolor nulla, hendrerit vitae rhoncus id, pellentesque ut dolor. Aliquam metus dolor, auctor sed ultricies et, scelerisque at ante. </p>
        <button></button>
      </article>
    </div>
    <div class="thumb four">
      <article class="post-wrap">
        <h1>TITLE</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis gravida faucibus nibh, a laoreet ante. Nunc ac justo volutpat, pretium nisl ut, pulvinar diam. Curabitur faucibus vehicula feugiat. Curabitur fringilla lobortis lacus non aliquet. In sodales elementum ligula vel placerat. Ut dolor nulla, hendrerit vitae rhoncus id, pellentesque ut dolor. Aliquam metus dolor, auctor sed ultricies et, scelerisque at ante. </p>
        <button></button>
      </article>
    </div>
    <div class="thumb five">
      <article class="post-wrap">
        <h1>TITLE</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis gravida faucibus nibh, a laoreet ante. Nunc ac justo volutpat, pretium nisl ut, pulvinar diam. Curabitur faucibus vehicula feugiat. Curabitur fringilla lobortis lacus non aliquet. In sodales elementum ligula vel placerat. Ut dolor nulla, hendrerit vitae rhoncus id, pellentesque ut dolor. Aliquam metus dolor, auctor sed ultricies et, scelerisque at ante. </p>
        <button></button>
      </article>
    </div>
    <div class="thumb six">
      <article class="post-wrap">
        <h1>TITLE</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis gravida faucibus nibh, a laoreet ante. Nunc ac justo volutpat, pretium nisl ut, pulvinar diam. Curabitur faucibus vehicula feugiat. Curabitur fringilla lobortis lacus non aliquet. In sodales elementum ligula vel placerat. Ut dolor nulla, hendrerit vitae rhoncus id, pellentesque ut dolor. Aliquam metus dolor, auctor sed ultricies et, scelerisque at ante. </p>
        <button></button>
      </article>
    </div>
  </article>
</section>
              
            
!

CSS

              
                *
  margin: 0
  padding: 0
  box-sizing: border-box

#wrap
  display: flex
  position: relative
  width: 100vw
  height: 100vh

  #fixed
    position: fixed
    top: 0
    left: 0
    width: 30%
    height: 100%
    border-right: 1px solid
    z-index: 6

    .topper
      position: absolute
      width: 100%
      height: 20%
      background: white

      &.top
        top: 1px
        border-bottom: 1px solid

      &.bot
        bottom: 0
        border-top: 1px solid

  #column
    position: relative
    width: 100%
    padding-top: 20vh
    padding-left: 30%
    height: auto
    background: white

    .new
      position: absolute
      width: 30%
      height: 60vh
      background: url('https://placekitten.com/400/700')
      background-size: cover
      top: 20vh
      left: 0
      z-index: 4

      &.two
        top: 80vh
        background: url('https://placekitten.com/400/700')
        background-size: cover

      &.three
        top: 140vh
        background: url('https://placekitten.com/400/700')
        background-size: cover

      &.four
        top: 200vh
        background: url('https://placekitten.com/400/700')
        background-size: cover

      &.five
        top: 260vh
        background: url('https://placekitten.com/400/700')
        background-size: cover

      &.six
        top: 320vh
        background: url('https://placekitten.com/400/700')
        background-size: cover

    .thumb
      display: flex
      width: 100%
      height: 60vh
      background: white
      border-top: 1px solid

      &.six
        margin-bottom: 20vh

      .post-wrap
        width: 60%
        height: 80%
        margin: auto

        button
          width: 10vw
          height: 5vw
          background: purple
          border-radius: 5px
          border: 0
          margin-top: 5%

              
            
!

JS

              
                console.clear();
gsap.registerPlugin(ScrollTrigger);

const slider = {
  pics: gsap.utils.toArray(".new"),
  posts: gsap.utils.toArray(".thumb"),
  setTrigger: function (el, pic) {
    const anim = gsap.from(pic, {
      yPercent: 100,
      paused: true
    });
    
    ScrollTrigger.create({
      trigger: el,
      start: "bottom 80%",
      end: "bottom 20%",
      onEnter: () => anim.restart(),
      onEnterBack: () => anim.restart()
    });
  },
  setMotion: function () {
    // Pin the left section
    // ScrollTrigger.create({
    //   trigger: catContainer,
    //   pin: true,
    //   pinSpacing: false
    // });
    
    // Create the animations for each sub-section
    slider.posts.forEach((post, i) => {
      slider.setTrigger(post, slider.pics[i]);
    });
  }
};

slider.setMotion();

/*

       
*/

              
            
!
999px

Console