title: Modal sliding and opening
body: <p>I've created two modal's and I'm unsure how to make them both close with the same button. the first modal is closing fine, but, the second one won't close at all.</p>
  
  <p>I'm also looking to give them an animation to slide in and out. However, I can't work out how to add it to the code that I've already created. Can anyone suggest how I could do this?</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-js lang-js prettyprint-override"><code>document.getElementById('project-1').addEventListener("click", function() {
    document.querySelector('.side-modal').style.display = "flex";
  });
  
  document.getElementById('project-2').addEventListener("click", function() {
    document.querySelector('.side-modal.second').style.display = "flex";
  });
  
  document.querySelector('.close-side-modal').addEventListener("click", function() {
    document.querySelector('.side-modal, .side-modal.second').style.display = "none";
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.side-modal {
    width: 35%;
    position: fixed;
    height: 100%;
    background-color: #fff;
    top: 0;
    right: 0;
    bottom: 0;
    align-items: center;
    justify-content: center;
    -moz-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
    -webkit-box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
    box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
    display: none;
  }
  
  .side-modal .modal-content {
    height: 100%;
    width: unset;
  }
  
  .side-modal .close {
    color: #000 !important;
  }
  
  .button {
    font-size: 15px;
    color: #000;
  }
  
  .close {
    font-size: 40px;
    color: #fff;
    transform: rotate(45deg);
    position: absolute;
    right: 20px;
    top: 0px;
    font-weight: 200;
    cursor: pointer;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="#" id="project-1" class="project-1 button"&gt;project 1&lt;/a&gt;
  &lt;a href="#" id="project-2" class="project-2 button"&gt;project 2&lt;/a&gt;
  
  &lt;div class="side-modal"&gt;
    &lt;div class="modal-content"&gt;
      &lt;h2&gt;first modal&lt;/h2&gt;
      &lt;div class="close close-side-modal"&gt;+&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="side-modal second"&gt;
    &lt;div class="modal-content"&gt;
      &lt;h2&gt;second modal&lt;/h2&gt;
      &lt;div class="close close-side-modal"&gt;+&lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>