title: How can I reverse an animation after hover like a transition?
body: <p>CSS transitions animate back to the previous state, following the transition rules in reverse. But animations don't. They just go back to the original state abruptly (eg., when <code>:hover</code> or the class is removed). Is there a way to make animations behave like transitions (like the code below).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.box {
    width: 50px;
    height: 50px;
  }
  
  .box.transition {
    background-color: green;
    transition: 500ms linear all;
  }
  
  .box.transition:hover {
    width: 100px;
    height: 100px;
  }
  
  .box.animation {
    background-color: red;
    animation-duration: 500ms;
    animation-fill-mode: both;
    animation-timing-function: linear;
  }
  
  .box.animation:hover {
    animation-name: zoom;
  }
  
  @keyframes zoom {
    to {
      width: 100px;
      height: 100px;
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!-- If I "unhover" .box.animation, it goes back to the original state abruptly --&gt;
  &lt;div class="box transition"&gt;&lt;/div&gt;
  &lt;div class="box animation"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>