mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:29:45 +00:00
изменила контактную форму, доработала навбар, партнёры
This commit is contained in:
1 parent
79fc2eeb98
commit
d24fecd5e4
25 files changed
+620
-236
No files matched your search
@@ -11,130 +11,121 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
transition: transform 0.3s ease-out, height 0.3s ease-out,
|
||||
background-color 0.8s ease-out;
|
||||
transition: transform 0.3s ease-out, height 0.3s ease-out, background-color 0.8s ease-out;
|
||||
|
||||
&.hidden {
|
||||
transform: translateY(-110%); // Убираем navbar вверх
|
||||
transform: translateY(-110%); // Убираем navbar вверх
|
||||
}
|
||||
|
||||
&:not(.hidden) {
|
||||
transform: translateY(0); // Показываем navbar
|
||||
transform: translateY(0); // Показываем navbar
|
||||
}
|
||||
|
||||
&.transparent {
|
||||
background-color: transparent !important;
|
||||
transition: none;
|
||||
background-color: transparent !important;
|
||||
transition: none;
|
||||
|
||||
.bar .nav-link {
|
||||
color: $text-secondary;
|
||||
.bar .nav-link {
|
||||
color: $text-secondary;
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
color: black;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
color: black;
|
||||
.burger .line {
|
||||
background-color: #ffffff;
|
||||
&.open {
|
||||
background-color: #072ac8; // Синий цвет, когда меню открыто
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.burger .line {
|
||||
background-color: #ffffff;
|
||||
|
||||
&.open {
|
||||
background-color: #072ac8; // Синий цвет, когда меню открыто
|
||||
}
|
||||
.logo {
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
}
|
||||
|
||||
.logo {
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
}
|
||||
|
||||
.nav-link:has(> .logo) {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
display: flex;
|
||||
height: 100%;
|
||||
align-items: center;
|
||||
|
||||
.logo {
|
||||
width: $navbar-logo-height;
|
||||
height: auto;
|
||||
}
|
||||
.logo {
|
||||
width: $navbar-logo-height;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.nav-link {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
letter-spacing: 0em;
|
||||
padding: 0.25em;
|
||||
margin-left: 40px;
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
.nav-link {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
letter-spacing: 0em;
|
||||
padding: .25em;
|
||||
margin-left: 40px;
|
||||
color: black;
|
||||
text-decoration: none;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
|
||||
.nav-link::after {
|
||||
background: $text-secondary;
|
||||
}
|
||||
.nav-link::after {
|
||||
background: $text-secondary;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
// height: $navbar-height;
|
||||
// padding: $navbar-padding-tb 5%;
|
||||
height: $navbar-height;
|
||||
padding: $navbar-padding-tb 5%;
|
||||
|
||||
// .nav-link:has(> .logo) .logo {
|
||||
// width: $navbar-logo-mini-height;
|
||||
// }
|
||||
|
||||
.bar {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: white;
|
||||
width: 50%;
|
||||
height: 200vh;
|
||||
z-index: 9;
|
||||
padding: 60px 0px;
|
||||
|
||||
&.open {
|
||||
display: flex;
|
||||
.nav-link:has(> .logo) .logo {
|
||||
width: $navbar-logo-mini-height;
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
padding: 10px 5px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
.bar {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: white;
|
||||
width: 50%;
|
||||
height: 200vh;
|
||||
z-index: 9;
|
||||
padding: 60px 0px;
|
||||
|
||||
.burger {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
z-index: 10;
|
||||
&.open {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 25px;
|
||||
height: 3px;
|
||||
background-color: #072ac8;
|
||||
margin: 4px 0;
|
||||
transition: all 0.3s ease;
|
||||
.nav-link {
|
||||
padding: 10px 5px;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.burger {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
z-index: 10;
|
||||
|
||||
.line {
|
||||
width: 25px;
|
||||
height: 3px;
|
||||
background-color: #072ac8;
|
||||
margin: 4px 0;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
height: $navbar-height;
|
||||
padding: $navbar-padding-tb 5%;
|
||||
|
||||
.nav-link:has(> .logo) .logo {
|
||||
width: $navbar-logo-mini-height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import NavbarLink from "./NavbarLink";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
||||
import logo from "@/shared/assets/images/sсb_blue.svg";
|
||||
import "./Navbar.styles.scss";
|
||||
@@ -50,6 +51,9 @@ function Navbar({ links = mock }: NavbarProps) {
|
||||
const [navbarHidden, setNavbarHidden] = useState(false); // true = спрятан, false = виден
|
||||
const [lastScrollTop, setLastScrollTop] = useState(0);
|
||||
const THRESHOLD = 400; // navbar не скрывается в первые 400px
|
||||
const [isTransparent, setIsTransparent] = useState(true);
|
||||
const [scrolledOnce, setScrolledOnce] = useState(false);
|
||||
const location = useLocation(); // отслеживаем путь
|
||||
|
||||
const toggleMenu = () => {
|
||||
setIsOpen(!isOpen);
|
||||
@@ -59,6 +63,17 @@ function Navbar({ links = mock }: NavbarProps) {
|
||||
setIsOpen(false); // Закрываем меню при клике на ссылку
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (location.pathname === "/") {
|
||||
setIsTransparent(true);
|
||||
setScrolledOnce(false);
|
||||
window.scrollTo(0, 0);
|
||||
} else {
|
||||
setIsTransparent(false);
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
|
||||
// Для навбара
|
||||
useEffect(() => {
|
||||
const navbar = document.getElementById("navbar");
|
||||
@@ -73,25 +88,43 @@ function Navbar({ links = mock }: NavbarProps) {
|
||||
const handleScroll = () => {
|
||||
const currentScrollTop = window.pageYOffset;
|
||||
|
||||
if (currentScrollTop <= THRESHOLD) {
|
||||
setNavbarHidden(false);
|
||||
} else {
|
||||
if (currentScrollTop > lastScrollTop) {
|
||||
setNavbarHidden(true);
|
||||
} else {
|
||||
if (!isOpen) {
|
||||
if (currentScrollTop <= THRESHOLD) {
|
||||
setNavbarHidden(false);
|
||||
} else {
|
||||
if (currentScrollTop > lastScrollTop) {
|
||||
setNavbarHidden(true);
|
||||
} else {
|
||||
setNavbarHidden(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Прозрачность исчезает при первом скролле на главной
|
||||
if (
|
||||
location.pathname === "/" &&
|
||||
!scrolledOnce &&
|
||||
currentScrollTop > 50
|
||||
) {
|
||||
setIsTransparent(false);
|
||||
setScrolledOnce(true);
|
||||
}
|
||||
|
||||
setLastScrollTop(currentScrollTop);
|
||||
};
|
||||
|
||||
window.addEventListener("scroll", handleScroll);
|
||||
return () => window.removeEventListener("scroll", handleScroll);
|
||||
}, [lastScrollTop]);
|
||||
}, [lastScrollTop, scrolledOnce, location.pathname, isOpen]);
|
||||
|
||||
|
||||
return (
|
||||
<div id="navbar">
|
||||
<div
|
||||
id="navbar"
|
||||
className={`${isTransparent ? "transparent" : ""} ${navbarHidden ? "hidden" : ""
|
||||
}`}
|
||||
>
|
||||
|
||||
<NavbarLink className="logo-container" link={{ to: "/" }}>
|
||||
<img src={logo} className="logo" alt="SCB logo" />
|
||||
</NavbarLink>
|
||||
|
||||
Reference in new issue
Block a user