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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              <div class="display">
  <img src="https://images.unsplash.com/photo-1522735555435-a8fe18da2089?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ&s=d404d2ca601ddb2b3b33c4e3f41291b4" alt="A skyline of buildings similar to San Francisco" />
  <img src="https://images.unsplash.com/photo-1473580044384-7ba9967e16a0?ixlib=rb-0.3.5&q=85&fm=jpg&crop=entropy&cs=srgb&w=400&fit=max&ixid=eyJhcHBfaWQiOjE0NTg5fQ&s=53a6022c048f8595d90636e94b7fabf3" alt="A sandy desert" />
</div>
            
          
!

CSS

            
              .display {
  display: flex;
  --dimension: 126vmin;
  width: var(--dimension);
  height: calc(var(--dimension) * 9 / 16);
  position: relative;
  overflow: hidden;
  animation: flip 4500ms 0ms infinite alternate ease-in-out;
}

img {
  position: absolute;
  width: var(--dimension);
  height: 100%;
}
.display img:last-of-type {
  animation: fade 4500ms 0ms infinite alternate ease-in-out;
}

@keyframes fade {
  0%, 23% {
    opacity: 0;
  }
  77%, 100% {
    opacity: 1;
  }
}
@keyframes flip {
  0%, 23% {
    transform: rotateY(-42deg);
  }
  77%, 100% {
    transform: rotateY(42deg);
  }
}






body {
  perspective: 1200px;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: radial-gradient(circle, hsl(213, 25%, 25%), hsl(213, 25%, 5%));
}
body::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  left: 3px;
  border: 3px double #fffdfb;
}
*, *::before, *::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
            
          
!

JS

            
              let card = document.querySelector('.billboard');
let boards = Array.from(card.querySelectorAll('li'));

// Set CSS Variable to represent how many list items we have
card.style.setProperty('--boards', boards.length);

// Give each list item an offset for the background-position so the images appear complete across all the list items
boards.forEach((board, i) => {
  board.style.setProperty('--offset-x', -i / (boards.length));
});
            
          
!
999px

Console