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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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="pinContainer">
	<div id="slideContainer">
		<section class="panel blue">
			<b>ONE</b>
		</section>
		<section class="panel turqoise">
			<b>TWO</b>
		</section>
		<section id="go_live" class="panel green">
			<b>THREE</b>
      <div class="entry">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam a imperdiet mauris, et lacinia quam. Nam et enim convallis, venenatis metus a, dapibus ex. Pellentesque nec nisi ut eros tristique venenatis. Morbi elementum facilisis tincidunt. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>
      </div>
      <div class="tip">
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam a imperdiet mauris, et lacinia quam. Nam et enim convallis, venenatis metus a, dapibus ex. Pellentesque nec nisi ut eros tristique venenatis. Morbi elementum facilisis tincidunt.</p>
      </div>
		</section>
		<section class="panel bordeaux">
			<b>FOUR</b>
		</section>
	</div>
</div>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
}	
html, body {
  height: 100%;
  color: #fff;
  font-family: arial;
}
#pinContainer {
		width: 100%;
		height: 100%;
		overflow: hidden;
		-webkit-perspective: 1000;
		        perspective: 1000;
	}
	#slideContainer {
		width: 400%; /* to contain 4 panels, each with 100% of window width */
		height: 100%;
	}
	.panel {
		height: 100%;
		width: 25%; /* relative to parent -> 25% of 400% = 100% of window width */
		float: left;
    text: center;
    position: relative;
	}
.blue {
  background: blue;
}
.turqoise {
  background: teal;
}
.green {
  background: green;
}
.bordeaux {
  background: red;
}

.entry {
  width: 50%;
  position: absolute;
  top: 10%;
  left: 0;
}

.tip {
  width: 50%;
  position: absolute;
  bottom: 10%;
  right: 0;
}
              
            
!

JS

              
                (function () {
    'use strict';

    var domReady = function (callback) {
        document.readyState === 'interactive' || document.readyState === 'complete' ? callback() : document.addEventListener('DOMContentLoaded', callback);
    };

    function init() {

    // init controller
    var controller = new ScrollMagic.Controller({
        globalSceneOptions: {
            triggerHook: 0,
            offset: 0
        },
        addIndicators: false,
        reverse: false
    });

    var easeInAnimation = Expo.easeIn;
    var easeOutAnimation = Expo.easeOut;

		// define movement of panels
		var wipeAnimation = new TimelineMax({onReverseComplete: function(){
        alert('Animation Reversed');
    }})
			// animate to second panel
			.to("#slideContainer", 0.5, {z: -150})		// move back in 3D space
			.to("#slideContainer", 1,   {x: "-25%"})	// move in to first panel
			.to("#slideContainer", 0.5, {z: 0})				// move back to origin in 3D space
			// animate to third panel
			.to("#slideContainer", 0.5, {z: -150, delay: 1})
			.to("#slideContainer", 1,   {x: "-50%", onComplete: function() {
          TweenMax.fromTo('.entry', 2.2, {xPercent: 0, rotation: 0},{rotation: 180, xPercent: 50, ease: Elastic.easeOut.config(1.0, 0.4)})
          TweenMax.fromTo('.tip', 2.2, {xPercent: 0, rotation: 0},{rotation: -180, xPercent: -50, ease: Elastic.easeOut.config(1.0, 0.4)})
          TweenMax.fromTo('.green', 2.2, {backgroundColor:'green'},{backgroundColor:'black'})
      }})
			.to("#slideContainer", 0.5, {z: 0})
			// animate to forth panel
			.to("#slideContainer", 0.5, {z: -150, delay: 1})
			.to("#slideContainer", 1,   {x: "-75%"})
			.to("#slideContainer", 0.5, {z: 0});

//     var goLive = new TimelineMax();
//     goLive
//         .fromTo('#go_live .entry', 2.0, {y: '20px', opacity: 0, ease: easeOutAnimation}, {y: '0', opacity: 1, ease: easeOutAnimation}, 0)
//         //.fromTo('#go_live .tip', 1.0, {opacity: 0, scale: '0'}, {opacity: 1,  scale: '1.0', ease: Elastic.easeOut.config(1.0, 0.4)}, 0.5);

//     new ScrollMagic.Scene({triggerElement: "#go_live"})
//         .setTween(goLive)
//         .addTo(controller);

		// create scene to pin and link animation
		new ScrollMagic.Scene({
				triggerElement: "#pinContainer",
				triggerHook: "onLeave",
				duration: "500%"
			})
			.setPin("#pinContainer")
			.setTween(wipeAnimation)
			.addIndicators() // add indicators (requires plugin)
			.addTo(controller);
		}
		
		domReady(init);

}());
              
            
!
999px

Console