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="text-heading">
  <div class="main-statement intro-animation">
    <div class="line-animate">
      <p class="slide-up">Lorem ipsum dolor sit amet, consectetur adipiscing</p>
    </div>
    <div class="line-animate">
      <p class="slide-up">incididunt ut labore et dolore magna aliqua. Ut enim </p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">ad minim veniam, quis nostrud exercitation</p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">magni dolores eos qui. ⬤ Quis autem vel eum iure</p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">Neque porro quisquam est, qui dolorem ipsum quia dolor</p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">reprehenderit qui in ea voluptate velit esse quam nihil</p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">ullamco laboris nisi ut aliquip ex ea commodo consequat</p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">aute irure dolor. ⬤ sequi nesciunt. Neque porro quisquam</p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">et quasi architecto beatae vitae dicta sunt explicabo</p>
    </div>
    <div class="line-animate">
      <p class="pre-slide">accusantium doloremque laudantium, totam rem aperiam</p>
    </div>
  </div>
</div>
              
            
!

CSS

              
                body,
h1,
h2,
h3 {
  margin: 0;
}
.slide-up {
  -webkit-animation: slide-up 2s cubic-bezier(0.65, 0, 0.35, 1) both;
  animation: slide-up 2s cubic-bezier(0.65, 0, 0.35, 1) both;
}

@-webkit-keyframes slide-up {
  0% {
    transform: translateY(100px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes slide-up {
  0% {
    transform: translateY(100px);
  }
  100% {
    transform: translateY(0);
  }
}

.line-animate {
  overflow: hidden;
}

.intro-animation .line-animate {
  -webkit-animation-delay: 0;
  animation-delay: 0;
}
.intro-animation > div:nth-child(2) > p
{
  -webkit-animation-delay: 0.55s;
  animation-delay: 0.55s;
}

.intro-animation > div:nth-child(3)
{
  -webkit-animation-delay: 0.85s;
  animation-delay: 0.85s;
}

.intro-animation > div {
  -webkit-animation-delay: 0;
  animation-delay: 0;
}
.text-heading {
  margin-top: 300px;
  width: 900px;
}

              
            
!

JS

              
                gsap.registerPlugin( ScrollTrigger);

	const headings = gsap.utils.toArray('.pre-slide');

	ScrollTrigger.batch(headings, {
		start: 'top 90%',
		once: true,
		onEnter: (batch) =>
			gsap.to(batch, {
				yPercent: 0,
				duration: 2.0,
				stagger: 0.5,
				ease: 'power4',
			}),
	});
	gsap.set(headings, { yPercent: 100 });

	// since we're moving the initial position DOWN (yPercent: 100), it would affect where the triggers line up, but we want to base things on the natural position, so on the "refreshInit" event, we restore it. ScrollTrigger automatically reverts the tween we return.
	ScrollTrigger.addEventListener('refreshInit', () =>
		gsap.set(headings, { yPercent: 0 })
	);
              
            
!
999px

Console