feat: adiciona submenu mobile

This commit is contained in:
Cainã Milech 2022-12-06 21:49:09 -03:00
parent 6811b1270b
commit d92f680d74
3 changed files with 74 additions and 13 deletions

View File

@ -57,6 +57,9 @@
top: 0; top: 0;
left: 0; left: 0;
z-index: map-get($z-index, level-5); z-index: map-get($z-index, level-5);
transform: translateX(
-100%
); /*deslocar/esconder elemento no eixo x*/
width: 100%; width: 100%;
height: 100%; height: 100%;
background: $white-500; background: $white-500;
@ -69,6 +72,8 @@
@include mq(lg, max) { @include mq(lg, max) {
flex: 1; /*para empurrar o account para baixo*/ flex: 1; /*para empurrar o account para baixo*/
flex-direction: column; flex-direction: column;
position: relative;
overflow: hidden auto; /*hidden horizontal, auto vertical*/
} }
@include mq(lg, min) { @include mq(lg, min) {
@ -148,18 +153,33 @@
.submenu { .submenu {
position: absolute; position: absolute;
width: 100%;
@include mq(lg, max) {
top: 0;
left: 100%; /*para ficar no escondido, no final do pai a direita*/
height: 100%;
overflow: auto;
padding-bottom: 34px;
background: $white-500;
}
@include mq(lg, min) {
top: calc( top: calc(
100% + 32px 100% + 32px
); /*100% ficar no final do pai (header) // +32 pra ter efeito vindo de baixo, no hover nao tem*/ ); /*100% ficar no final do pai (header) // +32 pra ter efeito vindo de baixo, no hover nao tem*/
left: 0;
z-index: map-get($z-index, level-4); z-index: map-get($z-index, level-4);
width: 100%; left: 0;
padding: 30px 0 43px; padding: 30px 0 43px;
background: rgba($white-500, 0.95); background: rgba($white-500, 0.95);
box-shadow: 0px 4px 4px rgba($black-500, 0.02); box-shadow: 0px 4px 4px rgba($black-500, 0.02);
opacity: 0; /*oculto parece q nao ta ali*/ opacity: 0; /*oculto parece q nao ta ali*/
pointer-events: none; /*mouse nao pode passar por ele*/ pointer-events: none; /*mouse nao pode passar por ele*/
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
}
&::before { &::before {
/*criar uma barra para ocupar o espaço do padding, para o submenu nao sumir, pois ainda estara com o mouse no submenu*/ /*criar uma barra para ocupar o espaço do padding, para o submenu nao sumir, pois ainda estara com o mouse no submenu*/
@ -172,16 +192,51 @@
background: transparent; background: transparent;
} }
.container {
@include mq(lg, max) {
padding: 0 16px;
}
}
&__return-button {
display: flex;
align-items: center;
width: 100%;
padding: 16px;
margin-bottom: 34px;
border: solid $gray-100;
border-width: 0 0 1px 0;
outline: 0;
text-align: left;
background: transparent;
i {
margin-right: 8px;
}
}
&__title { &__title {
margin: 0 0 8px; margin: 0 0 8px;
line-height: 24px; line-height: 24px;
font-size: 20px; font-size: 20px;
@include mq(lg, max) {
text-decoration-line: underline;
line-height: 14px;
font-size: 12px;
color: $blue-500;
}
} }
&__categories-wrapper { &__categories-wrapper {
margin-bottom: 16px;
@include mq(lg, min) {
display: flex; display: flex;
margin-bottom: 8px; margin-bottom: 8px;
} }
}
&__categories { &__categories {
margin-right: 30px; margin-right: 30px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

View File

@ -21,7 +21,13 @@
</a> </a>
<div class="submenu"> <div class="submenu">
<button class="submenu__return-button">
<i class="sprite sprite-menu-left-arrow-icon"></i>
VOLTAR
</button>
<div class="container"> <div class="container">
<h2 class="submenu__title">LOREM IPSUM</h2> <h2 class="submenu__title">LOREM IPSUM</h2>
<div class="submenu__categories-wrapper"> <div class="submenu__categories-wrapper">