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 hero">We just want some space between our pinned container</div>
<div class="container pinContainer" id="pinContainer">
	<div class="frame frame-left frame1" style="background:url('https://picsum.photos/1280/1480/?image=420') center center no-repeat;background-size:cover;">
		<b>ONE</b>
	</div>
	<div class="frame frame-right frame2" style="background:url('https://picsum.photos/1280/1480/?image=981') center center no-repeat;background-size:cover;">
		<b>TWO</b>
	</div>
	<div class="frame frame-left frame3" style="background:url('https://picsum.photos/1280/1480/?image=202') center center no-repeat;background-size:cover;">
		<b>THREE</b>
	</div>
	<div class="frame frame-right frame4" style="background:url('https://picsum.photos/1280/1480/?image=120') center center no-repeat;background-size:cover;">
		<b>FOUR</b>
	</div>
	<div class="frame frame-left frame5" style="background:url('https://picsum.photos/1280/1480/?image=499') center center no-repeat;background-size:cover;">
		<b>FIVE</b>
	</div>
	<div class="frame frame-right frame6" style="background:url('https://picsum.photos/1280/1480/?image=599') center center no-repeat;background-size:cover;">
		<b>SIX</b>
	</div>
	<div class="frame frame-left frame7" style="background:url('https://picsum.photos/1280/1480/?image=699') center center no-repeat;background-size:cover;">
		<b>SEVEN</b>
	</div>
	<div class="frame frame-right frame8" style="background:url('https://picsum.photos/1280/1480/?image=799') center center no-repeat;background-size:cover;">
		<b>EIGHT</b>
	</div>
	<div class="quote-container">
		<blockquote class="quote1">"Quote 1 is the best quote in the world"<cite>- Unknown</cite></blockquote>
		<blockquote class="quote2">"Quote 2 really is much better than quote 1"<cite>- Unknown</cite></blockquote>
		<blockquote class="quote3">"Yeah but what about quote 3 dude?"<cite>- Unknown</cite></blockquote>
	</div>
</div>
              
            
!

CSS

              
                .container, .pinContainer {
	width:100%;
	height:100vh;
	overflow:hidden;
	z-index:10;
	background:#eee;
	border-top:2px #000 solid;
	border-bottom:2px #000 solid;
}

.frame {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100vh;
    display: flex;
    flex-flow: row;
    justify-content: center;
    align-items: center;
}

.frame-left {
	left:0%;
}

.frame-right {
	left:50%;
}

.quote-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-flow: column wrap;
    justify-content: center;
    align-items: center;
    position: absolute;
}

.quote-container blockquote {
    position: absolute;
    opacity: 0.0;
    color:#fff;
    font-size:34px;
    line-height:38px;
}
              
            
!

JS

              
                var controller = new ScrollMagic.Controller();

var tl1 = new TimelineMax()
        .fromTo(".frame.frame2", 1, {y:  "0%"}, {y: "300%", ease: Linear.easeNone}, 0) 
				.fromTo(".frame.frame1", 1, {y:  "0%"}, {y: "-300%", ease: Linear.easeNone}, 0)
				.fromTo(".frame.frame4", 1, {y:  "-100%"}, {y: "200%", ease: Linear.easeNone}, 0)
				.fromTo(".frame.frame3", 1, {y:  "100%"}, {y: "-200%", ease: Linear.easeNone}, 0)
				.fromTo(".frame.frame6", 1, {y:  "-200%"}, {y: "100%", ease: Linear.easeNone}, 0) 
				.fromTo(".frame.frame5", 1, {y:  "200%"}, {y: "-100%", ease: Linear.easeNone}, 0) 
				.fromTo(".frame.frame8", 1, {y:  "-300%"}, {y: "0%", ease: Linear.easeNone}, 0)
				.fromTo(".frame.frame7", 1, {y:  "300%"}, {y: "0%", ease: Linear.easeNone}, 0);	

var tl2 = new TimelineMax()
				.from($(".quote1, .quote2, .quote3"), 1, {y: "-200%", autoAlpha:0})
				.to(".quote1", 1, {y: "0%", autoAlpha:1})
				.to(".quote1", 1, {y: "-=50%", autoAlpha:0})
				.to(".quote2", 1, {y: "0%", autoAlpha:1})
				.to(".quote2", 1, {y: "-=50%", autoAlpha:0})
				.to(".quote3", 1, {y: "0%", autoAlpha:1});

var slideAnimation = new TimelineMax();

slideAnimation.add(tl1, 0).add(tl2, 0);

new ScrollMagic.Scene({
  triggerElement: "#pinContainer",
  triggerHook: "onLeave",
  duration: "300%"
}).setPin("#pinContainer").setTween(slideAnimation).addTo(controller);
              
            
!
999px

Console