generated from goitacademy/vanilla-app-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ReshetS/mobile-menu.css
Mobile menu.css
- Loading branch information
Showing
3 changed files
with
214 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,161 @@ | ||
/* Styles for Mobile menu */ | ||
.backdrop { | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 999; | ||
background-color: rgba(20, 20, 20, 0.4); | ||
opacity: 0; | ||
visibility: hidden; | ||
pointer-events: none; | ||
transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1), | ||
visibility 250ms cubic-bezier(0.4, 0, 0.2, 1); | ||
} | ||
|
||
.mobile-menu { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: #7a3145; | ||
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1); | ||
transform: translateX(100%); | ||
} | ||
|
||
.backdrop.is-open { | ||
opacity: 1; | ||
visibility: visible; | ||
pointer-events: auto; | ||
} | ||
|
||
.backdrop.is-open > .mobile-menu { | ||
transform: translateX(0); | ||
} | ||
|
||
.modal { | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
padding-bottom: 40px; | ||
padding-top: 240px; | ||
} | ||
|
||
.modal-btn { | ||
position: absolute; | ||
top: 20px; | ||
right: 20px; | ||
background-color: transparent; | ||
border: none; | ||
padding: 0; | ||
line-height: 0; | ||
} | ||
|
||
.modal-close-icon-mini { | ||
stroke: #fbfbfb; | ||
} | ||
|
||
.modal-close-icon-big { | ||
display: none; | ||
} | ||
|
||
.modal-menu { | ||
height: 100%; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
gap: 8px; | ||
flex-direction: column; | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
.modal-menu-item { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
border: 1px solid rgba(251, 251, 251, 0.4); | ||
border-radius: 12px; | ||
width: 115px; | ||
height: 42px; | ||
transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1); | ||
} | ||
|
||
.modal-menu-item:hover, | ||
.modal-menu-item:focus { | ||
background: #fbfbfb; | ||
} | ||
|
||
.modal-menu-item:hover > .modal-menu-link, | ||
.modal-menu-item:focus > .modal-menu-link { | ||
color: #7a3145; | ||
} | ||
|
||
.modal-menu-link { | ||
font-weight: 500; | ||
font-size: 14px; | ||
line-height: 1.28571; | ||
letter-spacing: -0.02em; | ||
text-align: center; | ||
color: #fbfbfb; | ||
transition: color 250ms cubic-bezier(0.4, 0, 0.2, 1); | ||
} | ||
|
||
.modal-menu-item-shop { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: center; | ||
align-items: center; | ||
border: 1px solid rgba(251, 251, 251, 0.2); | ||
border-radius: 30px; | ||
width: 155px; | ||
height: 50px; | ||
margin-top: auto; | ||
} | ||
|
||
.modal-menu-link-shop { | ||
font-weight: 600; | ||
font-size: 14px; | ||
line-height: 1.28571; | ||
letter-spacing: -0.01em; | ||
text-transform: uppercase; | ||
color: #fbfbfb; | ||
} | ||
|
||
.modal-menu-item-shop:hover, | ||
.modal-menu-item-shop:focus { | ||
background: #fbfbfb; | ||
} | ||
|
||
.modal-menu-item-shop:hover > .modal-menu-link-shop, | ||
.modal-menu-item-shop:focus > .modal-menu-link-shop { | ||
color: #7a3145; | ||
} | ||
|
||
@media screen and (min-width: 768px) and (max-width: 1279px) { | ||
.mobile-menu { | ||
width: 351px; | ||
right: 0; | ||
left: auto; | ||
} | ||
|
||
.modal-close-icon-mini { | ||
display: none; | ||
} | ||
|
||
.modal-close-icon-big { | ||
display: block; | ||
stroke: #fbfbfb; | ||
} | ||
} | ||
|
||
@media screen and (min-width: 1280px) { | ||
.backdrop.is-open { | ||
opacity: 0; | ||
visibility: hidden; | ||
pointer-events: none; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,55 @@ | ||
<div class="mobile-menu"> | ||
<div class="modal"> | ||
<button type="button" class="modal-btn"> | ||
<svg | ||
class="modal-close-icon-mini" | ||
width="20" | ||
height="20" | ||
aria-label="close-icon" | ||
onclick="closeMobileMenu()" | ||
> | ||
<use href="./img/icons.svg#miniX"></use> | ||
</svg> | ||
<svg | ||
class="modal-close-icon-big" | ||
width="24" | ||
height="24" | ||
aria-label="close-icon" | ||
onclick="closeMobileMenu()" | ||
> | ||
<use href="./img/icons.svg#bigX"></use> | ||
</svg> | ||
</button> | ||
<ul class="modal-menu"> | ||
<li class="modal-menu-item"> | ||
<a href="#how-it-works" class="modal-menu-link">how it works</a> | ||
</li> | ||
<li class="modal-menu-item"> | ||
<a href="#vegetables" class="modal-menu-link">vegetables</a> | ||
</li> | ||
<li class="modal-menu-item-shop"> | ||
<a href="#reviews" class="modal-menu-link">reviews</a> | ||
</li> | ||
<li class=""> | ||
<a href="#your-order" class="modal-menu-link-shop">shop now</a> | ||
</li> | ||
</ul> | ||
<div class="backdrop" id="mobile-menu"> | ||
<div class="mobile-menu"> | ||
<div class="modal container"> | ||
<button type="button" class="modal-btn" onclick="closeMobileMenu()"> | ||
<svg | ||
class="modal-close-icon-mini" | ||
width="20" | ||
height="20" | ||
aria-label="close-icon" | ||
> | ||
<use href="./img/icons.svg#miniX"></use> | ||
</svg> | ||
<svg | ||
class="modal-close-icon-big" | ||
width="24" | ||
height="24" | ||
aria-label="close-icon" | ||
> | ||
<use href="./img/icons.svg#bigX"></use> | ||
</svg> | ||
</button> | ||
<ul class="modal-menu"> | ||
<li class="modal-menu-item"> | ||
<a | ||
href="#how-it-works" | ||
class="modal-menu-link" | ||
onclick="closeMobileMenu()" | ||
>how it works</a | ||
> | ||
</li> | ||
<li class="modal-menu-item"> | ||
<a | ||
href="#vegetables" | ||
class="modal-menu-link" | ||
onclick="closeMobileMenu()" | ||
>vegetables</a | ||
> | ||
</li> | ||
<li class="modal-menu-item"> | ||
<a href="#reviews" class="modal-menu-link" onclick="closeMobileMenu()" | ||
>reviews</a | ||
> | ||
</li> | ||
<li class="modal-menu-item-shop"> | ||
<a | ||
href="#your-order" | ||
class="modal-menu-link-shop" | ||
onclick="closeMobileMenu()" | ||
>shop now</a | ||
> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> |