diff --git a/assets/css/index.css b/assets/css/index.css index f89d8eb..75327c8 100644 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -366,6 +366,20 @@ h3 { color: #dcdcdc; border-color: white; } +.button--order--white { + background-color: #ffffff; + border-color: #ffffff; + color: #4d4d4d; +} +.button--order--white:hover { + color: #ffffff; + border-color: #ffffff; + background-color: #609eff; +} +.button--order--white:active { + border-color: #ffffff; + background-color: #3081ff; +} .button--prev, .button--next { height: 60px; width: 60px; @@ -494,6 +508,7 @@ h3 { align-items: center; gap: 36px; padding: 0 30px 0 35px; + transition: transform ease-in-out 0.2s; } @media (max-width: 1240px) { .header__nav { @@ -505,7 +520,21 @@ h3 { } @media (max-width: 992px) { .header__nav { - display: none; + position: fixed; + top: 70px; + left: 0; + right: 0; + flex-direction: column; + gap: 0; + padding: 7px 7px 44px; + border-radius: 40px 7px; + background-color: #609eff; + transform: translateX(-200%); + } +} +@media (max-width: 992px) { + .header__nav.active { + transform: translateX(0); } } .header__nav-link { @@ -517,6 +546,54 @@ h3 { font-size: 14px; } } +@media (max-width: 992px) { + .header__nav-link { + display: block; + width: 100%; + padding: 23px; + box-sizing: border-box; + font-weight: 500; + font-size: 22px; + line-height: 130%; + letter-spacing: 0.01em; + text-align: center; + color: #ffffff; + border-bottom: 1px solid rgba(255, 255, 255, 0.2); + } +} +@media (max-width: 992px) { + .header__nav-link:hover { + color: #ffffff; + opacity: 0.8; + } +} +@media (max-width: 992px) { + .header__nav-link:active { + color: #ffffff; + opacity: 0.6; + } +} +.header__nav-phone { + display: none; +} +@media (max-width: 992px) { + .header__nav-phone { + display: inline-block; + margin: 36px 0; + font-weight: 700; + font-size: 28px; + text-align: center; + color: #ffffff; + } +} +.header__nav .button { + display: none; +} +@media (max-width: 992px) { + .header__nav .button { + display: inline-block; + } +} .header__social { display: flex; align-items: center; @@ -553,6 +630,7 @@ h3 { border-radius: 30px; background: url(../img/icons/burger.svg) center no-repeat; background-color: #609eff; + background-size: 14px; transition: all ease-in-out 0.1s; cursor: pointer; } @@ -565,6 +643,9 @@ h3 { .header__burger:active { background-color: #3081ff; } +.header__burger.active { + background-image: url(../img/icons/close.svg); +} .footer { margin-top: -106px; diff --git a/assets/js/main.js b/assets/js/main.js index 51a9169..c5d5f7f 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,3 +2,4 @@ import './sliders.js'; import './step-by-step.js'; import './team.js'; import './faq.js'; +import './nav.js'; diff --git a/assets/js/nav.js b/assets/js/nav.js new file mode 100644 index 0000000..7298256 --- /dev/null +++ b/assets/js/nav.js @@ -0,0 +1,20 @@ +const burger = document.querySelector('.header__burger'); +const headerNav = document.querySelector('.header__nav'); + +if (burger && headerNav) { + burger.addEventListener('click', () => { + headerNav.classList.toggle('active'); + burger.classList.toggle('active'); + }); + + headerNav.addEventListener('click', (event) => { + const isLink = event.target.classList.contains('header__nav-link'); + const isPhone = event.target.classList.contains('header__nav-phone'); + const isButton = event.target.classList.contains('button'); + + if (isLink || isPhone || isButton) { + headerNav.classList.remove('active'); + burger.classList.remove('active'); + } + }); +} diff --git a/assets/scss/_l-header.scss b/assets/scss/_l-header.scss index b72e43d..9a48ff9 100644 --- a/assets/scss/_l-header.scss +++ b/assets/scss/_l-header.scss @@ -21,6 +21,7 @@ align-items: center; gap: 36px; padding: 0 30px 0 35px; + transition: transform ease-in-out 0.2s; @include desktop { flex: 1 1 auto; @@ -30,7 +31,22 @@ } @include laptop { - display: none; + position: fixed; + top: 70px; + left: 0; + right: 0; + flex-direction: column; + gap: 0; + padding: 7px 7px 44px; + border-radius: 40px 7px; + background-color: $blue; + transform: translateX(-200%); + } + + &.active { + @include laptop { + transform: translateX(0); + } } &-link { @@ -40,6 +56,55 @@ @include desktop { font-size: 14px; } + + @include laptop { + display: block; + width: 100%; + padding: 23px; + box-sizing: border-box; + font-weight: 500; + font-size: 22px; + line-height: 130%; + letter-spacing: 0.01em; + text-align: center; + color: $white; + border-bottom: 1px solid rgba($color: $white, $alpha: 0.2); + } + + &:hover { + @include laptop { + color: $white; + opacity: 0.8; + } + } + + &:active { + @include laptop { + color: $white; + opacity: 0.6; + } + } + } + + &-phone { + display: none; + + @include laptop { + display: inline-block; + margin: 36px 0; + font-weight: 700; + font-size: 28px; + text-align: center; + color: $white; + } + } + + & .button { + display: none; + + @include laptop { + display: inline-block; + } } } @@ -81,6 +146,7 @@ border-radius: 30px; background: url(../img/icons/burger.svg) center no-repeat; background-color: $blue; + background-size: 14px; transition: all ease-in-out 0.1s; cursor: pointer; @@ -92,5 +158,9 @@ &:active { background-color: $darkblue; } + + &.active { + background-image: url(../img/icons/close.svg); + } } } diff --git a/assets/scss/_m-button.scss b/assets/scss/_m-button.scss index 6c587b1..20dda6a 100644 --- a/assets/scss/_m-button.scss +++ b/assets/scss/_m-button.scss @@ -112,6 +112,23 @@ color: #dcdcdc; border-color: rgba($color: $white, $alpha: 1.0); } + + &--white { + background-color: $white; + border-color: $white; + color: $darkgrey; + + &:hover { + color: $white; + border-color: $white; + background-color: $blue; + } + + &:active { + border-color: $white; + background-color: $darkblue; + } + } } &--prev, diff --git a/index.html b/index.html index 5a0b597..bfc9f63 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,10 @@ Цены Частые вопросы Контакты + + 8 (800) 101-21-27 + +