<div class="container">
    <article>
        <h1>Lorem Ipsum</h1>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        <p><span class="add">Add a comment</span></p>
    </article>
    
    <form class="comments">
        <h1>Form</h1>    
        <p><input placeholder="name"></p>
        <p><input placeholder="email"></p>
        <textarea placeholder="message"></textarea>
        <p><input type="submit"></p>
        <span class="cancel">Cancel</span>
    </form>
</div>
body {
  background: #333;
  font-family: Helvetica;
  padding: 20px;
}

.container {
  position: relative;
  width: 80%;
  margin: 20px auto;
  padding: 0;
}

article {
  position: relative;
  background: #ccc;
  margin: 0;
  padding: 20px;
  box-shadow: 0 0 15px #000, 0 1px 1px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.3) inset;
  z-index: 2;
  color: #333;
}

.add, .cancel {
  text-decoration: underline;
}

.comments {
  position: absolute;
  color: #222;
  padding: 20px;
  background: #ccc;
  transition: all 0.8s ease-in-out;
  box-shadow: 0 0 10px #000, 0 1px 0 rgba(255, 255, 255, 0.3) inset;
  width: 100%;
  box-sizing: border-box;
  width: auto;
  margin: 0 auto;
  top: 50px;
  left: 50px;
  opacity: 0;
}

@keyframes show-form {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 0;
    z-index: 1;
  }
  50% {
    transform: translate3d(-130%, -130px, 0);
    opacity: 1;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    z-index: 3;
  }
}

@keyframes hide-form {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    z-index: 3;
  }
  50% {
    transform: translate3d(-130%, -130px, 0);
    opacity: 1;
  }
  80% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
    z-index: 1;
  }
  to {
    opacity: 0;
  }
}

.showing {
  animation-name: show-form;
  animation-duration: 1s;
  animation-delay: 0;
  animation-fill-mode: both;
  animation-timing-function: ease-in-out;
  opacity: 1;
}

.hiding {
  z-index: 1;
  animation-name: hide-form;
  animation-duration: 1s;
  animation-delay: 0;
  animation-fill-mode: both;
  animation-timing-function: ease-in-out;
  opacity: 1;
  opacity: 0;
}
View Compiled
$('.add').click(function() {
    $('.comments').addClass('showing');
    $('.comments').removeClass('hiding');
});

$('.cancel').click(function() {
    $('.comments').addClass('hiding');
    $('.comments').removeClass('showing');
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

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