Skip to content

Instantly share code, notes, and snippets.

@diestrin
Last active December 22, 2015 15:18
Show Gist options
  • Save diestrin/6491152 to your computer and use it in GitHub Desktop.
Save diestrin/6491152 to your computer and use it in GitHub Desktop.
#menu {
position: absolute;
top: 0;
bottom: 0;
right: 0;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
width: 30%;
transform: translate(0%, 0);
&.open-menu {
transform: translate(100%, 0);
animation-name: open-menu;
animation-duration: 0.7s;
}
&.close-menu {
animation-name: close-menu;
animation-duration: 0.7s;
}
}
@keyframes open-menu {
0% {
transform: translate(100%, 0);
}
100% {
transform: translate(0%, 0);
}
}
@keyframes close-menu {
0% {
transform: translate(0%, 0);
}
100% {
transform: translate(100%, 0);
}
}
#menu {
position: absolute;
top: 0;
bottom: 0;
right: 0;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
width: $menu-width;
@include translateX(0%);
&.open-menu {
@include translateX(100%);
@include experimental(animation-name, open-menu);
@include experimental(animation-duration, 0.7s);
}
&.close-menu {
@include experimental(animation-name, close-menu);
@include experimental(animation-duration, 0.7s);
}
}
@include keyframes(open-menu) {
0% {
@include translateX(100%);
}
100% {
@include translateX(0%);
}
}
@include keyframes(close-menu) {
0% {
@include translateX(0%);
}
100% {
@include translateX(100%);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment