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

              
                <header id="header">
	<div class="wrap">
		<h1 class="logo">Testes</h1>
		<ul class="menu">
			<li>
				<a href="#section-01">One</a>
			</li>
			<li>
				<a href="#section-02">Two</a>
			</li>
		</ul>
	</div>
</header>
<div id="main">
	<section class="section" id="section-01">
		<div class="wrap">
      <img src="http://i66.tinypic.com/j6ke9u.jpg" />
			<h1>Your shields were failing, sir</h1>
			<p>Did you come here for something in particular or just general Riker-bashing? When has justice ever been as simple as a rule book? They were just sucked into space. I suggest you drop it, Mr. Data. The Enterprise computer system is controlled by three primary main processor cores, cross-linked with a redundant melacortz ramistat, fourteen kiloquad interface modules. Well, that's certainly good to know. Yes, absolutely, I do indeed concur, wholeheartedly!</p>
		</div>
	</section>
	<section class="section" id="section-02">
		<div class="wrap">
      <img src="http://i64.tinypic.com/de2uch.jpg" />
			<h1>Commander William Riker of the Starship Enterprise</h1>
			<p>I am your worst nightmare! Mr. Crusher, ready a collision course with the Borg ship. This is not about revenge. This is about justice. Yes, absolutely, I do indeed concur, wholeheartedly! Sure. You'd be surprised how far a hug goes with Geordi, or Worf. I will obey your orders. I will serve this ship as First Officer. And in an attack against the Enterprise, I will die with this crew. But I will not break my oath of loyalty to Starfleet. Yesterday I did not know how to eat gagh.</p>
		</div>
	</section>
</div>
              
            
!

CSS

              
                * {
	margin:0;
	padding:0;
}
body {
  font-family: 'Raleway', sans-serif;
  color:#fff;
  font-size:14px;
  overflow-X:hidden;
}
.wrap { 
	max-width:90%;
	margin:0 auto;
	width:100%;
	position: relative;
	top: 50%;
	transform:translateY(-50%);
}
#header	{
	height: 70px;
	width: 100%;
	position: fixed;
	top: 0;
	left: 0;
	z-index: 6;
  .wrap {
    overflow:hidden;
    height:auto;
  }
}
.logo {
	font-family: 'Baloo Bhai', cursive;
  font-size:24px;
  float:left;
}
.menu {
  float:right;
  list-style:none;
  padding-top:20px;
  li {
    display:inline-block;
    font-size:14px;
    margin:0 10px;
    text-transform:uppercase;
    a {
      color:#fff;
      text-decoration:none;
    }
  }
}
h1 {
	font-family: 'Baloo Bhai', cursive;	
	color:#fff;
  font-size:32px;
  font-weight:normal;
  line-height:1;
  margin: 0 0 20px;
}
.section {
	height:100vh;
  text-align:center;
  img {
    display:block;
    margin:0 auto 20px;
    height:auto;
    width:100px;
    border-radius:50%;
    overflow:hidden;
    border:5px solid #fff;
  }
}
#section-01 {
	background:rgba(22,139,255,1);
}
#section-02 {
	background:rgba(255,99,22,1);
}
#footer {
  font-size:12px;
  position:fixed;
  bottom:0;
  left:0;
  width:100%;
  text-align:center;
  .wrap {
    padding:10px 0;
  }
}
              
            
!

JS

              
                	// Init ScrollMagic
	var controller = new ScrollMagic.Controller();

  var section1MTl,
      section2MTl; 


installMediaQueryWatcher("(max-width: 640px)", function(matches) {
    if (matches) {
      // Section 01
     section1MTl = new TimelineMax()
        .from('#section-01 img', .5, {y: '110%',autoAlpha:0, ease:Power4.easeInOut})
        .from('#section-01 h1', .5, {y: '110%', autoAlpha:0,ease:Power4.easeInOut})
        .from('#section-01 p', .5, {y: '110%', autoAlpha:0,ease:Power4.easeInOut})
      ;
      section2MTl = new TimelineMax()
        .from('#section-02 img', .5, {y: '110%',autoAlpha:0, ease:Power4.easeInOut})
        .from('#section-02 h1', .5, {y: '110%', autoAlpha:0,ease:Power4.easeInOut})
        .from('#section-02 p', .5, {y: '110%', autoAlpha:0,ease:Power4.easeInOut})
      ;
    } else {
      // Section 01
      section1MTl = new TimelineMax()
        .from('#section-01 img', .5, {x: '110%',autoAlpha:0, ease:Power4.easeInOut})
        .from('#section-01 h1', .5, {x: '110%', autoAlpha:0,ease:Power4.easeInOut})
        .from('#section-01 p', .5, {x: '110%', autoAlpha:0,ease:Power4.easeInOut})
      ;
      section2MTl = new TimelineMax()
       .from('#section-02 img', .5, {x: '110%', autoAlpha:0,ease:Power4.easeInOut})
        .from('#section-02 h1', .5, {x: '-110%', autoAlpha:0,ease:Power4.easeInOut})
        .from('#section-02 p', .5, {x: '110%', autoAlpha:0,ease:Power4.easeInOut})
      ;
    }
 });
	
      new ScrollMagic.Scene({
        triggerElement: '#section-01',
        triggerHook: .8
      }) 
      .setTween(section1MTl)
      .addTo(controller); 


       new ScrollMagic.Scene({
        triggerElement: '#section-02',
        triggerHook: .8
      })
      .setTween(section2MTl)
      .addTo(controller); 
    


// Media Query Watch
function installMediaQueryWatcher(mediaQuery, layoutChangedCallback) {
  var mql = window.matchMedia(mediaQuery);
  mql.addListener(function (e) { return layoutChangedCallback(e.matches); });
  layoutChangedCallback(mql.matches);
}




              
            
!
999px

Console