How to Create a Popup in Shopify Without an App for FREE - eCommerce Thesis

How to Create a Popup in Shopify Without an App for FREE

<div class="container">
      <button class="toggle button" data-target="myPopup">Size Guide</button>
      
      <div id="myPopup" class="popup hide">
        <div class="popup-header">
          Size Guide
          <span class="close toggle" data-target="myPopup">close</span>
        </div>
        <div class="popup-body">
          Welcome to our Size Guide! We understand that finding the right size can sometimes be a challenge when shopping online. To make your experience as smooth as possible, we've put together this comprehensive size guide to help you find the perfect fit for our products.
       
        <ul>
        <li><strong>X-Small (XS)</strong>: Bust 30-32 inches, Waist 23-25 inches, Hips 33-35 inches</li>
        <li><strong>Small (S)</strong>: Bust 32-34 inches, Waist 25-27 inches, Hips 35-37 inches</li>
        <li><strong>Medium (M)</strong>: Bust 34-36 inches, Waist 27-29 inches, Hips 37-39 inches</li>
        <li><strong>Large (L)</strong>: Bust 36-38 inches, Waist 29-31 inches, Hips 39-41 inches</li>
        <li><strong>X-Large (XL)</strong>: Bust 38-40 inches, Waist 31-33 inches, Hips 41-43 inches</li>
    </ul>
        </div>
        <div class="popup-footer">
          <button class="toggle button" data-target="myPopup">Got it !</button>
        </div>
      </div>
    </div>
$(document).on('click', '.toggle', function(event) {
  event.preventDefault();
  
  var target = $(this).data('target');
  $('#' + target).toggleClass('hide');
});
.hide {
  visibility: hidden;
  opacity: 0;
  transform: translateX(-50%) translateY(-50%) scale(0.8) !important;
  -moz-transform: translateX(-50%) translateY(-50%) scale(0.8) !important;
  -o-transform: translateX(-50%) translateY(-50%) scale(0.8) !important;
  -webkit-transform: translateX(-50%) translateY(-50%) scale(0.8) !important;
}

.close {
    position: absolute;
    right: 0;
    top: 0;
    width: 51px;
    height: 51px;
    font-size: 0;
    cursor: pointer;
}

.close:before, .close:after {
  content: '';
    position: absolute;
    background: #767676;
    -moz-border-radius: 1px;
    -webkit-border-radius: 1px;
    -o-border-radius: 1px;
    border-radius: 1px;
    left: 14px;
    right: 14px;
    top: 30px;
    height: 3px;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    transform: rotate(45deg);
    transition: all 100ms ease-in;
    -moz-transition: all 100ms ease-in;
    -webkit-transition: all 100ms ease-in;
    -o-transition: all 100ms ease-in;
}

.close:after {
     -moz-transform: rotate(-45deg);
    -webkit-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    transform: rotate(-45deg);
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translateX(-50%) translateY(-50%);
    -moz-transform: translateX(-50%) translateY(-50%);
    -o-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
    background: #FAFDFF;
    -moz-border-radius: 5px;
    -o-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    width: 600px;
    box-shadow: 0px 7px 10px rgba(0, 0, 0, 0.09), 0px 11px 12px 7px rgba(0, 0, 0, 0.02);
    -moz-transition: all 120ms;
    -webkit-transition: all 120ms;
    -o-transition: all 120ms;
    transition: all 120ms;
    z-index: 99;
  padding: 25px;
  color: #5E5E5E;
}

@media screen and (max-width: 1000px) {
  .popup {
    width: 80%;
  }
}

.popup-header {
  text-transform: uppercase;
  font-size: 18px;
}

.popup-body {
  padding: 25px 0;
}

.button {
    border: 1px solid #F5F5F5;
    text-transform: uppercase;
    box-shadow: 1px 2px 3px #F5F5F5;
    color: #fff;
    cursor: pointer;
    transition: all 120ms ease-in;
    outline: none;
}

.button:hover {
  box-shadow: 1px 3px 5px #E9E9E9;
  transform: translateY(-1px);
}

.button:active, .button:visited {
  transform: translateY(1px);
  outline:none;
  box-shadow: 1px 2px 3px #F5F5F5;
}