mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 06:19:45 +00:00
изменила моб версию меню
This commit is contained in:
1 parent
9fc9755a74
commit
72c66667f9
2 files changed
+132
-12
No files matched your search
@@ -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;
|
||||
|
||||
&::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.nav-link::after {
|
||||
background: 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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: (
|
||||
<a style={{
|
||||
fontSize: "19.2px",
|
||||
color: "inherit",
|
||||
fontWeight: "600",
|
||||
}} href="mailto:skb@sfedu.ru">
|
||||
skb@sfedu.ru
|
||||
</a>
|
||||
),
|
||||
phone: (
|
||||
<a style={{ color: "inherit", fontSize: "19.2px", }} href="tel:+79780095480">
|
||||
+7 (978) 009-54-80
|
||||
</a>
|
||||
),
|
||||
};
|
||||
|
||||
function Navbar({ links = mock }: NavbarProps) {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const [navbarHidden, setNavbarHidden] = useState(false);
|
||||
@@ -107,6 +129,7 @@ function Navbar({ links = mock }: NavbarProps) {
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
id="navbar"
|
||||
className={`${isTransparent ? "transparent" : ""} ${navbarHidden ? "hidden" : ""
|
||||
@@ -128,8 +151,17 @@ function Navbar({ links = mock }: NavbarProps) {
|
||||
key={index}
|
||||
/>
|
||||
))}
|
||||
<div className="mobile-contacts">
|
||||
{mockContacts.phone}
|
||||
{mockContacts.email}
|
||||
<HashLink smooth to="/contact#contact-form-anchor" className={"btn"}>
|
||||
Связаться с нами
|
||||
</HashLink>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={`overlay ${isOpen ? "open" : ""}`} onClick={toggleMenu}></div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user