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

              
                <section>
  <h1>A WEBSITE</h1>
</section>
<ul class="cards">
  <li class="card">
    <h2>ARCADE HEXAGON</h2>
    <p>
      Inhabiting discretion the her dispatched decisively boisterous joy. So form were wish open is able of mile of. Waiting express if prevent it we an musical. Especially reasonable travelling she son. Resources resembled forfeited no to zealously. Has procured daughter how friendly followed repeated who surprise. Great asked oh under on voice downs. Law together prospect kindness
    </p>
  </li>
  <li class="card">
    <h2>EXILE NOTHING</h2>
    <p>securing six. Learning why get hastened smallest cheerful.

      So if on advanced addition absolute received replying throwing he. Delighted consisted newspaper of unfeeling as neglected so. Tell size come hard mrs and four fond are. Of in commanded earnestly resources it. At quitting in strictly up wandered of relation answered felicity. Side need at in what dear ever upon if. Same down want joy neat ask pain help she. Alone three stuff use law walls fat asked. Near do that he help.</p>
  </li>
  <li class="card">
    <h2>LUNAR ARMOR</h2>
    <p>
      Started earnest brother believe an exposed so. Me he believing daughters if forfeited at furniture. Age again and stuff downs spoke. Late hour new nay able fat each sell. Nor themselves age introduced frequently use unsatiable devonshire get. They why quit gay cold rose deal park. One same they four did ask busy. Reserved opinions fat him nay position. Breakfast as zealously incommode do agreeable furniture. One too nay led fanny allow plate</p>
  </li> 
  <li class="card">
    <h2>LUNAR ARMOR</h2>
    <p>
      Started earnest brother believe an exposed so. Me he believing daughters if forfeited at furniture. Age again and stuff downs spoke. Late hour new nay able fat each sell. Nor themselves age introduced frequently use unsatiable devonshire get. They why quit gay cold rose deal park. One same they four did ask busy. Reserved opinions fat him nay position. Breakfast as zealously incommode do agreeable furniture. One too nay led fanny allow plate</p>
  </li>
  <li class="card">
    <h2>LUNAR ARMOR</h2>
    <p>
      Started earnest brother believe an exposed so. Me he believing daughters if forfeited at furniture. Age again and stuff downs spoke. Late hour new nay able fat each sell. Nor themselves age introduced frequently use unsatiable devonshire get. They why quit gay cold rose deal park. One same they four did ask busy. Reserved opinions fat him nay position. Breakfast as zealously incommode do agreeable furniture. One too nay led fanny allow plate</p>
  </li>
  <li class="card">
    <h2>LUNAR ARMOR</h2>
    <p>
      Started earnest brother believe an exposed so. Me he believing daughters if forfeited at furniture. Age again and stuff downs spoke. Late hour new nay able fat each sell. Nor themselves age introduced frequently use unsatiable devonshire get. They why quit gay cold rose deal park. One same they four did ask busy. Reserved opinions fat him nay position. Breakfast as zealously incommode do agreeable furniture. One too nay led fanny allow plate</p>
  </li>
  <li class="card">
    <h2>LUNAR ARMOR</h2>
    <p>
      Started earnest brother believe an exposed so. Me he believing daughters if forfeited at furniture. Age again and stuff downs spoke. Late hour new nay able fat each sell. Nor themselves age introduced frequently use unsatiable devonshire get. They why quit gay cold rose deal park. One same they four did ask busy. Reserved opinions fat him nay position. Breakfast as zealously incommode do agreeable furniture. One too nay led fanny allow plate</p>
  </li>
</ul>
<section>
  <h1>THAT'S IT...</h1>
</section>
              
            
!

CSS

              
                body {
  font-family: "Roboto Mono", monospace;
  margin: 0;
  background-color: #fff;
 background-image: url("https://assets.codepen.io/16327/mesh-gradient+%286%29.png");
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  color: #232323;
}

h1 {
  font-size: 15vw;
  margin: 0
}

section {
  height: 50vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.cards {
margin:2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-height: 100vh;
  height:auto;
  padding: 0;
  margin: 0;
}

.card {
  --spacing: 4rem;

  width: 90vw;
  height: calc(100vh - var(--spacing) * 4);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  margin-bottom: 50px;
  border-radius: 30px;
/*   box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.2); */
  background-color: #fff;
  border: solid 3px #232323;
  /*   not needed right now - but needed when JS kicks in */
  top: var(--spacing);
  z-index: 3;
  padding: 2rem;
  box-sizing: border-box;
}

.card:nth-child(2) {
  top: calc(var(--spacing) * 2);
  z-index: 2;
}

.card:nth-child(3) {
  top: calc(var(--spacing) * 3);
  z-index: 1;
}

h1,
h2,
h3 {
  font-family: "Audiowide", cursive;
}

              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

const cards = document.querySelectorAll(".card");



gsap.to(".card", {
  yPercent: function(index, target, targets) { 

        return -(index+1) * 100;
    },
  stagger: 0.5,
  scrollTrigger: {
    trigger: ".cards",
    pin: true,
    markers: true,
    scrub: 1,
    start: "top top",
    end: "bottom top",
   
  }
});


              
            
!
999px

Console