Pen Settings



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


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


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.


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.


                <section class="orange">
  <div class="text">This is some text inside of a div block.</div>

<div class="intro__trigger">
  <section class="intro__container">

    <div class="intro__content">
      <div class="panel-text blue-text">Header</div>
      <p>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quod totam recusandae nostrum laborum at facilis optio, sit, dolore architecto fugiat deleniti omnis minima soluta non doloribus adipisci, iusto delectus! Tenetur.</p>

    <div class="intro__media">
        <img class="panel panel1" src="" alt="">
        <img class="panel panel2" src="" alt="">
        <img class="panel panel3" src="" alt="">
        <img class="panel panel4" src="" alt="">

<section class="blue"></section>


html {
  margin: 0;
  padding: 0;

section {
  height: 100vh;
} {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: orange;

.intro__container {
  display: -ms-flexbox;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: black;
} {
  background-color: blue;

  font-size: 10rem;

.intro__content {
  display: grid;
  place-content: center;
  position: relative;
  overflow: hidden;
  width: 450px;
  height: 80vh;
  opacity: 1;

.intro__media {
  position: relative;
  overflow: hidden;
  width: 450px;
  height: 80vh;

.panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  object-fit: cover;




gsap.set(".panel", { zIndex: (i, target, targets) => targets.length - i });

const images = gsap.utils.toArray(".panel:not(:last-of-type)");

gsap.set(".intro__content", {
  opacity: 0,
  y: 120,

const tl = gsap.timeline({
  scrollTrigger: {
    trigger: ".intro__container",
    markers: true,
    pin: true,
    start: () => "top top",
    end: () => "+=" + (images.length + 1) * window.innerHeight,
    invalidateOnRefresh: true,
    scrub: true,
    snap: {
        snapTo: 0.5,
        duration: 0.9,
        delay: 0.1,
        ease: "power4.Out"

tl.fromTo('.panel1', { yPercent: 0 }, { yPercent: -100 }, "+=0.1")
.to(".intro__content", { opacity: 1,y: 0}, "<")
.fromTo('.panel2', { yPercent: 0 }, { yPercent: -100 }, "+=0.1")
.fromTo('.panel3', { yPercent: 0 }, { yPercent: -100 }, "+=0.1")