<div class="card">
  <div class="card-content">
    <h1>Just hover around</h1>
    <p><small>by <a href="https://www.fiverr.com/share/vLevr" target="_blank">Ariona, Rian</a></small></p>
    <p class="related"><strong>See also: </strong><a href="https://codepen.io/ariona/details/LVZLGP/" target="_blank">Staged dropdown animation</a></p>
  </div>
</div>

<div class="iklan">
  <p>Need PSD to HTML & CSS service?</p>
  <a href="https://www.fiverr.com/share/vLevr" target="_blank">Start from <strong>$50</strong></a>
</div>
@import url(https://fonts.googleapis.com/css?family=Playfair+Display:400,400italic,700);

body{
  background: #edf2f4;
  perspective: 1000px;
  transform-style: preserve-3d;
  display: flex;
  height: 100vh;
  font-family: "Playfair Display",georgia,serif;
}
.card{
  pointer-events: none;
  transform: translateZ(0);
  padding: 30px;
  background: white;
  border-radius: 5px;
  width: 400px;
  height: 200px;
  margin: auto;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  display: flex;
  box-shadow: 0 0 5px rgba(0,0,0,.1);
  position: relative;
  
  &:after{
    content:" ";
    position: absolute;
    width: 100%;
    height: 10px;
    border-radius: 50%;
    left:0;
    bottom:-50px;
    box-shadow: 0 30px 20px rgba(0,0,0,.3);
    
  }
  
  .card-content{
    margin: auto;
    text-align:center;
    transform-style: preserve-3d;
  }
  
  h1{
    transform: translateZ(100px);
  }
  p{
    transform: translateZ(50px);
    display: block;
    
    &.related{
      transform: translateZ(80px);
      font-style: italic;
    }
  }
  a{
    color:#69c6b8;
    pointer-events: auto;
  }
}

.iklan{
  position: fixed;
  bottom: 0;
  right: 0;
  background: white;
  width: 200px;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  
  p{
    margin: 0 0 15px;
    line-height: 1.4;
  }
  
  a{
    background-color: #ff4757;
    color: white;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 14px;
  }
}
// why it doesn't work on firefox?
var card = $(".card");

$(document).on("mousemove",function(e) {  
  var ax = -($(window).innerWidth()/2- e.pageX)/20;
  var ay = ($(window).innerHeight()/2- e.pageY)/10;
  card.attr("style", "transform: rotateY("+ax+"deg) rotateX("+ay+"deg);-webkit-transform: rotateY("+ax+"deg) rotateX("+ay+"deg);-moz-transform: rotateY("+ax+"deg) rotateX("+ay+"deg)");
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js