modal animation

by Joe

HTML

<div id="costumModal23" class="modal" data-easein="perspectiveUpIn" tabindex="-1" role="dialog" aria-labelledby="costumModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
          ×
        </button>
        <h4 class="modal-title">
          Modal Header
        </h4>
      </div>
      <div class="modal-body">
        <p>
          “ War is an ugly thing, but not the ugliest of things. The decayed and degraded state of moral and patriotic feeling which thinks that nothing is worth war is much worse. The person who has nothing for which he is willing to fight, nothing which is more important than his own personal safety, is a miserable creature and has no chance of being free unless made and kept so by the exertions of better men than himself. ” — John Stuart Mill
        </p>
      </div>
      <div class="modal-footer">
        <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">
          Close
        </button>
        <button class="btn btn-primary">
          Save changes
        </button>
      </div>
    </div>
  </div>
</div>

CSS

background-color: #E0E0E0;

font-family: 'Roboto',
sans-serif
}

a[data-toggle="modal"] {
  margin: 5px;
}

.title {
  color: #757575;

  font-weight: bold;
}

.modal {
  text-align: left;
}

.modal-content {
  border: none;
  border-radius: 2px;
  box-shadow: 0 16px 28px 0 rgba(0, 0, 0, 0.22), 0 25px 55px 0 rgba(0, 0, 0, 0.21);
}

.modal-header {
  border-bottom: 0;
  padding-top: 15px;
  padding-right: 26px;
  padding-left: 26px;
  padding-bottom: 0px;
}

.modal-title {
  font-size: 34px;
}

.modal-body {
  border-bottom: 0;
  padding-top: 5px;
  padding-right: 26px;
  padding-left: 26px;
  padding-bottom: 10px;
  font-size: 15px;
}

.modal-footer {
  border-top: 0;
  padding-top: 0px;
  padding-right: 26px;
  padding-bottom: 26px;
  padding-left: 26px;
}

.btn-default,
.btn-primary {
  border: none;
  border-radius: 2px;
  display: inline-block;
  color: #424242;

  background-color: #FFF;

  text-align: center;
  height: 36px;
  line-height: 36px;
  outline: 0;
  padding: 0 2rem;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  letter-spacing: .5px;
  transition: .2s ease-out;
}

.btn-default:hover {
  background-color: #FFF;

  box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}

.btn-primary {
  color: #FFF;

  background-color: #2980B9;

}

.btn-primary:hover {
  background-color: #2980B9;

  box-shadow: 0 5px 11px 0 rgba(0, 0, 0, 0.18), 0 4px 15px 0 rgba(0, 0, 0, 0.15);
}

footer {
  text-align: center;
  margin: 15px;
}

footer h4 {
  font-size: 2.92rem;
  font-weight: 100;
  margin: 1.46rem 0 1.168rem;
}

JavaScript

$(".modal").each(function(l) {
  $(this).on("show.bs.modal", function(l) {
    var o = $(this).attr("data-easein");
    "shake" == o ? $(".modal-dialog").velocity("callout." + o) : "pulse" == o ? $(".modal-dialog").velocity("callout." + o) : "tada" == o ? $(".modal-dialog").velocity("callout." + o) : "flash" == o ? $(".modal-dialog").velocity("callout." + o) : "bounce" == o ? $(".modal-dialog").velocity("callout." + o) : "swing" == o ? $(".modal-dialog").velocity("callout." + o) : $(".modal-dialog").velocity("transition." + o)
  })
});