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

              
                <h1>GSAP Starter Template</h1>
<p>Aliquam sollicitudin arcu a ipsum efficitur, at laoreet ante sodales. Vestibulum feugiat nisl eu iaculis tempus. Praesent vel enim et mauris dignissim elementum a malesuada ex. Pellentesque volutpat justo justo. Integer sodales interdum varius. Aliquam tincidunt turpis id diam faucibus, sed bibendum urna vulputate.
</p>

<p>Ideally when the text gets to about here</p>
<p>I'd want the next line to come in earlier</p>
<p>Hope this makes sense</p>

<p class="second">Aenean dapibus massa nec suscipit gravida. Donec massa ligula, pellentesque sit amet sagittis ut, dignissim at augue. Aenean rhoncus nec lectus nec porttitor. In hac habitasse platea dictumst. Quisque quis lectus volutpat, varius ipsum nec, vehicula magna. Vivamus sapien ligula, lobortis a bibendum vitae, pretium a felis. Nunc bibendum ultrices turpis at egestas.
</p>
<section style="height:50vh">
  <h1>Extra space just for demo, remove this</h1>
</section>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Signika+Negative:300,400&display=swap");
body {
  font-family: "Signika Negative", sans-serif;
  font-weight: 300;
}

p {
  max-width: 600px;
}

.second {
  margin: 400px 0;
}

              
            
!

JS

              
                //gsap.to()... infinity and beyond!

//To learn more about using GreenSock's bonus plugins for free on CodePen visit: https://greensock.com/try-plugins

gsap.registerPlugin(SplitText);

const quotes = document.querySelectorAll("p");

function setupSplits() {
  quotes.forEach((quote) => {
    quote.split = new SplitText(quote, {
      type: "chars,lines",
      linesClass: "split-line"
    });

    // Set up the anim
    quote.anim = gsap.from(quote.split.chars, {
      scrollTrigger: {
        trigger: quote,
        start: "top 50%",
        markers: true
      },
      duration: 0.3,
      ease: "circ",
      yPercent: 50,
      autoAlpha: 0,
      stagger: {
        amount: 2,
        ease: "power1",
      }
    });
  });
}

ScrollTrigger.addEventListener("refresh", setupSplits);
setupSplits();

              
            
!
999px

Console