Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!-- https://i.imgur.com/bbuESjz.jpg -->

<div class="slide">
  <div class="slide-img">
    <img src="https://images.unsplash.com/photo-1423882503395-8571951e45cc?ixlib=rb-0.3.5&q=80&fm=jpg&crop=entropy&w=1080&fit=max&s=f011230f831dba2833a69d7d55a02c20" alt="" />
  </div>
  <div class="slide-body">
    <span class="slide-title">Brilliant Headline</span>
    <span class="slide-text">I on to all taken indeed this happiness their narrow fate person, finds as without very a uniforms, and throughout. Publication cons, the from to bed must place thoroughly, hazardous as to importance, the would been made, then odd fundamentals he to your slight pointing, with pointing and to that.</span>
  </div>
</div>
              
            
!

CSS

              
                // Edit these settings to play with the effect

$img-tolerance: 80px;    // amount the image should hang off the edges (crop)
$img-aspect-ratio: 16/9; // aspect ratio of image container
$duration: 15s;          // how long the ken burns pan lasts

*,*::before,*::after{box-sizing:border-box;}

body {
  font-family:sans-serif;
  padding-top:30px;
  line-height:1.5;
}

.slide {
  width:40%;
  margin:0 auto;
  background-color: #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.25);
}

.slide-img {
  overflow:hidden;
  position:relative;
  
  &::before {
    content: "";
    display: block;
    padding-bottom: (1 / $img-aspect-ratio) * 100%;
  }
  
  img {
    width: calc(100% + #{$img-tolerance});
    position: absolute;
    top: 50%;
    left: 50%;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    animation: kenburnsEffect $duration infinite;
    animation-timing-function: linear;
    animation-direction: alternate;
    
    // decreases jankiness
    backface-visibility:hidden;
  }
}

@keyframes kenburnsEffect {
  0% {
    transform:translateX(-50%) translateY(-50%) scale(1);
  }
  100% {
    transform:translateX(-55%) translateY(-30%) scale(1.35);
  }
}

.slide-body {
  padding:6%;
  
  [class*="slide"] {
    display:block;
  }
}

.slide-title {
  font-size: 2rem;
  font-weight:bold;
  margin-bottom:1rem;
}

.slide-text {
  font-size: 1rem;
}
              
            
!

JS

              
                
              
            
!
999px

Console