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

              
                    <main id="reveal-container">
        <section class="card first">
            <div class="content">
                <h1>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                    labore et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
                    amet. </h1>
            </div>
        </section>
        <section class="card second">
            <h1>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                labore et dolore magna aliquyam erat, sed diam voluptua. </h1>
        </section>
        <section class="card third">
            <h1>At vero eos et accusam et justo duo dolores et
                ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. </h1>
        </section>
        <section class="card last">
            <h1>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
                labore et dolore no sea takimata sanctus est Lorem ipsum dolor sit amet. </h1>
        </section>
        <footer> This is the End.</footer>
    </main>
              
            
!

CSS

              
                h1 {
  font-size: 3.2rem;
  max-width: 960px;
}

main#reveal-container {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
}

section.card {
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  background-color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

section.first {
  z-index: 9;
  background-color: white;
}

section.second {
  z-index: 8;
  background-color: lightblue;
}

section.third {
  z-index: 7;
  background-color: crimson;
}

section.last {
  z-index: 6;
  background-color: lightgreen;
}

footer {
  position: relative;
  font-size: 3.2rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: black;
  width: 100%;
  height: 100vh;
  z-index: -1;
}
              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

gsap.to(".card:not(:last-child)", {
    yPercent: -100,
    ease: "none",
    stagger: 0.5,
    scrollTrigger: {
        trigger: "#reveal-container",
        start: "top top",
        end: "+=300%",
        scrub: true,
        pin: true,
        markers: true
    }
});
              
            
!
999px

Console