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

              
                <main rel='main'>
  <section role='presentation'>
    <header></header>
    <article>
      <div class="credit"></div>
    </article>
    <button></button>
  </section>
</main>
              
            
!

CSS

              
                section {
  position: relative;
  width: 140px;
  height: 250px;
  background-color: #efeff3;
  -webkit-animation: window forwards 5s infinite;
  animation: window forwards 5s infinite;
  overflow: hidden;
  box-shadow: 0 2px 4px rgb(0 0 0 / 50%);
}

section > * {
  position: absolute;
}

header {
  top: 0;
  left: 0;
  width: 100%;
  height: 30px;
  border-top: 7px solid #3900b5;
  background-color: #6500f1;
  -webkit-animation: header forwards 5s infinite;
  animation: header forwards 5s infinite;
}

article {
  top: 30px;
  left: 50%;
  width: 140px;
  height: 220px;
  box-shadow: 0 2px 4px rgba(100, 100, 100, 0.1);
  background-color: #fff;
  transform: translateX(-50%);
  -webkit-animation: article forwards 5s infinite;
  animation: article forwards 5s infinite;
}

article::after {
  position: absolute;
  top: 100%;
  margin-top: 15px;
  width: 100%;
  height: 100px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(100, 100, 100, 0.1);
  content: "";
}

button {
  position: absolute;
  right: 10px;
  top: 220px;
  margin: 0;
  padding: 0;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 100%;
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.4), 0 2px 3px rgba(0, 0, 0, 0.2);
  -webkit-appearance: none;
  background-color: #e20269;
  -webkit-animation: button forwards 5s infinite;
  animation: button forwards 5s infinite;
}

@-webkit-keyframes window {
  0%,
  15%,
  90% {
    width: 140px;
    height: 250px;
  }
  30%,
  45% {
    width: 400px;
    height: 300px;
  }
  60%,
  75% {
    width: 560px;
    height: 370px;
  }
}

@keyframes window {
  0%,
  15%,
  90% {
    width: 140px;
    height: 250px;
  }
  30%,
  45% {
    width: 400px;
    height: 300px;
  }
  60%,
  75% {
    width: 560px;
    height: 370px;
  }
}

@-webkit-keyframes header {
  0%,
  15%,
  90% {
    width: 100%;
    height: 30px;
    border-top-width: 7px;
  }
  30%,
  45% {
    height: 90px;
    border-top-width: 12px;
  }
  60%,
  75% {
    height: 105px;
    border-top-width: 14px;
  }
}

@keyframes header {
  0%,
  15%,
  90% {
    width: 100%;
    height: 30px;
    border-top-width: 7px;
  }
  30%,
  45% {
    height: 90px;
    border-top-width: 12px;
  }
  60%,
  75% {
    height: 105px;
    border-top-width: 14px;
  }
}

@-webkit-keyframes article {
  0%,
  15%,
  90% {
    top: 30px;
    width: 140px;
    height: 220px;
  }
  30%,
  45% {
    top: 40px;
    width: 270px;
    height: 220px;
  }
  60%,
  75% {
    top: 50px;
    width: 290px;
    height: 225px;
  }
}

@keyframes article {
  0%,
  15%,
  90% {
    top: 30px;
    width: 140px;
    height: 220px;
  }
  30%,
  45% {
    top: 40px;
    width: 270px;
    height: 220px;
  }
  60%,
  75% {
    top: 50px;
    width: 290px;
    height: 225px;
  }
}

@-webkit-keyframes button {
  0%,
  15%,
  90% {
    right: 10px;
    top: 220px;
    width: 20px;
    height: 20px;
  }
  30%,
  45% {
    right: 20px;
    top: 77px;
    width: 26px;
    height: 26px;
  }
  60%,
  75% {
    right: 25px;
    top: 92px;
    width: 26px;
    height: 26px;
  }
}

@keyframes button {
  0%,
  15%,
  90% {
    right: 10px;
    top: 220px;
    width: 20px;
    height: 20px;
  }
  30%,
  45% {
    right: 20px;
    top: 77px;
    width: 26px;
    height: 26px;
  }
  60%,
  75% {
    right: 25px;
    top: 92px;
    width: 26px;
    height: 26px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(circle, rgb(136 212 255) 0%, rgba(22,36,184,1) 100%);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
}

.credit {
  position: fixed;
  left: 20px;
  top: 90px;
  background: #e8e8e8;
  width: 60%;
  border-radius: 20px;
  height: 10px;
}

.credit::after {
  content: "";
  position: fixed;
  left: 20px;
  top: 30px;
  background: #e8e8e8;
  width: 55%;
  border-radius: 20px;
  height: 10px;
}

.credit::before {
  content: "";
  position: fixed;
  left: 20px;
  top: 60px;
  background: #e8e8e8;
  width: 40%;
  border-radius: 20px;
  height: 10px;
}

@media (min-height: 500px) {
  .credit {
    display: block;
  }
}

.credit a {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  transition: border-color ease-out 0.15s;
}

.credit a:focus,
.credit a:hover {
  border-bottom-color: #fff;
}

              
            
!

JS

              
                
              
            
!
999px

Console