title: Book opening and closing animation css
body: <p>I have been playing with book opening code on w3 schools. I have changed it slightly so that the page opens like a book when hovered upon. I need the page to go back with the reverse animation when not hovered upon.</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>body {
    font-family: Arial, Helvetica, sans-serif;
  }
  
  .flip-card {
    background-color: transparent;
    width: 300px;
    height: 300px;
    perspective: 1000px;
  }
  
  .flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  }
  
  .flip-card:hover .flip-card-inner {
    transform-origin: 100% 0;
    transform: rotateY(180deg);
  }
  
  .flip-card-front,
  .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
  }
  
  .flip-card-front {
    background-color: #bbb;
    color: black;
  }
  
  .flip-card-back {
    background-color: #2980b9;
    color: white;
    transform: rotateY(180deg);
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;h1&gt;Card Flip with Text&lt;/h1&gt;
  &lt;h3&gt;Hover over the image below:&lt;/h3&gt;
  
  &lt;div class="flip-card"&gt;
    &lt;div class="flip-card-inner"&gt;
      &lt;div class="flip-card-front"&gt;
        &lt;img src="img_avatar.png" alt="Avatar" style="width:300px;height:300px;"&gt;
      &lt;/div&gt;
      &lt;div class="flip-card-back"&gt;
        &lt;h1&gt;John Doe&lt;/h1&gt;
        &lt;p&gt;Architect &amp; Engineer&lt;/p&gt;
        &lt;p&gt;We love that guy&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>When the hover is removed, the page should go back with the reverse animation.</p>