Skip to content

Instantly share code, notes, and snippets.

@Rockbeard
Created March 19, 2018 12:11
Show Gist options
  • Save Rockbeard/faa9092cd794289af2dd53930ac52e39 to your computer and use it in GitHub Desktop.
Save Rockbeard/faa9092cd794289af2dd53930ac52e39 to your computer and use it in GitHub Desktop.
/* ASIDE
===== */
.u-shadow-aside {
opacity: 0;
height: 100%;
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: -1;
background: rgba(0, 0, 0, 0.25);
}
.u-aside {
overflow-y: auto;
width: 75%;
height: 100%;
position: fixed;
top: 0;
left: -100%;
z-index: 1;
background-color: #fff;
}
.btn-aside-close {
width: 35px;
height: 35px;
position: absolute;
left: 10px;
top: 10px;
background: url(../img/aside-icon-x.svg) no-repeat center center/contain;
}
/* TOGGLE BUTTON */
.btn-aside-open {
height: 66px;
width: 66px;
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.aside-open_bar {
background: #000;
display: block;
height: 2px;
width: 18px;
margin: 0 auto;
}
.aside-open_bar + .aside-open_bar {
margin-top: 4px;
}
/* MODIFICATORS
============ */
.m-bunner-hide {
display: none;
}
/* ANIMATIONS
========== */
.m-shadow-hide {
animation: m-shadow-hide 0.5s forwards;
}
.m-shadow-show {
animation: m-shadow-show 0.5s forwards;
}
@keyframes m-shadow-hide {
from {
opacity: 1;
z-index: 3;
}
99% {
z-index: 3;
}
to {
opacity: 0;
z-index: -1;
}
}
@keyframes m-shadow-show {
from {
opacity: 0;
z-index: -1;
}
1% {
z-index: 3;
}
to {
opacity: 1;
z-index: 3;
}
}
.m-aside-show {
animation: m-aside-show 0.5s forwards;
}
.m-aside-hide {
animation: m-aside-hide 0.5s forwards;
}
@keyframes m-aside-hide {
from {
left: 0;
z-index: 3;
}
to {
left: -100%;
z-index: 1;
}
}
@keyframes m-aside-show {
from {
left: -100%;
z-index: 1
}
to {
left: 0;
z-index: 3;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment