123

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <section class="header">
  <h1>Smooth Ken Burns Effect Using the Transition Property</h1>
  <p><a href="http://paulirish.com/2012/why-moving-elements-with-translate-is-better-than-posabs-topleft/">Paul Irish</a> on why translate is better than positioning to move elements. The same is true for a lot of transition values and their counterparts. The first image shows a Ken Burns effect using transition:scale;. The second uses zoom; notice how at the very end of the animation the image is pixel fit, causing a stuttering effect on the bottom.</p>
</section>
<div class="imageWrapper"><div class="image">
  <img src="http://static.squarespace.com/static/4fb50a18e4b0f2fffeb51dda/4fb50a19e4b0f2fffeb51ddf/50255b3184ae111bdb329ce6/1344625457128/sqspc2-1.jpg?format=1500w" />
</div></div>
<div class="imageWrapperZoom"><div class="imageZoom">
  <img src="http://static.squarespace.com/static/4fb50a18e4b0f2fffeb51dda/4fb50a19e4b0f2fffeb51ddf/50255b3184ae111bdb329ce6/1344625457128/sqspc2-1.jpg?format=1500w" />
</div></div>
            
          
!
            
              body {
  margin: 0;
  padding: 0;
  background-color: whitesmoke;
}
.header {
  font-family: Sans-Serif;
  padding: 100px 0;
  text-align: center;
  font-weight: 300;
  border-bottom: 1px solid #DDD;
  h1 {
    font-weight: 400;
    font-size: 1.3em;
  }
  p {
    width: 500px;
    margin: 0 auto;
    line-height: 1.4em;
    margin-bottom: 15px;
  }
}

/* SCALE (USE THIS)
========================================== */
.imageWrapper {
  background-color: #EEE;
  border-bottom: 2px solid #DDD;
  padding: 50px 0;
}
.image {
  width:1200px;
  height:700px;
  margin:0 auto;
  overflow:hidden;
  position: relative;
}
.image img {
  animation:move 7s ease infinite; /* Change this to alternate to stop the loop. */
  -ms-animation:move 7s ease infinite;
  -webkit-animation:move 7s ease infinite;
  -0-animation:move 7s ease infinite;
  -moz-animation:move 7s ease infinite;
  position: absolute;
  left:-150px;
  top:-150px;
}

@-webkit-keyframes move {
  from {
  	transform: scale(0.9);
    -ms-transform: scale(0.9); /* IE 9 */
    -webkit-transform: scale(0.9); /* Safari and Chrome */
    -o-transform: scale(0.9); /* Opera */
    -moz-transform: scale(0.9); /* Firefox */
  }
  to {
  	transform: scale(1.0);
    -ms-transform: scale(1.0); /* IE 9 */
    -webkit-transform: scale(1.0); /* Safari and Chrome */
    -o-transform: scale(1.0); /* Opera */
    -moz-transform: scale(1.0); /* Firefox */
  }
}

/* ZOOM (DON'T USE THIS)
========================================== */
.imageWrapperZoom {
  background-color: #EEE;
  border-bottom: 2px solid #DDD;
  padding: 50px 0;
}
.imageZoom {
  width:1200px;
  height:700px;
  margin:0 auto;
  overflow:hidden;
  position: relative;
}
.imageZoom img {
  animation:zoom 7s ease infinite;
  -ms-animation:zoom 7s ease infinite;
  -webkit-animation:zoom 7s ease infinite;
  -0-animation:zoom 7s ease infinite;
  -moz-animation:zoom 7s ease infinite;
  position: absolute;
  left:-150px;
  top:-150px;
}

@-webkit-keyframes zoom {
  from {
  	zoom: 90%;
  }
  to {
    zoom: 100%;
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console