LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
CSS
body {
  background-color: #5f2c82;
  background-image: -webkit-linear-gradient(-360deg, #5f2c82 10%, #49a09d 90%);
  background-image: linear-gradient(90deg,#5f2c82 10%, #49a09d 90%);
}
body #mainContent {
  position: relative;
  margin: 16px auto;
  width: 320px;
  height: 568px;
  overflow: hidden;
  background-color: #f3f3f3;
  border-radius: 8px;
}
body #mainContent #topSection {
  position: relative;
  display: block;
  height: 240px;
  background-color: #55ccff;
}
body #modalContent {
  position: absolute;
  top: 64px;
  left: 0px;
  width: 320px;
  height: 440px;
  background: none;
  -webkit-transition: opacity 0.5s, -webkit-transform 0.5s cubic-bezier(0.5, 1.8, 0.8, 1.8);
  -moz-transition: opacity 0.5s, -moz-transform 0.5s cubic-bezier(0.5, 1.8, 0.8, 1.8);
  transition: opacity 0.5s, transform 0.5s cubic-bezier(0.5, 1.8, 0.8, 1.8);
}

.initialAddButton {
  position: absolute;
  top: 180px;
  right: 16px;
  width: 44px;
  height: 44px;
  background-color: #EF49B7;
  border-radius: 100%;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  transition: all 0.5s;
  z-index: 10;
}

.expandAddButton {
  top: 0px;
  right: 0px;
  width: 320px;
  height: 568px;
  border-radius: 0px;
}

.elementPlaceHolder {
  position: relative;
  display: block;
  width: 288px;
  height: 88px;
  margin: 16px;
  background-color: #F2DD9E;
  border-radius: 4px;
}

.iconLine, .iconLineVertical {
  position: absolute;
  width: 32px;
  height: 4px;
  left: 6px;
  top: 20px;
  background-color: white;
  border-radius: 4px;
  -webkit-transition: all 0.5s;
  -moz-transition: all 0.5s;
  transition: all 0.5s;
}

.iconLineVertical {
  -webkit-transform: rotate(90deg);
  -moz-transform: rotate(90deg);
  -ms-transform: rotate(90deg);
  -o-transform: rotate(90deg);
  transform: rotate(90deg);
}

.expandHorizontalLine {
  left: 270px;
  top: 32px;
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -ms-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

.expandVerticalLine {
  left: 270px;
  top: 32px;
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

.initialModalState {
  opacity: 0;
  z-index: -1;
}

.showModalContent {
  opacity: 1;
  z-index: 10;
  -webkit-transform: translateY(-20px);
  -moz-transform: translateY(-20px);
  -ms-transform: translateY(-20px);
  -o-transform: translateY(-20px);
  transform: translateY(-20px);
}
JS
$("#addButton").click(function(){
  $("#addButton").toggleClass("expandAddButton");
  $("#horizontalLine").toggleClass("expandHorizontalLine");
  $("#verticalLine").toggleClass("expandVerticalLine");  
  
  $("#modalContent").toggleClass("showModalContent");
});
Host Instantly Drag and Drop Website Builder

 

Description

Displaying a modal with a smooth transition from user's action, in this case tapping the '+' button.
Term
Mon, 11/27/2017 - 21:55

Related Codes

Pen ID
Pen ID
Pen ID