cleaner mobile animation

This commit is contained in:
oitsjustjose 2020-03-03 23:11:44 -05:00
commit c853e9795e
6 changed files with 120 additions and 51 deletions

View file

@ -5,8 +5,6 @@ body {
margin-right: 0px; margin-right: 0px;
} }
.blurred { .blurred {
filter: blur(5px); filter: blur(5px);
@ -19,7 +17,6 @@ body {
} }
} }
.bounce { .bounce {
-moz-animation: bounce 2s 10; -moz-animation: bounce 2s 10;
-webkit-animation: bounce 2s 10; -webkit-animation: bounce 2s 10;

View file

@ -110,29 +110,49 @@
} }
.sub.item { .sub.item {
display: block;
padding-left: 3rem; padding-left: 3rem;
background-color: lighten($background, 15%); background-color: lighten($background, 15%);
display: none; -moz-animation: disappear 250ms 1;
height: 0; -webkit-animation: disappear 250ms 1;
visibility: hidden; animation: disappear 250ms 1;
opacity: 0;
transition-duration: 200ms, 200ms; // USE HEIGHT TO ANIMATE
transition-property: visibility, opacity; max-height: 0;
&.visible { &.visible {
display: inline-flex; display: inline-flex;
height: 4rem;
visibility: visible; // USE HEIGHT TO ANIMATE
opacity: 1; max-height: 4rem;
transition-duration: 200ms, 0;
transition-property: opacity, visibility; -moz-animation: appear 250ms 1;
transition-delay: 0, 200ms; -webkit-animation: appear 250ms 1;
animation: appear 250ms 1;
} }
} }
} }
@keyframes appear {
0% {
max-height: 0;
}
100% {
max-height: 4rem;
}
}
@keyframes disappear {
0% {
max-height: 4rem;
}
100% {
max-height: 0;
}
}
.no-scroll { .no-scroll {
overflow: hidden; overflow: hidden;
} }

View file

@ -735,31 +735,57 @@ body {
} }
.mobile-menu .sub.item { .mobile-menu .sub.item {
display: block;
padding-left: 3rem; padding-left: 3rem;
background-color: #4b4b4b; background-color: #4b4b4b;
display: none; -webkit-animation: disappear 250ms 1;
height: 0; animation: disappear 250ms 1;
visibility: hidden; max-height: 0;
opacity: 0;
-webkit-transition-duration: 200ms, 200ms;
transition-duration: 200ms, 200ms;
-webkit-transition-property: visibility, opacity;
transition-property: visibility, opacity;
} }
.mobile-menu .sub.item.visible { .mobile-menu .sub.item.visible {
display: -webkit-inline-box; display: -webkit-inline-box;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
display: inline-flex; display: inline-flex;
height: 4rem; max-height: 4rem;
visibility: visible; -webkit-animation: appear 250ms 1;
opacity: 1; animation: appear 250ms 1;
-webkit-transition-duration: 200ms, 0; }
transition-duration: 200ms, 0;
-webkit-transition-property: opacity, visibility; @-webkit-keyframes appear {
transition-property: opacity, visibility; 0% {
-webkit-transition-delay: 0, 200ms; max-height: 0;
transition-delay: 0, 200ms; }
100% {
max-height: 4rem;
}
}
@keyframes appear {
0% {
max-height: 0;
}
100% {
max-height: 4rem;
}
}
@-webkit-keyframes disappear {
0% {
max-height: 4rem;
}
100% {
max-height: 0;
}
}
@keyframes disappear {
0% {
max-height: 4rem;
}
100% {
max-height: 0;
}
} }
.no-scroll { .no-scroll {

File diff suppressed because one or more lines are too long

View file

@ -735,31 +735,57 @@ body {
} }
.mobile-menu .sub.item { .mobile-menu .sub.item {
display: block;
padding-left: 3rem; padding-left: 3rem;
background-color: white; background-color: white;
display: none; -webkit-animation: disappear 250ms 1;
height: 0; animation: disappear 250ms 1;
visibility: hidden; max-height: 0;
opacity: 0;
-webkit-transition-duration: 200ms, 200ms;
transition-duration: 200ms, 200ms;
-webkit-transition-property: visibility, opacity;
transition-property: visibility, opacity;
} }
.mobile-menu .sub.item.visible { .mobile-menu .sub.item.visible {
display: -webkit-inline-box; display: -webkit-inline-box;
display: -ms-inline-flexbox; display: -ms-inline-flexbox;
display: inline-flex; display: inline-flex;
height: 4rem; max-height: 4rem;
visibility: visible; -webkit-animation: appear 250ms 1;
opacity: 1; animation: appear 250ms 1;
-webkit-transition-duration: 200ms, 0; }
transition-duration: 200ms, 0;
-webkit-transition-property: opacity, visibility; @-webkit-keyframes appear {
transition-property: opacity, visibility; 0% {
-webkit-transition-delay: 0, 200ms; max-height: 0;
transition-delay: 0, 200ms; }
100% {
max-height: 4rem;
}
}
@keyframes appear {
0% {
max-height: 0;
}
100% {
max-height: 4rem;
}
}
@-webkit-keyframes disappear {
0% {
max-height: 4rem;
}
100% {
max-height: 0;
}
}
@keyframes disappear {
0% {
max-height: 4rem;
}
100% {
max-height: 0;
}
} }
.no-scroll { .no-scroll {

File diff suppressed because one or more lines are too long