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="wrapper overflow:hidden">
    <section class="h:100vh bg:blue flex jc:center ai:center">
    <div class="fade-up">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit a perspiciatis consectetur vitae quisquam repellat velit nemo architecto, quos provident excepturi enim voluptatem sapiente dolore sed maxime quo incidunt exercitationem!
    </div>
  </section>
    <section class="h:100vh bg:green flex jc:center ai:center">
    <div class="fade-up">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit a perspiciatis consectetur vitae quisquam repellat velit nemo architecto, quos provident excepturi enim voluptatem sapiente dolore sed maxime quo incidunt exercitationem!
    </div>
  </section>
  <section class="h:100vh bg:pink flex jc:center ai:center">
    <div class="fade-up">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit a perspiciatis consectetur vitae quisquam repellat velit nemo architecto, quos provident excepturi enim voluptatem sapiente dolore sed maxime quo incidunt exercitationem!
    </div>
  </section>
  <section class="sec-3 pt:3em">
      <div class="container">
          <div class="row">
              <div class="col-12">
                  <h3 class="t:center">Title</h3>
                  <p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Et cumque perferendis neque maiores, dolore, voluptates nisi, nostrum dolores dolorum obcaecati minus. Officia nobis, fugiat porro nulla consequuntur eos repudiandae autem.
                  </p>
                  <div class="scroll-trigger flex">
                      <div class="scroll-trigger-item w:full">
                          <div class="mx:auto w:80% flex">
                              <div>
                                  <h4>Long-term Support</h4>
                                  <p>The Intel® Celeron® J6412 processor is available and supported for an extended
                                      period. This long-term availability makes the Mini-ITX motherboard an
                                      ideal solution for integrators looking to maximize their return on investment.
                                  </p>
                              </div>
                              <figure>
                                  <img src="../_img/fake.png" alt="">
                              </figure>
                          </div>
                      </div>
                      <div class="scroll-trigger-item w:full">
                          <div class="mx:auto w:80% flex">
                              <div>
                                  <h4>Long-term Support</h4>
                                  <p>The Intel® Celeron® J6412 processor is available and supported for an extended
                                      period. This long-term availability makes the Mini-ITX motherboard an
                                      ideal solution for integrators looking to maximize their return on investment.
                                  </p>
                              </div>
                              <figure>
                                  <img src="../_img/fake.png" alt="">
                              </figure>
                          </div>
                      </div>
                                                                <div class="scroll-trigger-item w:full">
                                    <div class="mx:auto w:80%">
                                        <h4>CPU Benchmark</h4>
                                        <figure>
                                            <img src="../_img/fake.png" class="max-w:30%" alt="">
                                            <small>Source:<a target="_blank" href="www.cpubenchmark.net">www.cpubenchmark.net</a></small>
                                        </figure>
                                    </div>
                                </div>
                                <div class=" scroll-trigger-item w:full">
                                    <div class="mx:auto w:80% flex flex:column flex:row@width1200">
                                        <div>
                                            <h4>Long-term Support</h4>
                                            <p>The Intel® Celeron® J6412 processor is available and supported for an extended
                                                period. This long-term availability makes the Mini-ITX motherboard an
                                                ideal solution for integrators looking to maximize their return on investment.
                                            </p>
                                        </div>
                                        <figure>
                                            <img class="max-w:80% h:80" src="../_img/fake.png" alt="">
                                        </figure>
                                    </div>
                                </div>
                                <div class=" scroll-trigger-item w:full">
                                    <div class="mx:auto w:80% flex flex:column flex:row@width1200">
                                        <div>
                                            <h4>Long-term Support</h4>
                                            <p>The Intel® Celeron® J6412 processor is available and supported for an extended
                                                period. This long-term availability makes the Mini-ITX motherboard an
                                                ideal solution for integrators looking to maximize their return on investment.
                                            </p>
                                        </div>
                                        <figure>
                                            <img class="max-w:80% h:80" src="../_img/fake.png" alt="">
                                        </figure>
                                    </div>
                                </div>
                                                    <div class="scroll-trigger-item w:full">
                                    <div class="mx:auto w:80%">
                                        <h4>CPU Benchmark</h4>
                                        <figure>
                                            <img src="../_img/fake.png" class="max-w:30%" alt="">
                                            <small>Source:<a target="_blank" href="www.cpubenchmark.net">www.cpubenchmark.net</a></small>
                                        </figure>
                                    </div>
                                </div>
                                <div class=" scroll-trigger-item w:full">
                                    <div class="mx:auto w:80% flex flex:column flex:row@width1200">
                                        <div>
                                            <h4>Long-term Support</h4>
                                            <p>The Intel® Celeron® J6412 processor is available and supported for an extended
                                                period. This long-term availability makes the Mini-ITX motherboard an
                                                ideal solution for integrators looking to maximize their return on investment.
                                            </p>
                                        </div>
                                        <figure>
                                            <img class="max-w:80% h:80" src="../_img/fake.png" alt="">
                                        </figure>
                                    </div>
                                </div>
                                                    <div class="scroll-trigger-item w:full">
                                    <div class="mx:auto w:80%">
                                        <h4>CPU Benchmark</h4>
                                        <figure>
                                            <img src="../_img/fake.png" class="max-w:30%" alt="">
                                            <small>Source:<a target="_blank" href="www.cpubenchmark.net">www.cpubenchmark.net</a></small>
                                        </figure>
                                    </div>
                                </div>
                                <div class=" scroll-trigger-item w:full">
                                    <div class="mx:auto w:80% flex flex:column flex:row@width1200">
                                        <div>
                                            <h4>Long-term Support</h4>
                                            <p>The Intel® Celeron® J6412 processor is available and supported for an extended
                                                period. This long-term availability makes the Mini-ITX motherboard an
                                                ideal solution for integrators looking to maximize their return on investment.
                                            </p>
                                        </div>
                                        <figure>
                                            <img class="max-w:80% h:80" src="../_img/fake.png" alt="">
                                        </figure>
                                    </div>
                                </div>
                  </div>
              </div>
          </div>
      </div>
  </section>
  <section class="h:100vh bg:grey flex jc:center ai:center">
        <div class="fade-left">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit a perspiciatis consectetur vitae quisquam repellat velit nemo architecto, quos provident excepturi enim voluptatem sapiente dolore sed maxime quo incidunt exercitationem!
    </div>
  </section>
  <section class="sec-5 bg:green">
    <div class="container">
        <div class="row">
            <div class="col-12 flex jc:flex-end ai:flex-end min-h:100vh rel
            {max-w:100px;abs}_figure
            ">
                <figure class="left:50% top:20% scroll-down">
                    <img src="https://3.bp.blogspot.com/-GCRwg01rCtE/V_sXreCYGOI/AAAAAAAApOo/R4WTsVrHN-wBPenCcPYifUQ2GNyyJR4WQCLcB/s1600/1.png" alt="">
                </figure>
                <figure  class="left:60% bottom:40% scroll-up">
                    <img src="https://3.bp.blogspot.com/-GCRwg01rCtE/V_sXreCYGOI/AAAAAAAApOo/R4WTsVrHN-wBPenCcPYifUQ2GNyyJR4WQCLcB/s1600/1.png" alt="">
                </figure>
                <figure  class="left:70% top:40% scroll-down">
                    <img src="https://3.bp.blogspot.com/-GCRwg01rCtE/V_sXreCYGOI/AAAAAAAApOo/R4WTsVrHN-wBPenCcPYifUQ2GNyyJR4WQCLcB/s1600/1.png" alt="">
                </figure>
                <figure  class="left:80% bottom:60% scroll-up">
                    <img src="https://3.bp.blogspot.com/-GCRwg01rCtE/V_sXreCYGOI/AAAAAAAApOo/R4WTsVrHN-wBPenCcPYifUQ2GNyyJR4WQCLcB/s1600/1.png" alt="">
                </figure>
                <figure  class="left:90% top:60% scroll-down">
                    <img src="https://3.bp.blogspot.com/-GCRwg01rCtE/V_sXreCYGOI/AAAAAAAApOo/R4WTsVrHN-wBPenCcPYifUQ2GNyyJR4WQCLcB/s1600/1.png" alt="">
                </figure>
                <div class="w:50%@width1200 rel
                "
                >
                    <div>
                        <h3 class="color:var(--light-blue-color)!">5G & Wi-Fi Expandability</h3>
                        <p class="color:white!">Wireless solution support is made through the two M.2 slots. The B-key slot
                            comes with a SIM slot to support 5G modules. The A-key slot is designed to
                            support Wi-Fi/Bluetooth network cards.
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
  <section class="h:100vh bg:grey flex jc:center ai:center">
        <div class="fade-left">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit a perspiciatis consectetur vitae quisquam repellat velit nemo architecto, quos provident excepturi enim voluptatem sapiente dolore sed maxime quo incidunt exercitationem!
    </div>
  </section>
    <section class="h:100vh bg:grey flex jc:center ai:center">
        <div class="fade-left">
      Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit a perspiciatis consectetur vitae quisquam repellat velit nemo architecto, quos provident excepturi enim voluptatem sapiente dolore sed maxime quo incidunt exercitationem!
    </div>
  </section>
</div>
              
            
!

CSS

              
                .sec-5 {
  img {
    max-width:100px;
  }
}
.fade-up,.fade-left {
  padding: 1rem;
  color: white;
  width: 60%;
}
              
            
!

JS

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

// fade up
const animateItems = gsap.utils.toArray('.fade-up')
animateItems.forEach(item => {
  gsap.from(item,{
    yPercent: 30,
    opacity: 0,
    scrollTrigger: {
      trigger: item,
      start: "top center",
      end: () => "+=180%",
      markers: true,
      toggleActions: 'play pause resume reverse'
    }
  })
})

// fade left
const fadeLeftEl = document.querySelectorAll('.fade-left')
fadeLeftEl.forEach(item => {
  gsap.from(item,{
    xPercent: -30,
    scrollTrigger: {
      trigger: item,
      start: 'top center',
      end: 'end end',
      markers: true,
      toggleActions: 'play pause resume reverse'
    }
  })
})

// sec-3
const items = gsap.utils.toArray(".scroll-trigger-item");
const scrollUpItem = gsap.utils.toArray('.scroll-up');
const scrollDownItem = gsap.utils.toArray('.scroll-down');
const scrollTriggerContainer = document.querySelector('.scroll-trigger');
scrollTriggerContainer.style.width = `${items.length*100}%`
gsap.to(items, {
  xPercent: (items.length - 1) * -100,
  scrollTrigger: {
    trigger: '.sec-3',
    pin: '.wrapper',
    scrub: 1,
    start: 'top top',
    end: () => "+=" + (items[0].offsetHeight * (items.length)),
    markers: true,
  },
});

// sec-5
let tl = gsap.timeline({
  scrollTrigger: {
    trigger: '.sec-5 .container',
    pin: '.wrapper',
    pinnedContainer: ".wrapper",
    scrub: 1,
    start: 'top top',
    end: () => "+=" + 200,
    markers: true,
  }
});
tl.from(scrollUpItem, {
  yPercent: 300,
  opacity: 0,
})
tl.from(scrollDownItem, {
  opacity: 0,
  yPercent: -300,
}, 0)


              
            
!
999px

Console