<div id="click"></div>
body {
  font-family: 'Helvetica', 'Arial', sans-serif;
}

div {
  position: relative;
  top: 40px;
  left: 50%;
  transform: translate(-50%, -50%);
  
  width: 280px;
  height: 76px;  
  display: flex;
  align-items: center;
  justify-content: center;
  
  border: 3px solid #a5a5a5;
  
  overflow: hidden;
  transition: .3s;

  &:before {
    display: block;
    content: 'DOWNLOAD';
    color: #a5a5a5;
    letter-spacing: 4px;
    font-weight: 200;
    opacity: 1;
  }
  &:after {
    content: ' ';
    position: absolute;
    top: 0;
    right: 110%;
    height: 100%;
    width: 200%;
    background: #a5a5a5;
    transition: inherit;
  }
}

.active {
  &:before {
    animation-name: check;
    animation-duration: 1s;
    animation-iteration-count: 2;
    animation-timing-function: ease-out;
    animation-direction: alternate;
    animation-delay: .3s;
  }
  &:after {
    right: -10%;
    animation-name: goaway;
    animation-duration: 1s;
    animation-iteration-count: 2;
    animation-timing-function: ease-out;
    animation-direction: alternate;
    animation-delay: .3s;
  }
  
  border: none;
  animation-name: shrink;
  animation-duration: 1s;
  animation-iteration-count: 2;
  animation-timing-function: ease-out;
  animation-direction: alternate;
  animation-delay: .3s;
}

@keyframes shrink {
  0% {
    opacity: 1;
    margin: 0;
  }
  10% {
    background-color: #a5a5a5;
    border-radius: 76px;
  }
  20% {
    width: 76px;
    height: 76px;
  }
  60% {
    border-radius: 100%;
    width: 76px;
    height: 76px;
    opacity: 1;
  }
  100% {
    border: none;
    width: 0;
    height: 0;
    opacity: 0;
  }
}

@keyframes check {
  0% {
    content: '✓';
    font-size: 3em;
  }
  20% {
    color: #fff;
    opacity: 1; 
  }
  80% {
    content: '✓';
    font-size: 2em;
    opacity: 1;
  }
  100% {
    content: '';
    opacity: 0;  
  }
}

@keyframes goaway {
  0% {
    opacity: 1;
  }  
  10% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
View Compiled
var element = document.getElementById('click');

element.addEventListener('click', function(e) {
    e.preventDefault();
    element.classList.toggle('active');
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.