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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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.

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

              
                <body>
  <div class="container">
    <ul class="menu">
      <li>
        <p class="name">pug-1</p>
        <div class="door-left">
          <div class="door-knob"></div>
        </div>
        <div class="door-right">
          <p class="phrase">Happiness is a warm puppy.</p>
          <div class="door-knob"></div>
        </div>
        <div class="img-box">
          <img src="https://drive.google.com/uc?export=view&id=1tEQxFeJxfzrX97ZR56sKeMsHuKO2NdM7" alt="pug-1">
        </div>
      </li>  
      <li>
        <p class="name">pug-2</p>
        <div class="door-left">
          <div class="door-knob"></div>
        </div>
        <div class="door-right">
          <div class="door-knob"></div>
          <p class="phrase">Dogs never bite me. Just humans.</p>
        </div>
        <div class="img-box">
          <img src="https://drive.google.com/uc?export=view&id=1cUGZUi7S3Ml9z_UfbNZTAC_JSkEZIZRO" alt="pug-2">
        </div>
      </li>  
      <li>
        <p class="name">pug-3</p>
        <div class="door-left">
          <div class="door-knob"></div>
        </div>
        <div class="door-right">
        <p class="phrase">The average dog is a nicer person than the average person.</p>
          <div class="door-knob"></div>
        </div>
        <div class="img-box">
          <img src="https://drive.google.com/uc?export=view&id=1AAs3sgkkQs4qzjNJZPDSNu9bUS-IprLB" alt="pug-3">
        </div>
      </li>
      <li>
        <p class="name">pug-4</p>
        <div class="door-left">
          <div class="door-knob"></div>
        </div>
        <div class="door-right">
          <div class="door-knob"></div>
          <p class="phrase">Dogs’ lives are too short. Their only fault, really.</p>
        </div>
        <div class="img-box">
          <img src="https://drive.google.com/uc?export=view&id=1LZJ1NseYtuGmxqkb2RfI6rTFFLp2VdO3" alt="pug-4">
        </div>
      </li>  
    </ul>
  </div>
</body>
              
            
!

CSS

              
                body {
  margin: 0;
  font-size: 16px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0;
}

.container {
  margin: 50px auto;
  width:95%;
}

.menu {
  margin: 0 auto;
  width: calc(100px * 4 * 1.1 *0.95);
  height: 100px;
  display: flex;
  justify-content: space-between;  
}

.menu li {
  display: flex;
  width: 100px;
  height: auto;
  box-sizing: border-box;
  box-shadow: 1px 2px 3px #bbb;
  -webkit-perspective: 800px;
  perspective: 800px;
}

.door-left, .door-right {
  position: relative;
  width: 50%;
  height: 100%;
  box-sizing: border-box;
  z-index: 1;
  transition: 1s ease-in;
  background: linear-gradient(to bottom right, rgba(216,237,255,0.2) 0%, rgba(255,255,255,0.2) 50%, rgba(216,237,255,0.2) 100%);
}

.door-left {
  border: 0.5px solid #aaa;
  transform-origin: left;
}

.door-right {
  border: 0.5px solid #aaa;
  transform-origin: right;
}

.door-knob {
  position: absolute;
  top: 45px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  content: "";
  background: linear-gradient(135deg, rgb(137,121,108) 0%,rgb(137,121,108) 0%,rgb(137,121,108) 0%,rgb(242,240,227) 50%,rgb(137,121,108) 100%);
  filter: drop-shadow(1px 1px 1px #444);
  z-index: 3;
}

.door-left .door-knob {
  right: 7px;
}

.door-right .door-knob {
  left: 7px;
}

.name, .img-box {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.name {
  padding: 2.5%;
  box-sizing: border-box;
  text-align: center;
  font-size: 0.5em;
  color: #666;
  text-shadow: 0.5px 0.5px 0.5px #fff;
  z-index: 2;
}

.phrase {
  width: 140%;
  height: 50px;
  font-size: 10px;
  font-family: serif;
  line-height: 1.3;
  transform: scale(0.65) translate(-20%, 70px);
}

.img-box {
  opacity: 0.1;
  transition: all 1s ease 0.5s;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

img {
  width: 100px;
  height: 100%;
}

.menu li:hover .door-left {
  transform: rotate3d(0, 1, 0, -110deg);
  transition: all 1s ease-in-out 0s;
}

.menu li:hover .door-right {
  transform: rotate3d(0, 1, 0, 110deg);
  transition: all 1s ease-in-out 0s;
}

.menu li:hover .img-box {
  opacity: 10;
}
              
            
!

JS

              
                
              
            
!
999px

Console