Modals

Javascript dependency

Modal uses remodal plugin /bower_components/remodal/dist/remodal.js
Documentation for remodal: https://github.com/VodkaBears/Remodal

Files

app/styles/modules/_modals.scss
app/scripts/modules/modals.js

Modals

Modal window can contain text or any UI controls such as forms, buttons etc. Modal windows retain focus until dismissed or a required action has been taken.

Modal component is complex component containing .modal as window wrapper and .modal_header, .modal_content and .modal_footer as inner sections of modal window. Modal window component can be created by following HTML structure in example below.

To display modal window after page load add attribute: remodal-open-on-load="remodal-open-on-load"

Example:code
Code:
<article class="modal remodal" data-remodal-id="modal-example" data-remodal-options="hashTracking: false">
  <header class="modal_header">
    <div class="modal_header_headline">
      <h3 class="no-mrg text-ellipsis">Modal header</h3>
    </div>
    <div class="modal_header_action">
      <button class="btn btn-link btn-icon-only" type="button" data-remodal-action="close">
        <i class="icon icon-m">close</i>
      </button>
    </div>
  </header>
  <section class="modal_content">
    ...
  </section>
  <footer class="modal_footer">
    <div class="btn-line pull-right">
      <button class="btn" type="button" data-remodal-action="close">Cancel
      </button>
      <button class="btn btn-primary" type="button" data-remodal-action="confirm">Ok
      </button>
    </div>
  </footer>
</article>

<!-- Large modal -->
<article class="modal modal-l remodal">
  ...
</article>

Modal consent

Example:code
Code:
<article class="modal modal--secondary modal--compact remodal" data-remodal-id="modal-example" data-remodal-options="hashTracking: false">
  <header class="modal_header">
    <div class="modal_header_headline">
      <h3 class="no-mrg text-bold text-ellipsis">Pravidlá používania cookies</h3>
    </div>
    <div class="modal_header_action">
      <button class="btn btn-link btn-icon-only" type="button" data-remodal-action="close">
        <i class="icon icon-m">close</i>
      </button>
    </div>
  </header>
  <section class="modal_content">
    ...
  </section>
  <footer class="modal_footer">
    <div class="btn-line pull-right">
      <button class="btn btn-ghost-primary btn-small" type="button" data-remodal-action="close">Nesúhlasím
      </button>
      <button class="btn btn-primary btn-small" type="button" data-remodal-action="confirm">Súhlasím
      </button>
    </div>
  </footer>
</article>

Delete user modal

Example:code
Code:
<!-- Modal 1 -->
<article class="modal modal-l remodal modal--rating" data-remodal-id="delete-user-modal-example" data-remodal-options="hashTracking: false" tabindex="-1">
  <header class="modal_header">
    <div class="modal_header_headline">
      <div class="text-center mrg-20-bottom text-medium">Vymazať profil</div>
    </div>
    <div class="modal_header_action">
      <button class="btn btn-link btn-icon-only" type="button" data-remodal-action="close"><i class="icon icon-m">close</i>
      </button>
    </div>
    <div class="modal_user-picture" style="background-image:url(/images/sample-user.jpg);"></div>
  </header>
  <section class="modal_content text-center no-pad-bottom">
    <p class="no-mrg-top text-center">Peter Skrovan</p>
    <h2 class="h2 text-center mrg-20-bottom text-bold">Naozaj si želáte vymazať profil?</h2>
    <div class="checkbox mrg-20-bottom mrg-10-top">
      <input class="checkbox-input" id="ip-1" type="checkbox">
      <label class="checkbox-custom" for="ip-1"></label>
      <label class="checkbox-label" for="ip-1">Želám si vymazat všetky údaje ktoré o mne evidujete.</label>
    </div>
  </section>
  <footer class="modal_footer modal_footer--no-border">
    <div class="btn-line text-center mrg-40-bottom">
      <button class="btn btn-ghost-blue text-uppercase" type="button" data-remodal-action="close">Späť
      </button>
      <button class="btn btn-blue text-uppercase" type="button" data-remodal-action="confirm" data-remodal-target="delete-user-2-modal-example">Vymazať
      </button>
    </div>
  </footer>
</article>


<!-- Modal 2 -->
<article class="modal modal-l remodal modal--rating" data-remodal-id="delete-user-2-modal-example" data-remodal-options="hashTracking: false" tabindex="-1">
  <header class="modal_header">
    <div class="modal_header_headline">
      <div class="text-center mrg-20-bottom text-medium">&nbsp;</div>
    </div>
    <div class="modal_header_action">
      <button class="btn btn-link btn-icon-only" type="button" data-remodal-action="close"><i class="icon icon-m">close</i>
      </button>
    </div>
    <div class="modal_user-picture" style="background-image:url(/images/sample-user.jpg);"></div>
  </header>
  <section class="modal_content text-center">
    <p class="no-mrg-top text-center">Peter Skrovan</p>
    <h2 class="text-bold mrg-50-top mrg-80-bottom"><i class="icon icon-m icon--circle text-color-blue-green mrg-20-right">check</i>Váš profil bol vymazaný!
    </h2>
  </section>
</article>

Rating modal

Example:code
Code:
<article class="modal modal-l modal--rating">
  <header class="modal_header">
    <div class="modal_header_headline">
      <h1 class="h3 no-mrg text-center text-bold">AromaSoul Elements Massage</h1>
      <div class="text-center text-small">Completed on 15.8.2017</div>
      <div class="modal_user-picture" style="background-image:url(/images/sample-user.jpg);"></div>
    </div>
    <div class="modal_header_action">
      <button class="btn btn-link btn-icon-only" type="button" icononly="iconOnly" data-remodal-action="close"><i class="icon icon-m">close</i>
      </button>
    </div>
  </header>
  <section class="modal_content">
    <p class="no-mrg-top text-center">Peter Skrovan</p>
    <h2 class="h1 text-center mrg-20-bottom text-bold">How satisfied were you with your service?</h2>
    <div class="row">
      <div class="col-l-12 text-center">
        <div class="rating-picker rating-picker--l mrg-30-bottom">
          <div class="rating-picker__indicator">4 <span class="text-color-grey-600">/ 5</span></div><a class="rating-picker__item" href="javascript:;">
            <div class="rating-picker__item-image rating-picker__item-image--1"></div>
            <div class="rating-picker__item-description">Trash</div></a><a class="rating-picker__item" href="javascript:;">
            <div class="rating-picker__item-image rating-picker__item-image--2"></div>
            <div class="rating-picker__item-description">Bad</div></a><a class="rating-picker__item" href="javascript:;">
            <div class="rating-picker__item-image rating-picker__item-image--3"></div>
            <div class="rating-picker__item-description">Okay</div></a><a class="rating-picker__item" href="javascript:;">
            <div class="rating-picker__item-image rating-picker__item-image--4"></div>
            <div class="rating-picker__item-description">Satisfied</div></a><a class="rating-picker__item" href="javascript:;">
            <div class="rating-picker__item-image rating-picker__item-image--5"></div>
            <div class="rating-picker__item-description">Excellent</div></a>
        </div>
      </div>
    </div>
    <div class="row form-row">
      <div class="form-label col">
        <label class="text-color-grey-600 mrg-5-bottom" for="rating-modal-comment">Comment</label>
      </div>
      <div class="form-controls col">
        <input class="input input--bordered-grey" id="rating-modal-comment" placeholder="Leave a comment about your session with the customer" type="text">
      </div>
    </div>
  </section>
  <footer class="modal_footer modal_footer--no-border">
    <div class="btn-line text-center mrg-20-bottom">
      <button class="btn btn-ghost-blue" type="button" data-remodal-action="close">Cancel
      </button>
      <button class="btn btn-blue" type="button" data-remodal-action="confirm">Ok
      </button>
    </div>
  </footer>
</article>