mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:19:45 +00:00
Merge branch 'Team' into refactoring
This commit is contained in:
commit
1a0ff4cf56
33 files changed
+1099
-397
No files matched your search
@@ -3,27 +3,23 @@ $icon-size: 24px;
|
||||
$color-file-button: rgb(7, 42, 200);
|
||||
|
||||
.contact-form {
|
||||
padding: 20px 22px;
|
||||
padding: 1.3rem 32px;
|
||||
border-radius: 16px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: $bg-form;
|
||||
margin-top: 20px;
|
||||
align-items: flex-start;
|
||||
|
||||
h2 {
|
||||
margin-top: 0;
|
||||
min-width: 400px;
|
||||
font-size: 28px;
|
||||
font-weight: 500;
|
||||
line-height: 44px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
font-size: 20px;
|
||||
min-width: 0;
|
||||
}
|
||||
}
|
||||
.smart-captcha {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.inputs {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -41,7 +37,6 @@ $color-file-button: rgb(7, 42, 200);
|
||||
padding: 12px 16px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
}
|
||||
@@ -50,6 +45,7 @@ $color-file-button: rgb(7, 42, 200);
|
||||
height: 300px;
|
||||
line-height: 30px;
|
||||
resize: none;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
height: 200px;
|
||||
}
|
||||
@@ -77,16 +73,21 @@ $color-file-button: rgb(7, 42, 200);
|
||||
|
||||
.upload-file-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
border: none; // Убрана рамка
|
||||
padding: 0;
|
||||
|
||||
.icon {
|
||||
filter: invert(15%) sepia(100%) saturate(2861%) hue-rotate(229deg)
|
||||
brightness(93%) contrast(120%);
|
||||
filter: invert(15%) sepia(100%) saturate(2861%) hue-rotate(229deg) brightness(93%) contrast(120%);
|
||||
}
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
font-size: 18px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
font-size: 16px;
|
||||
}
|
||||
@@ -118,7 +119,7 @@ $color-file-button: rgb(7, 42, 200);
|
||||
}
|
||||
}
|
||||
|
||||
.file-input input:focus + .upload-file-btn {
|
||||
.file-input input:focus+.upload-file-btn {
|
||||
outline: -webkit-focus-ring-color auto 1px;
|
||||
}
|
||||
|
||||
@@ -126,11 +127,31 @@ $color-file-button: rgb(7, 42, 200);
|
||||
.submit {
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
|
||||
padding: 12px;
|
||||
font-size: 18px;
|
||||
line-height: normal;
|
||||
margin-top: 0;
|
||||
|
||||
&:disabled {
|
||||
background-color: #aaaaaa;
|
||||
color: dimgrey;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.agree-checkbox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px; // Расстояние между чекбоксом и текстом
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox-container {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
@@ -17,13 +17,16 @@ import {
|
||||
const formSchema = z.object({
|
||||
name: z.string().min(1, "Обязательное поле"),
|
||||
email: z.string().email("Некорректный email. Пример 123@sfedu.ru"),
|
||||
phone: z.string()
|
||||
.min(1, "Обязательное поле")
|
||||
.regex(/^\+7\s?\(?\d{3}\)?\s?\d{3}[-.\s]?\d{2}[-.\s]?\d{2}$/, "Некорректный номер телефона"),
|
||||
message: z.string().min(1, "Обязательное поле"),
|
||||
file: z
|
||||
.any() // Используем `any`, чтобы избежать ошибки типа
|
||||
.any()
|
||||
.optional()
|
||||
.nullable()
|
||||
.refine(
|
||||
(file) => !file || file.length === 0 || file instanceof File, // Проверяем, что это File, если значение есть
|
||||
(file) => !file || file.length === 0 || file instanceof File,
|
||||
"Файл должен быть экземпляром File"
|
||||
)
|
||||
.refine(
|
||||
@@ -37,6 +40,7 @@ const formSchema = z.object({
|
||||
)
|
||||
.transform((value) => value ?? undefined),
|
||||
captcha: z.string().min(1, "Требуется проверка капчи"),
|
||||
agree: z.boolean().refine(val => val, "Необходимо согласие на обработку данных"),
|
||||
});
|
||||
|
||||
type FormData = z.infer<typeof formSchema>;
|
||||
@@ -55,9 +59,11 @@ function ContactForm() {
|
||||
defaultValues: {
|
||||
name: "",
|
||||
email: "",
|
||||
phone: "",
|
||||
message: "",
|
||||
file: undefined,
|
||||
captcha: "",
|
||||
agree: false,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -65,7 +71,31 @@ function ContactForm() {
|
||||
|
||||
const file = watch("file");
|
||||
const fileAttached = !!file && file instanceof File;
|
||||
console.log(file);
|
||||
const agree = watch("agree");
|
||||
|
||||
const handlePhoneChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
let value = e.target.value.replace(/\D/g, '');
|
||||
|
||||
if (value.length === 0 || value === '7') {
|
||||
setValue("phone", "");
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.length === 1) {
|
||||
value = `+7 ${value}`;
|
||||
} else if (value.length <= 4) {
|
||||
value = `+7 (${value.slice(1)}`;
|
||||
} else if (value.length <= 7) {
|
||||
value = `+7 (${value.slice(1, 4)}) ${value.slice(4)}`;
|
||||
} else if (value.length <= 9) {
|
||||
value = `+7 (${value.slice(1, 4)}) ${value.slice(4, 7)}-${value.slice(7)}`;
|
||||
} else {
|
||||
value = `+7 (${value.slice(1, 4)}) ${value.slice(4, 7)}-${value.slice(7, 9)}-${value.slice(9, 11)}`;
|
||||
}
|
||||
|
||||
setValue("phone", value, { shouldValidate: true });
|
||||
};
|
||||
|
||||
const handleFileChange = async (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
const selectedFile = e.target.files?.[0];
|
||||
setValue("file", selectedFile || undefined, { shouldValidate: true });
|
||||
@@ -87,12 +117,18 @@ function ContactForm() {
|
||||
setValue("captcha", "");
|
||||
}, [setValue]);
|
||||
|
||||
const handleAgreeChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setValue("agree", e.target.checked, { shouldValidate: true });
|
||||
};
|
||||
|
||||
const onSubmit = async (data: FormData) => {
|
||||
const formData = new FormData();
|
||||
formData.append("name", data.name);
|
||||
formData.append("email", data.email);
|
||||
formData.append("phone", data.phone);
|
||||
formData.append("message", data.message);
|
||||
formData.append("captcha", data.captcha);
|
||||
formData.append("agree", data.agree.toString());
|
||||
|
||||
if (data.file instanceof File) {
|
||||
formData.append("file", data.file);
|
||||
@@ -133,6 +169,16 @@ function ContactForm() {
|
||||
register={register("email")}
|
||||
error={errors.email?.message}
|
||||
/>
|
||||
<Field
|
||||
type="tel"
|
||||
name="phone"
|
||||
placeholder="+7 (___) ___-__-__"
|
||||
disabled={isSubmitting || isPending}
|
||||
register={register("phone", {
|
||||
onChange: handlePhoneChange,
|
||||
})}
|
||||
error={errors.phone?.message}
|
||||
/>
|
||||
<Field
|
||||
type="textarea"
|
||||
name="message"
|
||||
@@ -141,7 +187,6 @@ function ContactForm() {
|
||||
register={register("message")}
|
||||
error={errors.message?.message}
|
||||
/>
|
||||
|
||||
<Field
|
||||
type="file"
|
||||
name="file"
|
||||
@@ -153,12 +198,25 @@ function ContactForm() {
|
||||
})}
|
||||
error={errors.file?.message}
|
||||
/>
|
||||
<div className="checkbox-container">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="agree"
|
||||
disabled={isSubmitting || isPending}
|
||||
{...register("agree")}
|
||||
onChange={handleAgreeChange}
|
||||
/>
|
||||
<label htmlFor="agree">
|
||||
Я согласен с <a href="https://www.study.sfedu.ru/privacypolicy?ysclid=m8anp507sz44008873" target="_blank" rel="noopener noreferrer">обработкой персональных данных</a>
|
||||
</label>
|
||||
{errors.agree && <span className="error-message">{errors.agree.message}</span>}
|
||||
</div>
|
||||
<div className="submit-container">
|
||||
{watch("captcha") ? (
|
||||
<Field
|
||||
type="submit"
|
||||
name="submit"
|
||||
disabled={isSubmitting || isPending}
|
||||
disabled={isSubmitting || isPending || !agree}
|
||||
/>
|
||||
) : (
|
||||
<div className="captcha-container">
|
||||
@@ -175,4 +233,4 @@ function ContactForm() {
|
||||
);
|
||||
}
|
||||
|
||||
export default ContactForm;
|
||||
export default ContactForm;
|
||||
@@ -8,6 +8,7 @@
|
||||
.half {
|
||||
flex: 1 1 50%;
|
||||
width: 100%;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.contact-form {
|
||||
|
||||
@@ -7,8 +7,8 @@ function ContactUs() {
|
||||
<br />
|
||||
<div className="block" id="contact-us">
|
||||
<h1 className="half">
|
||||
Нужна помощь?
|
||||
<br /> Команда способных IT-специалистов готова вам помочь!
|
||||
Есть вопросы?
|
||||
<br /> Команда способных<br />IT-специалистов готова<br />вам помочь!
|
||||
</h1>
|
||||
<ContactForm />
|
||||
</div>
|
||||
|
||||
@@ -1,130 +1,201 @@
|
||||
|
||||
#footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
height: 192px;
|
||||
padding: 0 10%;
|
||||
margin: 2em 0 0;
|
||||
background: $bg-footer;
|
||||
|
||||
// Добавление SVG-фона
|
||||
background-image: url("../../assets/images/backround/bg_footer_gray_02.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center bottom;
|
||||
background-size: cover; // или `contain` в зависимости от эффекта
|
||||
|
||||
.container-fluid {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
height: 70%;
|
||||
max-width: 30%;
|
||||
|
||||
.logo {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.contacts {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
//align-items: center;
|
||||
|
||||
max-height: 70%;
|
||||
height: 40%;
|
||||
height: 309px;
|
||||
padding: 45px 10%;
|
||||
margin: 2em 0 0;
|
||||
background: $bg-footer;
|
||||
|
||||
p {
|
||||
color: $text-secondary;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 16px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
|
||||
.link {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
width: 60px;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 100%;
|
||||
background-color: $bg-primary;
|
||||
|
||||
.icon {
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100vw;
|
||||
height: auto;
|
||||
padding: 1.5em 10%;
|
||||
position: relative;
|
||||
// Добавление SVG-фона
|
||||
background-image: url("../../shared/assets/images/backround/bg_footer_gray_02.svg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center bottom;
|
||||
background-size: cover; // или `contain` в зависимости от эффекта
|
||||
|
||||
.container-fluid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
height: auto;
|
||||
max-width: 60%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
height: 100%;
|
||||
|
||||
.logo {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
}
|
||||
.logo {
|
||||
height: auto;
|
||||
width: 256px;
|
||||
}
|
||||
}
|
||||
|
||||
.contacts {
|
||||
text-align: center;
|
||||
gap: 0.5em;
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
p {
|
||||
font-size: 16px;
|
||||
}
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
max-height: 70%;
|
||||
height: 100%;
|
||||
|
||||
p {
|
||||
color: $text-secondary;
|
||||
//font-size: 16px;
|
||||
font-family: Montserrat, sans-serif;
|
||||
font-weight: 400;
|
||||
line-height: 20px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
display: flex;
|
||||
gap: 17px;
|
||||
|
||||
.link {
|
||||
width: 45px;
|
||||
transition: background 0.3s ease;
|
||||
.link {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
&:hover {
|
||||
background-color: darken($bg-primary, 10%); //
|
||||
width: 42px;
|
||||
aspect-ratio: 1;
|
||||
border-radius: 100%;
|
||||
background-color: $bg-primary;
|
||||
|
||||
.icon {
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 65%;
|
||||
height: 65%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
|
||||
gap: 32px;
|
||||
justify-content: center;
|
||||
}
|
||||
.copyright {
|
||||
display: none;
|
||||
}
|
||||
.visible {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100vw;
|
||||
height: auto;
|
||||
padding: 1.5em 10%;
|
||||
position: relative;
|
||||
gap: 20px;
|
||||
|
||||
.visible {
|
||||
display: none !important;
|
||||
}
|
||||
.copyright {
|
||||
display: block !important; // Показываем текст внизу только в мобильной версии
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: white;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.container-fluid {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
height: auto;
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
.logo {
|
||||
height: auto;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.logo-container label {
|
||||
display: none !important; // Скрываем текст в мобильной версии
|
||||
}
|
||||
|
||||
.contacts {
|
||||
text-align: center;
|
||||
gap: 0.5em;
|
||||
width: 100%;
|
||||
padding: 10px 0;
|
||||
|
||||
p {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.links {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
|
||||
.link {
|
||||
width: 45px;
|
||||
transition: background 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
background-color: darken($bg-primary, 10%); //
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 65%;
|
||||
height: 65%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer-links-container {
|
||||
display: flex;
|
||||
flex-direction: column; /* Arrange links vertically */
|
||||
justify-content: space-between; /* Spread out the items */
|
||||
height: 100%; /* Make sure the container takes up full height */
|
||||
}
|
||||
|
||||
.footer-links {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 30px; // Между столбиками будет отступ
|
||||
|
||||
.footer-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px; // Расстояние между ссылками в одном столбике
|
||||
|
||||
a {
|
||||
color: white; // Белый цвет текста
|
||||
text-decoration: none; // Убираем подчеркивание
|
||||
font-size: 16px; // Размер текста
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.privacy-policy {
|
||||
align-self: flex-end; /* Align the "Политика конфиденциальности" link to the bottom */
|
||||
margin-top: auto; /* Ensure the link is pushed to the bottom */
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#root:has(#mainpageheader) #footer {
|
||||
background-image: url("../../assets/images/backround/bg_footer_gray.svg");
|
||||
}
|
||||
background-image: url("../../assets/images/backround/bg_footer_gray.svg");
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { useState, useEffect } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import FooterLink from "./FooterLink";
|
||||
import FooterContacts from "./FooterContacts";
|
||||
|
||||
@@ -8,35 +9,32 @@ import iconSfedu from "@/shared/assets/images/footer/iconSfedu.png";
|
||||
import iconVK from "@/shared/assets/images/footer/iconVK.svg";
|
||||
import "./Footer.styles.scss";
|
||||
|
||||
// Тип для ссылок
|
||||
interface LinkType {
|
||||
src: string;
|
||||
to: string;
|
||||
id?: string; // Добавляем опциональное поле id
|
||||
id?: string;
|
||||
}
|
||||
|
||||
// Тип для контактов
|
||||
interface ContactsType {
|
||||
email: JSX.Element;
|
||||
address: JSX.Element;
|
||||
phone: JSX.Element;
|
||||
}
|
||||
|
||||
// Тип для пропсов компонента Footer
|
||||
interface FooterProps {
|
||||
links?: Record<string, LinkType>; // Объект с ключами-строками и значениями типа LinkType
|
||||
links?: Record<string, LinkType>;
|
||||
contacts?: ContactsType;
|
||||
}
|
||||
|
||||
const mockLinks: Record<string, LinkType> = {
|
||||
ictis: {
|
||||
src: iconIctis,
|
||||
to: "https://ictis.sfedu.ru",
|
||||
},
|
||||
sfedu: {
|
||||
src: iconSfedu,
|
||||
to: "https://sfedu.ru",
|
||||
},
|
||||
ictis: {
|
||||
src: iconIctis,
|
||||
to: "https://ictis.sfedu.ru",
|
||||
},
|
||||
vk: {
|
||||
src: iconVK,
|
||||
to: "https://vk.com/skbkit",
|
||||
@@ -45,42 +43,75 @@ const mockLinks: Record<string, LinkType> = {
|
||||
|
||||
const mockContacts: ContactsType = {
|
||||
email: (
|
||||
<a style={{ color: "inherit" }} href="mailto:skb@sfedu.ru">
|
||||
<a style={{
|
||||
fontSize: "24px",
|
||||
color: "inherit",
|
||||
fontWeight: "500",
|
||||
}} href="mailto:skb@sfedu.ru">
|
||||
skb@sfedu.ru
|
||||
</a>
|
||||
),
|
||||
phone: (
|
||||
<a style={{ color: "inherit", fontSize: "24px", }} href="tel:+79780095480">
|
||||
+7 (978) 009-54-80
|
||||
</a>
|
||||
),
|
||||
address: (
|
||||
<a
|
||||
style={{ color: "inherit" }}
|
||||
style={{ color: "inherit", fontSize: "16px" }}
|
||||
href="https://yandex.ru/maps/?text=г.%20Таганрог,%20пер.%20Тургеневский,%2044"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
г. Таганрог, пер. Тургеневский, 44
|
||||
</a>
|
||||
),
|
||||
phone: (
|
||||
<a style={{ color: "inherit" }} href="tel:+79780095480">
|
||||
+7 (978) 009-54-80
|
||||
<div style={{ marginBottom: "5px" }}>
|
||||
<span style={{ color: "#898989" }}>Таганрог</span>
|
||||
</div>
|
||||
пер. Тургеневский, 44
|
||||
|
||||
</a>
|
||||
),
|
||||
};
|
||||
|
||||
function Footer({ links = mockLinks, contacts = mockContacts }: FooterProps) {
|
||||
const [mediaList] = useState(links);
|
||||
const [mediaList, setMediaList] = useState(links);
|
||||
|
||||
return (
|
||||
<footer id="footer">
|
||||
<div className="logo-container">
|
||||
<img className="logo" alt="logo" src={logo} />
|
||||
<div className="logo-container" style={{ alignItems: 'flex-start' }}>
|
||||
<img className="logo" alt="logo" src={logo} />
|
||||
</div>
|
||||
<label style={{ color: 'white', fontSize: '14px', alignItems: 'flex-end', lineHeight: 'none' }}>©СКБ «КИТ» 2015–2025</label>
|
||||
</div>
|
||||
<FooterContacts contacts={contacts} />
|
||||
<div className="links">
|
||||
{Object.keys(mediaList).map((linkKey) => (
|
||||
<FooterLink link={mediaList[linkKey]} key={linkKey} />
|
||||
))}
|
||||
<div className="footer-links-container">
|
||||
<div className="footer-links">
|
||||
<div className="footer-column">
|
||||
<Link to="/news">НОВОСТИ</Link>
|
||||
<Link to="/projects">ПРОЕКТЫ</Link>
|
||||
<Link to="/labs">ЛАБОРАТОРИИ</Link>
|
||||
<Link to="/aboutus">О НАС</Link>
|
||||
</div>
|
||||
<div className="footer-column">
|
||||
<Link to="/contact" >НАША КОМАНДА</Link>
|
||||
<Link to="/contact">КОНТАКТЫ</Link>
|
||||
<Link to="https://ictis.sfedu.ru">ИКТИБ</Link>
|
||||
</div>
|
||||
</div>
|
||||
<Link className="visible" style={{ color: 'white', fontSize: '14px', alignItems: 'flex-end', lineHeight: 'none' }} to="https://www.study.sfedu.ru/privacypolicy?ysclid=m8anp507sz44008873">Политика конфиденциальности</Link>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<div className="footer-content">
|
||||
<FooterContacts contacts={contacts} />
|
||||
<div className="links">
|
||||
{Object.keys(mediaList).map(link => <FooterLink link={mediaList[link]} key={mediaList[link].id} />)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Link className="copyright" style={{ color: 'white', fontSize: '14px', lineHeight: 'none' }} to="https://www.study.sfedu.ru/privacypolicy?ysclid=m8anp507sz44008873">Политика конфиденциальности</Link>
|
||||
<div className="copyright">
|
||||
©СКБ «КИТ» 2015–2025
|
||||
</div>
|
||||
</footer >
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ function FooterContacts({ contacts }: FooterContactsProps) {
|
||||
return (
|
||||
<div className="contacts">
|
||||
<p>{contacts.email}</p>
|
||||
<p>{contacts.address}</p>
|
||||
<p>{contacts.phone}</p>
|
||||
<p>{contacts.address}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
#numbers {
|
||||
margin-bottom: 48px;
|
||||
|
||||
img {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.title {
|
||||
// если нужно — добавь стили заголовка
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: 500;
|
||||
font-size: 20px;
|
||||
margin-top: 10px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.block-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.columns {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 32px;
|
||||
}
|
||||
|
||||
.gap01 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 32px;
|
||||
}
|
||||
|
||||
.blocks {
|
||||
padding: 24px;
|
||||
background-color: #f7f5f5;
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.visible {
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.visible {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 500px) {
|
||||
label {
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.blocks {
|
||||
padding: 10px;
|
||||
background-color: transparent;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.gap01 {
|
||||
gap: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.namber {
|
||||
font-size: 64px;
|
||||
font-weight: 600;
|
||||
font-family: 'Montserrat', sans-serif;
|
||||
background: linear-gradient(to right, #0867F4, #072AC8);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
display: inline-block;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import "./Numbers.styles.scss";
|
||||
import { Illustration } from '../../shared/assets/images/numbers';
|
||||
|
||||
const Numbers = () => {
|
||||
return (
|
||||
<div className="block" id="numbers">
|
||||
<h2 className="title">СКБ «КИТ» в цифрах"</h2>
|
||||
<div className="block-content">
|
||||
<div className="columns">
|
||||
<div className="gap01">
|
||||
<div className='blocks'>
|
||||
<p className="namber">10</p>
|
||||
<label>лет успешной работы</label>
|
||||
</div>
|
||||
<div className='blocks'>
|
||||
<p className="namber">20+</p>
|
||||
<label>сотрудников</label>
|
||||
</div>
|
||||
<div className='blocks'>
|
||||
<p className="namber">30+</p>
|
||||
<label>выполненных проектов</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className="gap01">
|
||||
<div className='blocks'>
|
||||
<p className="namber">10</p>
|
||||
<label>лет успешной работы</label>
|
||||
</div>
|
||||
<div className='blocks'>
|
||||
<p className="namber">20+</p>
|
||||
<label>сотрудников</label>
|
||||
</div>
|
||||
<div className='blocks'>
|
||||
<p className="namber">30+</p>
|
||||
<label>выполненных проектов</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<img className="visible" src={Illustration} alt="Illustration" />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Numbers;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './Numbers';
|
||||
@@ -1,5 +1,5 @@
|
||||
$block-height: 150px;
|
||||
$logo-size: 150px;
|
||||
$block-height: 200px;
|
||||
$logo-size: 200px;
|
||||
|
||||
#partners {
|
||||
margin-left: 0;
|
||||
@@ -31,6 +31,11 @@ $logo-size: 150px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.rfm-marquee {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.partner {
|
||||
|
||||
@@ -3,7 +3,7 @@ import Marquee from "react-fast-marquee";
|
||||
|
||||
import PartnersLogo from "./PartnersLogo";
|
||||
import styles from "./Partners.module.scss";
|
||||
import BlockHeading from "@/widgets/BlockHeading";
|
||||
// import BlockHeading from "@/widgets/BlockHeading";
|
||||
|
||||
// Тип для данных партнёра
|
||||
interface Partner {
|
||||
@@ -74,20 +74,28 @@ const mock: Partner[] = [
|
||||
|
||||
function Partners({ partners = mock }: PartnersProps) {
|
||||
const [mediaList, setMediaList] = useState<Partner[]>(partners);
|
||||
|
||||
const updateMediaList = async () => {
|
||||
// Логика для обновления списка медиа
|
||||
// const newMediaList = await getMedia('partners');
|
||||
// setMediaList(newMediaList);
|
||||
};
|
||||
const [play, setPlay] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
updateMediaList();
|
||||
window.addEventListener("resize", updateMediaList);
|
||||
return () => {
|
||||
window.removeEventListener("resize", updateMediaList);
|
||||
const loadData = async () => {
|
||||
try {
|
||||
// Эмуляция загрузки данных
|
||||
// const newMediaList = await getMedia('partners');
|
||||
// setMediaList(newMediaList);
|
||||
|
||||
// Автозапуск если достаточно элементов
|
||||
if (mediaList.length >= 5) {
|
||||
setPlay(true);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error loading partners data:", error);
|
||||
// Автозапуск с mock-данными
|
||||
setPlay(true);
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
loadData();
|
||||
}, [mediaList.length]);
|
||||
|
||||
return (
|
||||
<div className={styles.block} id={styles.partners}>
|
||||
@@ -98,8 +106,10 @@ function Partners({ partners = mock }: PartnersProps) {
|
||||
<Marquee
|
||||
gradient={false}
|
||||
pauseOnHover={false}
|
||||
play={play}
|
||||
speed={80}
|
||||
className={styles.marquee}
|
||||
autoFill={play}
|
||||
>
|
||||
{mediaList.map((item, index) => (
|
||||
<div key={index} className={styles.partner}>
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
.mainContainer {
|
||||
margin: 0 10%;
|
||||
text-align: left;
|
||||
display: block;
|
||||
|
||||
@include mediaMax($mobile-xs-width) {
|
||||
margin: 0 5%;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36px;
|
||||
font-weight: 600;
|
||||
line-height: 44px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 8px;
|
||||
|
||||
@include mediaMax($tablet-max-width) {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 32px auto 0;
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.images {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
gap: 32px;
|
||||
|
||||
@include mediaMax($tablet-max-width) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
@include mediaMax($mobile-xs-width) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.image-container {
|
||||
height: 352px;
|
||||
overflow: hidden;
|
||||
border-radius: 8px;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
$tablet-min-width: 768px;
|
||||
|
||||
@for $i from 0 through 100 {
|
||||
@include mediaMin($tablet-min-width) {
|
||||
@if $i % 2==0 {
|
||||
|
||||
// Первый случай: широкая слева
|
||||
.image-container:nth-child(5n + #{1 + $i * 5}) {
|
||||
grid-column: span 4;
|
||||
}
|
||||
|
||||
.image-container:nth-child(5n + #{2 + $i * 5}) {
|
||||
grid-column: span 2;
|
||||
}
|
||||
}
|
||||
|
||||
@else {
|
||||
|
||||
// Второй случай: широкая справа
|
||||
.image-container:nth-child(5n + #{2 + $i * 5}) {
|
||||
grid-column: span 4;
|
||||
}
|
||||
|
||||
.image-container:nth-child(5n + #{1 + $i * 5}) {
|
||||
grid-column: span 2;
|
||||
}
|
||||
}
|
||||
|
||||
// чётная строка
|
||||
.image-container:nth-child(5n + #{3 + $i * 5}),
|
||||
.image-container:nth-child(5n + #{4 + $i * 5}),
|
||||
.image-container:nth-child(5n + #{5 + $i * 5}) {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useMedia } from "@/modules/media/hooks/useMedia";
|
||||
|
||||
import "./PhotoGallery.style.scss"
|
||||
|
||||
interface PhotoGalleryProps {
|
||||
images?: string[];
|
||||
category?: string;
|
||||
}
|
||||
|
||||
const PhotoGallery = ({ images, category = "галерея" }: PhotoGalleryProps) => {
|
||||
const { data: mediaData, isLoading, isError } = useMedia();
|
||||
const [visibleCount, setVisibleCount] = useState(10);
|
||||
|
||||
const filteredMedia = images
|
||||
? images.map((src, id) => ({ id, src }))
|
||||
: mediaData || []; // без фильтра
|
||||
|
||||
if (isLoading)
|
||||
return (
|
||||
<div className="mainContainer">
|
||||
<span className="loader"></span>
|
||||
</div>
|
||||
);
|
||||
|
||||
if (isError) return <div>Ошибка при загрузке медиа</div>;
|
||||
|
||||
return (
|
||||
<div className="mainContainer">
|
||||
<h1 className="title">Фотогалерея</h1>
|
||||
<div className="images">
|
||||
{filteredMedia.slice(0, visibleCount).map((media) => (
|
||||
<div key={media.id} className="image-container">
|
||||
<img
|
||||
src={media.src}
|
||||
alt={`slide-${media.id}`}
|
||||
className="slide-image"
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="btn">
|
||||
Показать еще
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default PhotoGallery;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './PhotoGallery';
|
||||
@@ -4,19 +4,24 @@
|
||||
position: relative;
|
||||
padding: 10px 0;
|
||||
|
||||
&.has-pagination {
|
||||
.swiper {
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-slide {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 50vh;
|
||||
bottom: 10px;
|
||||
|
||||
|
||||
|
||||
.slide-image {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
height: 350px;
|
||||
object-fit: cover;
|
||||
object-position: center center;
|
||||
object-position: center center; //
|
||||
border-radius: 8px;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -24,12 +29,12 @@
|
||||
|
||||
.swiper-wrapper:has(.swiper-slide.single) {
|
||||
justify-content: center;
|
||||
|
||||
|
||||
.swiper-slide.single {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.slide-image {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
@@ -42,8 +47,20 @@
|
||||
}
|
||||
|
||||
/* стрелки */
|
||||
.swiper-button-prev,
|
||||
.swiper-button-next {
|
||||
/* Кастомные стрелки */
|
||||
.custom-navigation {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 100%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.custom-prev,
|
||||
.custom-next {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
background-color: white;
|
||||
@@ -53,27 +70,67 @@
|
||||
align-items: center;
|
||||
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
|
||||
cursor: pointer;
|
||||
font-size: 24px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
&::after {
|
||||
font-size: 18px;
|
||||
font-weight: 1000;
|
||||
color: black;
|
||||
.custom-prev {
|
||||
margin-left: -70px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Позиционирование стрелок */
|
||||
.swiper-button-prev {
|
||||
left: 5px;
|
||||
.custom-next {
|
||||
margin-right: -70px;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
left: 0px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-button-next {
|
||||
right: 5px;
|
||||
.slider.news {
|
||||
.swiper-slide {
|
||||
opacity: 0.5;
|
||||
transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
|
||||
height: 65vh;
|
||||
|
||||
@media (max-width: 768px) {
|
||||
right: 0px;
|
||||
.slide-image {
|
||||
height: 500px;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
opacity: 1;
|
||||
transition: none;
|
||||
height: 48vh;
|
||||
|
||||
.slide-image {
|
||||
height: 350px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.swiper-slide-active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
&.no-animation .swiper-slide {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.swiper-wrapper:has(.swiper-slide.single) {
|
||||
justify-content: center !important;
|
||||
}
|
||||
|
||||
.swiper-slide-prev,
|
||||
.swiper-slide-next {
|
||||
opacity: 0.7;
|
||||
transform: scale(0.9);
|
||||
|
||||
@media (max-width: 768px) {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useEffect, useState, useRef } from "react";
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
import { Navigation, Pagination } from "swiper/modules";
|
||||
import { Pagination } from "swiper/modules";
|
||||
import { useMedia } from "@/modules/media/hooks/useMedia";
|
||||
|
||||
import "swiper/css";
|
||||
import "swiper/css/navigation";
|
||||
import "swiper/css/pagination";
|
||||
|
||||
import "./Slider.styles.scss";
|
||||
|
||||
import arrow from "../../shared/assets/images/arrow.svg";
|
||||
|
||||
interface SliderProps {
|
||||
autoPlay?: boolean;
|
||||
autoPlayTime?: number;
|
||||
@@ -27,28 +28,25 @@ function Slider({
|
||||
window.innerWidth <= 768 ? 1 : 2
|
||||
);
|
||||
const [enableButtons, setEnableButtons] = useState(false);
|
||||
const swiperRef = useRef<any>(null);
|
||||
|
||||
// Фильтруем медиа по категории
|
||||
const filteredMedia = images
|
||||
? images.map((src, id) => ({ id, src }))
|
||||
: mediaData?.filter((media) => media.category === category) || [];
|
||||
console.log(mediaData);
|
||||
useEffect(() => {
|
||||
const handleResize = () => {
|
||||
setItemsPerSlide(window.innerWidth <= 768 ? 1 : 2);
|
||||
};
|
||||
window.addEventListener("resize", handleResize);
|
||||
return () => window.removeEventListener("resize", handleResize);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const numberOfSlides = filteredMedia.length;
|
||||
if (numberOfSlides > 2) {
|
||||
setEnableButtons(true);
|
||||
} else if (numberOfSlides === 1) {
|
||||
setItemsPerSlide(1);
|
||||
}
|
||||
}, [filteredMedia]);
|
||||
useEffect(() => {
|
||||
const handleResize = () => {
|
||||
const isMobile = window.innerWidth <= 768;
|
||||
setItemsPerSlide(isMobile ? 1 : 2);
|
||||
|
||||
// Показываем стрелки только если слайдов больше 2
|
||||
setEnableButtons(!isMobile && filteredMedia.length > 2);
|
||||
};
|
||||
|
||||
window.addEventListener("resize", handleResize);
|
||||
handleResize(); // сразу вызываем
|
||||
return () => window.removeEventListener("resize", handleResize);
|
||||
}, [filteredMedia]);
|
||||
|
||||
if (isLoading)
|
||||
return (
|
||||
@@ -59,20 +57,32 @@ function Slider({
|
||||
if (isError) return <div>Ошибка при загрузке медиа</div>;
|
||||
|
||||
return (
|
||||
<div className="slider">
|
||||
<div className={`slider ${enableButtons ? "has-pagination" : ""}`}>
|
||||
{/* Кастомные стрелки */}
|
||||
{enableButtons && (
|
||||
<div className="custom-navigation">
|
||||
<button className="custom-prev" onClick={() => swiperRef.current?.slidePrev()}>
|
||||
<img src={arrow} alt="prev" />
|
||||
</button>
|
||||
<button className="custom-next" onClick={() => swiperRef.current?.slideNext()}>
|
||||
<img src={arrow} alt="next" style={{ transform: "rotate(180deg)" }} />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<Swiper
|
||||
modules={[Navigation, Pagination]}
|
||||
modules={[Pagination]}
|
||||
spaceBetween={20}
|
||||
slidesPerView={itemsPerSlide}
|
||||
slidesPerGroup={1}
|
||||
loop={enableButtons}
|
||||
navigation={enableButtons}
|
||||
pagination={{ clickable: enableButtons }}
|
||||
autoplay={
|
||||
autoPlay
|
||||
? { delay: autoPlayTime, disableOnInteraction: false }
|
||||
: false
|
||||
}
|
||||
onSwiper={(swiper) => (swiperRef.current = swiper)}
|
||||
>
|
||||
{filteredMedia.map((media) => (
|
||||
<SwiperSlide
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
$btn-primary-text: white;
|
||||
$btn-primary-bg: linear-gradient(
|
||||
93.25deg,
|
||||
#4942e4 0%,
|
||||
#11009e 50%,
|
||||
#4942e4 100%
|
||||
);
|
||||
|
||||
.mainContainer {
|
||||
margin: 0 10%;
|
||||
text-align: left;
|
||||
display: block;
|
||||
|
||||
@include mediaMax($mobile-xs-width) {
|
||||
margin: 0 5%;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36px;
|
||||
font-weight: 600;
|
||||
line-height: 44px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 8px;
|
||||
|
||||
@include mediaMax($tablet-max-width) {
|
||||
font-size: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 32px;
|
||||
|
||||
@include mediaMax($tablet-max-width) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
@include mediaMax($mobile-xs-width) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
text-align: left;
|
||||
border: 0;
|
||||
text-decoration: none;
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.caption {
|
||||
padding-top: 10px;
|
||||
text-align: left;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
font-family: "Montserrat";
|
||||
font-style: normal;
|
||||
font-display: swap;
|
||||
src: url("../fonts/Montserrat/Montserrat-VariableFont_wght.ttf") format("truetype");
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-size: 22px;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.joinContent {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: $btn-primary-bg;
|
||||
border-radius: 8px;
|
||||
transition: 0.5s;background: $btn-primary-bg;
|
||||
background-size: 200% 100%;
|
||||
background-position: 0% 0%;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background-size: 200%;
|
||||
background-position: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.joinText {
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
font-family: "Montserrat";
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import "./Team.style.scss";
|
||||
import photo from "@/shared/assets/images/photo.png";
|
||||
import { HashLink } from "react-router-hash-link";
|
||||
|
||||
const Team = () => {
|
||||
const mockTeam = Array.from({ length: 7 }); // 7 обычных участников
|
||||
|
||||
return (
|
||||
<div className="mainContainer">
|
||||
<h2 className="title">Наша команда</h2>
|
||||
<div className="grid">
|
||||
{mockTeam.map((_, index) => (
|
||||
<div key={index} className="card">
|
||||
<img src={photo} alt={`Член команды ${index + 1}`} />
|
||||
<p className="caption">
|
||||
<span className="bold">Владимир Кутковой</span>
|
||||
<br />
|
||||
руководитель СКБ «КИТ»
|
||||
</p>
|
||||
</div>
|
||||
))}
|
||||
<HashLink smooth to="/contact" className="card">
|
||||
<div className="joinContent">
|
||||
<span className="joinText">Хочу в команду</span>
|
||||
</div>
|
||||
<p className="caption">
|
||||
<span className="bold"></span>
|
||||
<br /><br />
|
||||
</p>
|
||||
</HashLink>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Team;
|
||||
@@ -0,0 +1 @@
|
||||
export { default } from './Team';
|
||||
Reference in new issue
Block a user