diff --git a/src/widgets/Navbar/Navbar.styles.scss b/src/widgets/Navbar/Navbar.styles.scss index 5b917de..abc5da5 100644 --- a/src/widgets/Navbar/Navbar.styles.scss +++ b/src/widgets/Navbar/Navbar.styles.scss @@ -90,29 +90,41 @@ } .bar { - display: none; + display: flex; flex-direction: column; position: fixed; top: 0; - right: 0; + right: -100%; background-color: white; - width: 50%; - height: 200vh; + width: 100%; + height: 100vh; z-index: 9; - padding: 60px 0px; + padding: 100px 30px 30px; + transition: transform 0.3s ease-in-out; + overflow-y: auto; &.open { - display: flex; + transform: translateX(-100%); } .nav-link { - padding: 10px 5px; + margin-left: 0; + padding: 15px 0; width: 100%; text-align: left; - } + font-size: 16px*1.2; + font-weight: 600; + color: black; + transition: color 0.3s ease; - .nav-link::after { - background: none; + &::after { + display: none; + } + + &:hover, + &:focus { + color: #072ac8; + } } } @@ -121,20 +133,96 @@ display: flex; flex-direction: column; z-index: 10; + cursor: pointer; .line { - width: 25px; + width: 30px; height: 3px; background-color: #072ac8; margin: 4px 0; transition: all 0.3s ease; + + &:nth-child(1).open { + transform: rotate(45deg) translate(5px, 5px); + } + + &:nth-child(2).open { + opacity: 0; + } + + &:nth-child(3).open { + transform: rotate(-45deg) translate(10px, -10px); + } } } + } +} +.overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + z-index: 8; + opacity: 0; + visibility: hidden; + transition: opacity 0.3s ease, visibility 0.3s ease; + + &.open { + opacity: 1; + visibility: visible; } } #navbar.transparent .bar .nav-link::after { background-color: $text-secondary; +} +.mobile-contacts { + display: none; + + @media (max-width: 1200px) { + display: flex; + flex-direction: column; + margin-top: auto; + text-align: left; + font-weight: 600; + color: black; + align-self: flex-start; + width: 100%; + + a { + display: block; + margin: 4px 0; + } + + .btn { + display: block; + width: 100%; + padding: 16px 24px; + margin: 20px auto 0; + border-radius: 8px; + border: none; + font-size: 20px; + font-weight: 600; + line-height: 24px; + color: white; + background: linear-gradient(93.25deg, #4942e4 0%, #11009e 50%, #4942e4 100%); + background-size: 200%; + background-position: 0%; + transition: background-position 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease; + cursor: pointer; + text-align: center; + text-decoration: none; + + &:hover { + background-position: 100%; + box-shadow: 0 8px 20px rgba(17, 0, 158, 0.25); + color: #ffffff; + } + } + + } } \ No newline at end of file diff --git a/src/widgets/Navbar/Navbar.tsx b/src/widgets/Navbar/Navbar.tsx index bc74791..1a0023d 100644 --- a/src/widgets/Navbar/Navbar.tsx +++ b/src/widgets/Navbar/Navbar.tsx @@ -1,7 +1,7 @@ import { useState, useEffect } from "react"; import NavbarLink from "./NavbarLink"; import { useLocation } from "react-router-dom"; - +import { HashLink } from "react-router-hash-link"; import logo from "@/shared/assets/images/sсb_blue.svg"; import "./Navbar.styles.scss"; @@ -46,6 +46,28 @@ const mock: LinkType[] = [ }, ]; +interface ContactsType { + email: JSX.Element; + phone: JSX.Element; +} + +const mockContacts: ContactsType = { + email: ( + + skb@sfedu.ru + + ), + phone: ( + + +7 (978) 009-54-80 + + ), +}; + function Navbar({ links = mock }: NavbarProps) { const [isOpen, setIsOpen] = useState(false); const [navbarHidden, setNavbarHidden] = useState(false); @@ -68,7 +90,7 @@ function Navbar({ links = mock }: NavbarProps) { setIsOpen(false); setNavbarHidden(false); setLastScrollTop(0); - + // Проверяем, нужно ли делать navbar прозрачным const shouldBeTransparent = location.pathname === "/" && window.pageYOffset <= 50; setIsTransparent(shouldBeTransparent); @@ -107,29 +129,39 @@ function Navbar({ links = mock }: NavbarProps) { return ( -