Expanding card

Shows a card expanding out from the parent card on hover

by thirdender

HTML

<div class="card">
  <div class="info"></div>
  <div class="extra"></div>
</div>

SCSS

body {
  background: #282727;
  margin: 20px;
}
.card {
  position: relative;
  display: inline-block;
  perspective: 240px;
  .info, .extra {
    transition: all 0.3s ease;
    border-radius: 4px;
  }
  .info {
    position: relative;
    z-index: 2;
    transform-style: preserve-3d;    
    background: #2e2e2e;
    height: 320px;
    width: 240px;
    box-shadow: 4px 4px 30px rgba(0, 0, 0, 0.06);
  }
  .extra {
    position: absolute;
    z-index: 1;
    top: 4px;
    bottom: 4px;
    left: 0;
    width: 100%;
    background: #252525;
  }
  &:hover {
    .info {
      transform: rotateY(-3deg) translateX(-8px) translateZ(4px);      
    }
    .extra {
      left: 100%;
      margin-left: -10px;
      box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1);
    }
  }
}