Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's 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 it's URL and the proper URL extention.

+ 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

Save Automatically?

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="hero w-full h-full overflow-hidden relative">
  <div class="absolute inset-0">
    <img src="https://images.unsplash.com/photo-1646913324960-0ba1b297b5d3?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1366&q=80" class="h-full w-full object-cover brightness-50">
  </div>
  <div class="absolute bottom-16 w-full">
    <div class="max-w-3xl mx-auto text-center">      
      <div class="t1 mb-5 text-white"><div class="t1-inner">Content above main header</div></div>
      <div class="t2 mb-8 text-white text-5xl"><div class="t2-inner">Main header content</div></div>
      <div class="t3 text-white"><div class="t3-inner">Subheader content below the main header</div></div>
    </div>
  </div>
</div>
<div class="main text-2xl p-12 bg-gray-100">
  <h2 class="font-bold text-3xl mb-12">Mutual Funds</h2>
  <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis deserunt nam saepe animi quam quod labore assumenda cumque excepturi dolorem omnis, iste fuga, voluptate, adipisci pariatur voluptas vel. Totam neque sed ratione explicabo quod hic odit. Deleniti, sint dicta cumque vitae, dolore natus architecto fugiat veniam exercitationem totam quia fugit?</p>
  <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur eum nesciunt maxime at, eligendi consectetur qui pariatur porro ipsam rem laborum minus explicabo possimus quos. Dolore commodi quia eligendi repudiandae, voluptatem sint. Libero molestiae porro laudantium non, error sed modi!</p>
  <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Nobis deserunt nam saepe animi quam quod labore assumenda cumque excepturi dolorem omnis, iste fuga, voluptate, adipisci pariatur voluptas vel. Totam neque sed ratione explicabo quod hic odit. Deleniti, sint dicta cumque vitae, dolore natus architecto fugiat veniam exercitationem totam quia fugit?</p>
</div>
              
            
!

CSS

              
                html, body { width: 100%; height: 100%; }
              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

let introPlayed = false;

let intro = gsap.timeline({
  onComplete: () => introPlayed = true
});
intro
  .from(".t1", {lazy: false, y: "-3vh", opacity: 0, duration: 0.6})
  .from(".t2", {lazy: false, y: "-2.5vh", opacity: 0, duration: 0.6}, 0.3)
  .from(".t3", {lazy: false, y: "-2vh", opacity: 0, duration: 0.6}, 0.6);

let outro = gsap.timeline({
  paused: true
  // scrollTrigger: {
  //   trigger: ".hero",
  //   start: "top top",
  //   scrub: 0.3,
  //   pin: true,
  //   markers: true,
  // }
});
outro
  .to(".t1", {lazy: false, y:"-50vh", scale: 0.96, opacity: 0, duration: 0.3})
  .to(".t2", {lazy: false, y:"-49vh", scale: 0.95, opacity: 0, duration: 0.3}, 0)
  .to(".t3", {lazy: false, y:"-48vh", scale: 0.94, opacity: 0, duration: 0.3}, 0);

ScrollTrigger.create({
  trigger: ".hero",
  start: "top top",
  pin: true,
  markers: true,
  onUpdate({ progress }) {
    if (introPlayed) {
      gsap.to(outro, {
        duration: 0.3,
        ease: "expo",
        overwrite: true,
        progress
      })
    }
  }
})
              
            
!
999px

Console