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

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

              
                    <main id="primary" class="site-main rel">
        <div class="ima">
          <div class="ima_inner fixed-intro"> <a href="#intro-pin"><h4>Intro</h4></a></div>
           <div class="ima_inner fixed-media"> <a href="#media-pin"><h4>Media</h4></a></div>
           <div class="ima_inner fixed-artist"> <a href="#artist-pin"><h4>Artist</h4></a></div>
        </div>
        
        <div class="hunnid"><div id="stay-one"></div></div>
        <div class="hunnid"><div id="stay-two"></div></div>
        <div class="hunnid"><div id="intro-pin"><div class="ima_inner intro"><a href="#intro-pin"><h4>Intro</h4></a></div></div></div>
        <div class="hunnid"><div id="media-pin"><div class="ima_inner media"><a href="#media-pin"><h4>Media</h4></a></div></div></div>
        <div class="hunnid"><div id="artist-pin"><div class="ima_inner arist"><a href="#artist-pin"><h4>Artist</h4></a></div></div></div>
        
    </main>
              
            
!

CSS

              
                .rel{
    position: relative;
}

.ima {
    width: 100%;
    float: right;
    position: fixed;
    bottom: 0;
    height: 15vh;
    display: flex;
    flex-wrap: wrap;
    z-index: 3
}
.ima_inner{
    border-top: 1px solid #000000;
    width: 100%;
    padding: 10px 20px;
    background: #ffffff;
}

.ima a {
    width: 100%;
    color: inherit;
    text-decoration: none;
}

    
.hunnid{
    height: 100vh;

}


.hunnid:nth-of-type(2){
    background: rgba(36,36,36,1.00);
    height: 65vh;
}

#media-pin{
    padding-top: 5vh;
}

#artist-pin{
      padding-top: 10vh;  
}

.hunnid:nth-of-type(3){
    background: rgba(216,225,230,1.00);
    
}

.hunnid:nth-of-type(4){
    background: rgba(255,255,255,1.00);
}


.hunnid:nth-of-type(5){
    background: rgba(36,36,36,1.00);
}

.hunnid:nth-of-type(6){
    background: rgba(255,255,255,1.00);

}

.hunnid:nth-of-type(7){
    background: rgba(36,36,36,1.00);

}


              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);


ScrollTrigger.create({
  trigger: "#intro-pin",
  start: "top top",
  end: "max",
  pinnedContainer: ".intro",
  pinType: "transform", // because it's inside an element with transforms applied, thus position: fixed won't work the way you may anticipate.
  onRefreshInit: self => self.scroll(0), // if the user is scrolled beyond the container pin, it throws off the measurements, so just scroll to the top to ensure positioning is correct.
  pin: true,
      markers:true,
});


gsap.to(".fixed-intro", {
  duration:2, autoAlpha:0, ease:"linear", 
    scrollTrigger: {
      trigger:"#intro-pin",
    endtrigger:"#primary",
      markers:true,
      start:"top 85%", //when top of herman passes 75% viewport height
        end:"top 85%",
      toggleActions: "restart none none reverse",
        scrub:true,
    }
});

ScrollTrigger.create({
  trigger: "#media-pin",
  start: "top top",
  end: "max",
  pinnedContainer: ".media",
  pinType: "transform", 
  onRefreshInit: self => self.scroll(0), 
  pin: true,
      markers:true,
});


gsap.to(".fixed-media", {
  duration:2, autoAlpha:0, ease:"linear", 
    scrollTrigger: {
      trigger:"#media-pin",
      markers:true,
      start:"top 90%", //when top of herman passes 75% viewport height
        end:"top 90%",
      toggleActions: "restart none none reverse",
        scrub:true,
    }
});


gsap.to(".fixed-artist", {
  duration:2, autoAlpha:0, ease:"linear", 
    scrollTrigger: {
      trigger:"#artist-pin",
      markers:true,
      start:"top 95%", //when top of herman passes 75% viewport height
        end:"top 95%",
      toggleActions: "restart none none reverse",
        scrub:true,
    }
});


ScrollTrigger.create({
  trigger: "#artist-pin",
  start: "top top",
  end: "max",
  pinnedContainer: ".artist",
  pinType: "transform", 
  onRefreshInit: self => self.scroll(0),
  pin: true,
      markers:true,
});
              
            
!
999px

Console