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

              
                <div class="container">
  <div class="pin-animation">
    <div class="pin-animation__wrapper">  
      <div class="slide-left">
        text sliding from Left
      </div>
      <div class="slide-right">
        Text slides from Right
      </div>
    </div>
  </div>
  <div class="text-wrapper">
    <div class="left-content">
      This is sticky title
    </div>
    <div class="right-content">
Monkey D. Luffy, also known as "Straw Hat Luffy" and commonly as "Straw Hat",[11] is the main protagonist of the manga and anime, One Piece. He is the founder and captain of the increasingly infamous and powerful Straw Hat Pirates, as well as the most powerful of its top fighters.[27][28] He desires to find the legendary treasure left behind by the late Gol D. Roger and thereby become the Pirate King,[29] which would help facilitate an unknown dream of his that he has told only to Shanks, his brothers and crew.[30][31] He believes that being the Pirate King means having the most freedom in the world.[32]

    Born in Foosha Village, Luffy is the son of Monkey D. Dragon, the leader of the Revolutionary Army,[33] and the grandson of the Marine hero Monkey D. Garp,[34] and their family carries the initial and Will of D.[33] Luffy met "Red-Haired" Shanks, who gave Luffy the very straw hat that has become Luffy's signature accessory, having gifted it to the boy as part of a promise for them to meet again someday after he became a great pirate.[35] Growing up on Dawn Island, Luffy befriended and became sworn brothers of the late "Fire Fist" Portgas D. Ace[36] and Revolutionary Chief-of-Staff Sabo,[37] as well as being raised under the care of Curly Dadan.[38]

    Luffy accidentally ate the Gomu Gomu no Mi at age 7, which turned his body into rubber.[39] Thanks to his strong imagination, Luffy is able to wield the seemingly unthreatening abilities of his Devil Fruit to act as an incredibly competent fighter, often manipulating his own rubbery body into a variety of powerful forms. He is one of few individuals known to have awakened his Devil Fruit, which bestows him with mythical power.[26] In addition to his Devil Fruit abilities, Luffy is one of few individuals capable of wielding all three forms of Haki and has mastered them to the point that he has developed advanced abilities
      
      Luffy has gone up against numerous global powers around him, starting with fighting the most powerful pirates in the East Blue and moving to clashes against the Marines, Seven Warlords of the Sea, Cipher Pol, World Nobles, and even the Four Emperors of the Grand Line, emerging victorious in a majority of these battles. He invaded and indirectly caused the annihilation of Enies Lobby, escaped the impregnable Impel Down, and was a focal figure in the Summit War of Marineford. He has also either defeated or befriended seven of the eleven known past or present Warlords prior to the organization's dissolution. Furthermore, Luffy has invaded the territory of the Four Emperors on multiple occasions, and eventually managed to defeat one. Luffy's accomplishments and heritage have caused him to be labeled as a "Dangerous Future Element" while in the process gaining a reputation for being "reckless" and, in some cases, "insane," earning the wrath of Fleet Admiral Sakazuki, the Marine Headquarters, and even the World Government.[40]
    </div>
  </div>
</div>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
}
.text-wrapper {
  display: flex;
  font-size: 24px;
  overflow: hidden;
}
.left-content {
  width: 30%;
}
.right-content {
  width: 70%;
}
.pin-animation {
  height: 50vh;
  background: tomato;
  
  &__wrapper {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
  }
}
              
            
!

JS

              
                ScrollTrigger.create({
  trigger: ".pin-animation",
  start: "top top",
  end: "+=1000",
  pin: ".container"
})

ScrollTrigger.create({
  trigger: ".text-wrapper",
  start: "top top",
  end: "bottom bottom",
  pin: ".left-content",
  pinnedContainer: ".container",
  pinReparent: true,
  markers: true
})
              
            
!
999px

Console