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.


                <div class="container">
  <div class="placeholder">
    <div class="placeholder__title">
      <p class="placeholder__subtitle">GreenSock</p>
      <h1 class="placeholder__h1">ScrollTrigger</h1>
      <!--<p class="placeholder__subtitle">scrub and pin</p> -->
    <h2>Scroll down</h2>
    <div class="arrow arrow-down">&#8595;</div>
  <div id="scroll-wrapper" class="scroll-wrapper">
    <div class="text-wrapper">Lorem ipsum dolor sit amet, consectetur adipiscing</div>
    <div id="images-wrapper" class="images-wrapper">
      <img class="img" src="" alt="Body of water surrounded with trees" />
      <img class="img" src="" alt="Beautiful woodland path" />
      <img class="img" src="" alt="Poppy flowers field" />
    <div class="text-wrapper">Semper risus in hendrerit gravida rutrum quisque non tellus</div>
<div class="placeholder">
  <div class="placeholder__wrapper">
    <div class="arrow arrow-up">&#8593;</div>
    <h2>Scroll up </h2>
    <p>Have a nice day! ✌️</p>


*::before {
  box-sizing: border-box;

body {
  font-family: sans-serif;
  height: 100vh;
  font-size: 20px;
  line-height: 1.4;

.container {
  overflow-x: hidden;

.placeholder {
  height: 100vh;
  background: indigo;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;

.placeholder__title {
  margin-bottom: 36px;

.placeholder__h1 {
  font-size: 64px;
  margin-top: -12px;
  margin-bottom: 0;

.placeholder__subtitle {
  text-align: left;
  margin: 0;

h2 {
  text-transform: uppercase;

.placeholder__wrapper {
  text-align: center;

.arrow {
  font-size: 32px;

.scroll-wrapper {
  background: #fff;
  height: 100vh;

.text-wrapper {
  display: inline-flex;
  align-items: center;
  height: 25vh;
  text-overflow: ellipsis;
  white-space: pre;
  font-size: clamp(96px, 16vh, 260px);
  padding: 0 64px;

.images-wrapper {
  display: flex;
  flex-shrink: 0;
  height: 50vh;

.img {
  height: 100%;
  width: auto;
  padding-right: 64px;
  object-fit: cover;

.img:first-child {
  padding-left: 64px;



                gsap.registerPlugin(ScrollTrigger);".arrow-down", { y: 10, repeat: -1, yoyo: true });".arrow-up", { y: -10, repeat: -1, yoyo: true });

const wrapper = document.getElementById("scroll-wrapper");
const imagesWrapper = document.getElementById("images-wrapper");
const textWrappers = gsap.utils.toArray(".text-wrapper");[imagesWrapper, textWrappers], {
  x: (_, el) => -(el.scrollWidth - window.innerWidth),
  scrollTrigger: {
    trigger: wrapper,
    start: "top top",
    // end: "bottom top",
    end: "400%",
    pin: true,
    scrub: true,
    invalidateOnRefresh: true
    // markers: true