/
engineunity_sub
/
doxml_work_site
Обзор
Документация
Войти
/
engineunity_sub
/
doxml_work_site
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
master
src/css/sections/header.css
378 строк
8 KB
PauloChaser
move content from branch dev to master
12 фев 2025, 18:06
12 фев 2025, 18:06
a2e2735
Код
Авторство
О чём код?
.header { position: relative } .header__row { -webkit-box-pack: center } /* Header */ .header { padding-top: 40px; padding-bottom: 40px; position: sticky; top: 0; left: 0; background-color: white; z-index: 100; box-shadow: 1px 1px 5px var(--blue); } /*.header::before {*/ /* content: '';*/ /* width: 60%;*/ /* height: 40px;*/ /* position: absolute;*/ /* left: 0;*/ /* top: 0;*/ /* background-color: #fff*/ /*}*/ @media screen and (max-height: 1000px) { .header { padding-top: 20px; padding-bottom: 20px; } } .header__logoWrapper, .header__wrapper { display: -webkit-box; display: -ms-flexbox } .header__row { display: flex; align-items: center; justify-content: space-between; } .header__logoWrapper { display: flex; align-items: center; } .header__logo { max-width: 217px; max-height: 31px } .header__nav { display: flex; gap: 20px; margin: 0 auto; } .header__navLink { color: var(--black); text-decoration: none; font-size: 18px; transition: 0.2s ease; padding: 10px 0; } .header__navLink:hover { color: var(--blue); } /* Обёртка для выпадающего меню */ .header__navDropdown { position: relative; display: inline-block; padding: 10px 0; } .header__navDropdown:before { content: ''; position: absolute; width: 100px; height: 15px; left: 0; bottom: 0; } .header__navText { color: var(--black); font-size: 18px; transition: color 0.2s ease; } .header__navDropdown:hover .header__navText { color: var(--blue); } .header__dropdownMenu { position: absolute; top: 100%; left: 0; background-color: white; box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); border-radius: 6px; overflow: hidden; z-index: 10; min-width: 180px; opacity: 0; transform: translateY(-20px); transition: opacity 0.2s ease 0.2s, transform 0.2s ease 0.2s, pointer-events 0s ease; pointer-events: none; } .header__dropdownItem { display: block; padding: 10px 15px; color: var(--black); text-decoration: none; font-size: 16px; transition: background 0.2s ease; } .header__dropdownItem:hover { background-color: var(--blue); color: white; } .header__navDropdown:hover .header__dropdownMenu { opacity: 1; transform: translateY(0); pointer-events: auto; transition: opacity 0.2s ease, transform 0.2s ease, pointer-events 0s ease 0.3s; } .header__rightSide { width: 217px; display: flex; justify-content: flex-end; } .header__button { background-color: var(--blue); color: #fff; padding: 12px 36px; border-radius: 24px; text-decoration: none; font-size: 16px; } .header__button:hover { background-color: #0056b3; } /*Burger*/ .header__burger { display: none; } @media screen and (max-width: 991px) { .header { padding-top: 25px; padding-bottom: 20px; } .header::before { height: 25px } .header__logoWrapper { margin-bottom: -5px; } .header__rightSide { width: auto; margin-left: auto; margin-right: 20px; } .header__button { padding: 8px 20px; border-radius: 24px; text-decoration: none; font-size: 14px; } .header__burger { display: flex; flex-direction: column; justify-content: space-between; width: 30px; height: 20px; cursor: pointer; } .header__burgerLine { display: block; height: 3px; background-color: var(--black); transition: 0.3s; } /*.header__nav {*/ /* display: none;*/ /*}*/ /*.header--open .header__nav {*/ /* display: flex;*/ /* flex-direction: column;*/ /* justify-content: center;*/ /* grid-gap: 12px;*/ /* position: absolute;*/ /* width: 100%;*/ /* left: 0;*/ /* top: 80px;*/ /* background: white;*/ /* padding: 20px;*/ /* box-shadow: 1px 1px 10px var(--black);*/ /*}*/ /* Открытие меню */ .header__nav { position: absolute; opacity: 0; transform: translateY(-10px); transition: opacity 0.3s ease, transform 0.3s ease, background-color 0s 0.3s; pointer-events: none; display: flex; flex-direction: column; justify-content: center; grid-gap: 12px; width: 100%; left: 0; top: 80px; z-index: 10; } .header__dropdownMenu { position: static; opacity: 1; } .header__navLink,.header__navDropdown { opacity: 0; transform: translateY(-20px); transition: opacity 0s ease, transform 0.3s ease; } .header--open .header__nav { transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.1s; opacity: 1; transform: translateY(0); pointer-events: auto; background: white; padding: 20px; box-shadow: 1px 1px 10px var(--black); } .header--open .header__navLink, .header--open .header__navDropdown { opacity: 1; transform: translateY(0); transition: opacity 0.3s ease, transform 0.3s ease; } .header__burgerLine:nth-child(1), .header__burgerLine:nth-child(3) { transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease, top 0.4s ease; position: relative; } .header__burgerLine:nth-child(2) { transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1) 0.2s, opacity 0.3s ease 0.2s, top 0.4s ease 0.2s; } .header--open .header__burgerLine:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1) 0.3s, opacity 0.3s ease, top 0.4s ease; } .header--open .header__burgerLine:nth-child(2) { transform: translateY(8px); opacity: 0; transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.3s ease 0.2s, top 0.4s ease; } .header--open .header__burgerLine:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1) 0.3s, opacity 0.3s ease, top 0.4s ease; } .header__burgerLine:nth-child(1), .header__burgerLine:nth-child(3) { transform-origin: center; } .header__logo { max-width: 109px; max-height: 16px } .header__navDropdown { padding: 0; margin-bottom: 5px; } .header__navText { display: none; } .header__dropdownMenu { display: flex; flex-direction: column; align-items: flex-start; grid-gap: 25px; background: none; box-shadow: none; transform: none; transition: none; transition-duration: unset; } .header__dropdownItem { display: block; padding: 0; position: static; font-size: 18px; color: var(--black); text-align: center; transition: none; } .header__dropdownItem:hover { background: none; color: var(--blue); } .header__navDropdown:hover .header__dropdownMenu { transform: none; transition: none; } } @media (max-width: 550px) { .header__nav { display: flex; flex-direction: column; align-items: center; } .header__dropdownMenu { align-items: center; } }