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

              
                <article class="py-20 px-4 event_pin bg-gray-300">
  <div class="grid_wrapper grid grid-cols-12">
    <div class="col-span-4 prose-sm md:prose-base flex flex-col">
            <div class="event_date">
              <p class="text-xs">Section One</p>
              <p class="text-xs">Little subtitle</p>
            </div>
            <div class="event_intro mt-auto pr-6">
              <h2 class="mb-6 text-xl">Section One Title</h2>
              <p class="text-base">Consequat a magna interdum ullamcorper scelerisque nascetur fringilla non ut condimentum.</p>
              <p class="text-base">Consequat a magna interdum ullamcorper scelerisque nascetur fringilla non ut condimentum.</p>
            </div>
          </div>
          <div class="col-span-8">
            <div class="image_wrapper event_image">
              <img src="https://images.unsplash.com/photo-1481349518771-20055b2a7b24?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=4239&q=80">
            </div>
          </div>
        </div>
        <div class="grid_wrapper grid grid-cols-12 py-10">
          <div class="col-span-8 col-start-5 p-20">
            <div class="image_wrapper">
              <img src="https://images.unsplash.com/photo-1513542789411-b6a5d4f31634?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=3348&q=80">
            </div>
          </div>
          <div class="col-span-8 col-start-5 p-20">
            <div class="image_wrapper">
              <img src="https://images.unsplash.com/photo-1513542789411-b6a5d4f31634?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=3348&q=80">
            </div>
          </div>
        </div>
      </article>

<article class="py-20 px-4 event_pin bg-gray-400">
  <div class="grid_wrapper grid grid-cols-12">
    <div class="col-span-4 prose-sm md:prose-base flex flex-col">
            <div class="event_date">
              <p class="text-xs">Section Two</p>
              <p class="text-xs">Little subtitle</p>
            </div>
            <div class="event_intro mt-auto pr-6">
              <h2 class="mb-6 text-xl">Section Two Title</h2>
              <p class="text-base">Consequat a magna interdum ullamcorper scelerisque nascetur fringilla non ut condimentum.</p>
              <p class="text-base">Consequat a magna interdum ullamcorper scelerisque nascetur fringilla non ut condimentum.</p>
            </div>
          </div>
          <div class="col-span-8">
            <div class="image_wrapper event_image">
              <img src="https://images.unsplash.com/photo-1481349518771-20055b2a7b24?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=4239&q=80">
            </div>
          </div>
        </div>
        <div class="grid_wrapper grid grid-cols-12 py-10">
          <div class="col-span-8 col-start-5 p-20">
            <div class="image_wrapper">
              <img src="https://images.unsplash.com/photo-1513542789411-b6a5d4f31634?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=3348&q=80">
            </div>
          </div>
          <div class="col-span-8 col-start-5 p-20">
            <div class="image_wrapper">
              <img src="https://images.unsplash.com/photo-1513542789411-b6a5d4f31634?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=3348&q=80">
            </div>
          </div>
        </div>
      </article>
              
            
!

CSS

              
                
              
            
!

JS

              
                ScrollTrigger.defaults({
  markers: true,
});
gsap.utils.toArray(".event_pin").forEach((panel) => {
    
    const imageHeight = panel.querySelector('.event_image').offsetHeight;
    const dateHeight = panel.querySelector('.event_date').offsetHeight;
    const introHeight = panel.querySelector('.event_intro').offsetHeight;
    const triggerHeight = imageHeight - (dateHeight + introHeight) - 32;

    ScrollTrigger.create({
      trigger: panel,
      start: "top top",
      pin: panel.querySelector('.event_date'),
      pinSpacing: false,
      end: 'bottom bottom',
    });

    ScrollTrigger.create({
      trigger: panel,
      start: () => "0 " + -triggerHeight,
      pin: panel.querySelector('.event_intro'), 
      pinSpacing: false,
      end: 'bottom bottom',
    });
  });
              
            
!
999px

Console