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 id="viewport">
		<div id="scroll-container">
			<h1>Lorem ipsum dolor sit amet consectetur adipisicing elit. Natus repellat corrupti totam, facilis magni necessitatibus, obcaecati amet itaque ipsam ipsa culpa iure sapiente provident accusamus quam officia fugiat! Est consequuntur ab dignissimos quaerat hic illum incidunt nulla officia quas alias consectetur voluptatum vero, ipsum consequatur possimus, nostrum corporis in voluptate quasi itaque atque impedit? Minima, culpa. Ea cumque, nam veritatis, a illum vero labore voluptates, ipsam numquam aliquam modi asperiores nihil enim blanditiis dolorem doloribus non soluta odit. Enim dolorem cum officiis architecto natus corporis rerum numquam porro molestias, earum nobis at! Error, similique fugiat nobis assumenda quisquam id, perspiciatis deserunt consequuntur ex autem dignissimos, pariatur praesentium maxime officiis corporis itaque odit rem sit fugit aperiam et ipsum nulla facilis laborum. Earum unde odio libero quos odit reprehenderit provident voluptate optio sunt ducimus necessitatibus veritatis, delectus quia nesciunt pariatur. Est ullam facere magni. Aliquam voluptate, dolores ducimus dolorem nisi reiciendis hic beatae necessitatibus dolorum ex nam nesciunt? Consectetur dolorum dolor dignissimos quas tenetur recusandae asperiores magnam error omnis assumenda, minima consequuntur magni sequi vero? Eum natus exercitationem tenetur soluta, delectus nam sunt quisquam consequatur dolor voluptate non blanditiis labore, enim voluptates dolores cumque beatae totam voluptas placeat praesentium officia! Provident!</h1>
		</div>
	</div>
              
            
!

CSS

              
                h1 {
  font-size: 10vw;
}


#viewport {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

#scroll-container {
  position: absolute;
  overflow: hidden;
  width: 100%;
}

              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

const container = document.querySelector('#scroll-container');
const height = container.clientHeight;
document.body.style.height = `${height}px`;

gsap.to(container, {
  y: -(height - document.documentElement.clientHeight),
  ease: 'none',
  scrollTrigger: {
    trigger: document.body,
    start: 'top top',
    end: 'bottom bottom',
    scrub: 1,
  },
});

              
            
!
999px

Console