react-slide-out
Version:
React simple slider
158 lines (131 loc) • 2.38 kB
CSS
.SlideWrapper {
position: absolute;
right: 0;
top: 0;
bottom: 0;
left: 0;
z-index: 665;
}
.SlideWrapper--close {
animation: undim 0.4s ease-out forwards;
}
.SlideWrapper--open {
animation: dim 0.3s ease-out forwards;
}
.SlideModal {
transition: width 0.3s ease-out;
}
.h-textRight {
text-align: right;
}
.h-overflowHidden {
overflow: hidden ;
}
.h-overflowAuto {
overflow: auto ;
}
.h-displayFlex {
display: flex ;
}
.h-flexCol {
flex-direction: column ;
}
.h-flexSpaceBetween {
justify-content: space-between ;
}
.SlideModal {
position: fixed;
/*right: -50%;*/
top: 0;
bottom: 0;
width: 50%;
min-width: 320px;
background-color: #efefef;
z-index: 666;
}
.SlideModal--right {
right: -50%;
}
.SlideModal--left {
left: -50%;
}
.SlideModal--open.SlideModal--right {
animation: slideIn--right 0.3s ease-out forwards;
}
.SlideModal--open.SlideModal--left {
animation: slideIn--left 0.3s ease-out forwards;
}
@media (max-width: 520px) {
.SlideModal--open {
width: 100%;
}
}
.SlideModal--close.SlideModal--right {
animation: slideOut--right 0.3s ease-out forwards;
}
.SlideModal--close.SlideModal--left {
animation: slideOut--left 0.3s ease-out forwards;
}
.SlideModal__header {
display: flex;
align-items: center;
background-color: #fff;
overflow: hidden;
box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.2);
z-index: 667;
}
.SlideModal__footer {
box-shadow: 0 -3px 2px 0 rgba(0, 0, 0, 0.2);
}
.SlideModal__title {
padding-left: 15px;
color: #000;
}
@keyframes dim {
from {
background-color: transparent;
}
to {
background-color: rgba(0, 0, 0, 0.5);
}
}
@keyframes undim {
from {
background-color: rgba(0, 0, 0, 0.5);
}
to {
background-color: transparent;
}
}
@keyframes slideIn--right {
0% {
right: calc(-100%);
}
100% {
right: 0;
}
}
@keyframes slideOut--right {
0% {
right: 0;
}
100% {
right: calc(-100%);
}
}
@keyframes slideIn--left {
0% {
left: calc(-100%);
}
100% {
left: 0;
}
}
@keyframes slideOut--left {
0% {
left: 0;
}
100% {
left: calc(-100%);
}
}