octocatstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="nav">
  <div id="slider"></div>
  <button id="playBtn">play</button>
  <button id="pauseBtn" value="pause()">pause</button>
  <button id="reverseBtn" value="reverse()">reverse</button>
  <button id="restartBtn">restart</button>
</div>


<div class="panel">
  <img id="bg" src="http://s.cdpn.io/16327/skyline.jpg" width="760" height="225">
  <img id="logo" src="http://s.cdpn.io/16327/jf-logo.png" width="250" height="216">
  <div id="address">580 Lipsenard St. New York NY 10012</div>
</div>
<div id="content">
  <h1>The Jive Factory</h1>
  <p>The Jive Factory is a restaurant and venue in Lower Manhattan, dedicated to the best food and music the city has to offer. Stop in for dinner, stick around for a drink, and see the greatest up-and-coming acts in a small and friendly performance space.</p>

  <p>We have a dining room and a full bar on the ground floor, and a large concert space downstairs with a stage, open standing room, and a second bar in the back.</p>
</div>
            
          
!
            
              body {
    background: #000 url(http://s.cdpn.io/16327/bg-body.jpg) repeat-x;
    color: #eee;
}

.panel {
    position: relative;
    width: 760px;
    height: 224px;
    background: #000;
    margin: 20px auto 0;
    overflow: hidden;
}

#bg {
    position: absolute;
}

#logo {
    position: absolute;
    left: 20px;
    top: 5px;
}

#address {
    position: absolute;
    left: 483px;
    top: 184px;
    color: #fcb802;
    width: 300px;
}

#content {
    position: relative;
    width: 720px;
    padding: 20px;
    background: #222;
    margin: 0 auto;
    overflow: hidden;
}

h1 {
    margin: 0;
}

p {
    color: #ccc;
}

.nav {
  text-align:center;
  margin: 20px auto;
  width:500px;
  height:80px;
}

button {
  padding:10px;
  margin:20px;
}
            
          
!
            
              CSSPlugin.defaultTransformPerspective = 800;

var tl = new TimelineLite({onUpdate:updateSlider});


tl.from("#bg", 0.5, {opacity:0})
  .from("#logo", 0.5, {x:-250, rotation:-90, scale:0, ease:Back.easeOut})
  .from("#address", 0.5, {x:100, opacity:0, ease:Back.easeOut})
  .from("#content", 0.5, {opacity:0, rotationX:-90, transformOrigin:"50% 50% -200"});

var slider = $("#slider").slider({
            range: false,
            min: 0,
            max: 1,
			      step:0.001,
            slide: function ( event, ui ) {
                tl.progress( ui.value ).pause();
            }
     });	
			
function updateSlider() {
  slider.slider("value", tl.progress());
} 

$("#playBtn").click(function(){
  tl.play();
});

$("#pauseBtn").click(function(){
  tl.pause();
});

$("#reverseBtn").click(function(){
  tl.reverse();
});

$("#restartBtn").click(function(){
  tl.restart();
});
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console