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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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

              
                <link href='https://fonts.googleapis.com/css?family=Asap:400,700' rel='stylesheet' type='text/css'>
  
  
<div id="banner">
  
  <div class="panel" id="panel1">
    <h1>hungry?</h1>
  </div>
  
  <div class="panel" id="panel2">
    <h2>How about now?</h2>
  </div>
  
  <div class="panel" id="panel3">
    <div id="info">
      <h1>Burger Boy</h1>
      <ul>
        <li>Free delivery in NYC</li>
        <li>Open 24hrs</li>
      </ul>
      <div id="orderNow">order now</div>
    </div>
  </div>
  
</div>

<div>
  <button id="play">play</button>
  <button id="pause">pause</button>
  <button id="reverse">reverse</button>
  <button id="resume">resume</button>
  <button id="restart">restart</button>
</div>
              
            
!

CSS

              
                body{
  font-family:Asap;
	background-color:black;
  color:white;
  margin:5px;  
}

#banner {
  position:relative;
  width:300px;
  height:250px;
  /*background:white;*/
  /*overflow:hidden;*/
}

.panel {
  position:absolute;
  width:300px;
  height:250px;
  overflow:hidden;
}

#panel1 {
  background: #a02600;;
}

#panel2 {
  top:260px;
  background: url(https://s.cdpn.io/16327/burger.jpg);
}

#panel1 h1 {
  position: relative;
  font-size:40px;
  line-height:240px;
  text-align:center;
  width:300px;

}

#panel2 h2{
  margin: 0;
  position: absolute;
  top: 188px;
  width: 260px;
  font-size: 22px;
  text-align: center;
  padding: 20px;
  background: #a02600;
}

#panel3 {
  top:520px;
  /*background-color:green;*/
}

#panel3 #info{
  position:absolute;
  top:125px;
  width:100%;
  padding:10px;
  height:125px;
  background: #a02600;
}

#panel3 h1 {
  font-size:34px;
  font-weight:700;
  letter-spacing: 1px;
}

#panel3 li {
  position:relative;
  margin-top:10px;
  color: #ffa488;
}

#panel3 #orderNow {
  position:absolute;
  top:60px;
  left:180px;
  background:#ffc600;
  color:#000;
  font-size:16px;
  font-weight:bold;
  padding:10px;
  border-radius:10px;
  border: 4px solid transparent;
}

#panel3 #orderNow:hover {
  background:#ffaa00;
  border: 4px solid #fff;
  cursor: pointer;
}

button {
	padding: 5px;
	margin-top: 10px;
}

button:nth-child(1){
  margin-left:10px;
}

              
            
!

JS

              
                var $panel1 = $('#panel1'),
    $panel2 = $('#panel2'),
    $panel3 = $('#panel3'),
    $panel1Text = $('#panel1 h1'),
    $panel2Text = $('#panel2 h2'),
    $info = $('#info'),
    $list = $('li'),
    $orderNow = $('#orderNow');

var tl = new TimelineMax({delay:0.5});

tl.from($panel1, 0.5, {autoAlpha:0})
  .from($panel1Text, 0.5, {scale:0.5, autoAlpha:0, ease:Back.easeOut})
  .set($panel2, {top:0}, "+=2")
  .from($panel2, 0.2, {autoAlpha:0, scale:1.5})
  .from($panel2Text, 0.2, {top:"+=62"}, "+=0.5")
  .to($panel2Text, 0.2, {top:"+=62"}, "+=0.2")
  .set($panel3, {top:0})
  .from($info, 0.5, {top:250}, "facility")
  .to($panel2, 0.5, {top:-60}, "facility")
  .staggerFrom($list, 0.3, {autoAlpha:0, left:50}, 0.1, "+=0.2")
  .from($orderNow, 0.5, {scale:0, autoAlpha:0, ease:Back.easeOut});

$("#play").click(function() {
  if (tl.progress() != 1)
    tl.play();
  else
    tl.restart();
});

$("#pause").click(function() {
		tl.pause();
});
		
$("#reverse").click(function() {
		tl.reverse();
});
		
$("#resume").click(function() {
		tl.resume();	
});
		
$("#restart").click(function() {
		tl.restart();
});
              
            
!
999px

Console