diff --git a/package-lock.json b/package-lock.json index ef4af04..e1c186d 100755 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "persist": "^0.2.7", "pg": "^8.13.0", "react": "^18.3.1", + "react-alice-carousel": "^2.9.1", "react-chartjs-2": "^5.2.0", "react-dom": "^18.3.1", "react-fast-marquee": "^1.6.5", @@ -41,6 +42,7 @@ "react-router": "^7.1.1", "react-router-dom": "^6.28.1", "react-router-hash-link": "^2.4.3", + "react-swipeable": "^7.0.2", "sass": "^1.85.1", "swiper": "^11.2.5", "wpapi": "^1.2.2", @@ -68,7 +70,7 @@ "i": "^0.3.7", "npm": "^11.2.0", "typescript": "^5.5.3", - "vite": "^5.3.1" + "vite": "^5.4.19" } }, "node_modules/@ampproject/remapping": { @@ -7877,6 +7879,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-alice-carousel": { + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/react-alice-carousel/-/react-alice-carousel-2.9.1.tgz", + "integrity": "sha512-/wQE4cqogKL/db+SoiiRmdj5j6C9I31pfzrmz8nuXmWmSl/UxxJz/O92W/ryxicTw1au+3mUW+drU3ZAhF3JPA==", + "license": "MIT", + "dependencies": { + "vanilla-swipe": "^2.4.1" + }, + "peerDependencies": { + "react": ">=15.4" + } + }, "node_modules/react-chartjs-2": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/react-chartjs-2/-/react-chartjs-2-5.3.0.tgz", @@ -8038,6 +8052,15 @@ "react-router-dom": ">=4" } }, + "node_modules/react-swipeable": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/react-swipeable/-/react-swipeable-7.0.2.tgz", + "integrity": "sha512-v1Qx1l+aC2fdxKa9aKJiaU/ZxmJ5o98RMoFwUqAAzVWUcxgfHFXDDruCKXhw6zIYXm6V64JiHgP9f6mlME5l8w==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.3 || ^17 || ^18 || ^19.0.0 || ^19.0.0-rc" + } + }, "node_modules/react-transition-group": { "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", @@ -8692,6 +8715,12 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, + "node_modules/vanilla-swipe": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/vanilla-swipe/-/vanilla-swipe-2.4.1.tgz", + "integrity": "sha512-o6pfI0dipet88ZnPLV4Jx04Ia+U3xANh14vhROW2TOe/mrwk2JGG68+Z0BPoD1YUcQQEnK4SZBXkqFe+K1l7/w==", + "license": "MIT" + }, "node_modules/vite": { "version": "5.4.19", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.19.tgz", diff --git a/package.json b/package.json index 7528721..ce244fa 100755 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "persist": "^0.2.7", "pg": "^8.13.0", "react": "^18.3.1", + "react-alice-carousel": "^2.9.1", "react-chartjs-2": "^5.2.0", "react-dom": "^18.3.1", "react-fast-marquee": "^1.6.5", @@ -43,6 +44,7 @@ "react-router": "^7.1.1", "react-router-dom": "^6.28.1", "react-router-hash-link": "^2.4.3", + "react-swipeable": "^7.0.2", "sass": "^1.85.1", "swiper": "^11.2.5", "wpapi": "^1.2.2", @@ -70,6 +72,6 @@ "i": "^0.3.7", "npm": "^11.2.0", "typescript": "^5.5.3", - "vite": "^5.3.1" + "vite": "^5.4.19" } } diff --git a/src/pages/CustomProjects/LabBoard/LabBoard.module.scss b/src/pages/CustomProjects/LabBoard/LabBoard.module.scss new file mode 100644 index 0000000..396d3c6 --- /dev/null +++ b/src/pages/CustomProjects/LabBoard/LabBoard.module.scss @@ -0,0 +1,486 @@ +#pageheader { + position: relative; + overflow: hidden; + min-height: 100vh; + padding: 0 10%; + + margin: 0; + margin-bottom: 64px; + color: rgba(18, 18, 18, 1); + background-image: url("/src/shared/assets/images/LabBoard/fond.png"); + background-blend-mode: multiply; + background-position: center; + background-size: cover; + + img { + pointer-events: none; + } + + .headerContent { + display: flex; + justify-content: space-between; + align-items: center; + height: 100vh; + } + + .container { + flex: 1; + max-width: 50%; + + @media (max-width: 768px) { + max-width: 100%; + padding: $navbar-padding-tb 5%; + } + + h1 { + font-size: 52px; + font-weight: 600; + line-height: 63px; + margin: 0; + margin-bottom: 24px; + + @media (max-width: 768px) { + font-size: 32px; + line-height: 40px; + } + } + + h2 { + font-size: 24px; + font-weight: 400; + line-height: 36px; + + @media (max-width: 768px) { + font-size: 24px; + line-height: 28px; + } + } + + .btn { + margin: 0; + margin-top: 24px; + } + } + + .microcontrollerImage { + flex: 1; + max-width: 40%; + height: auto; + object-fit: contain; + + @media (max-width: 768px) { + display: none; + } + } + + @media (max-width: 768px) { + padding: 0 5%; + margin-bottom: 32px; + } +} + +#padding { + padding: 0 10%; + + @media (max-width: 768px) { + padding: 0 5%; + } +} + +#padding2 { + padding: 0 10%; + @media (max-width: 769px) { + padding: 0 2.5%; + } +} + +#page_container { + padding: 0 10%; + + @media (max-width: 768px) { + padding: 0 5%; + } + + h2 { + font-size: 36px; + } + + h4 { + font-weight: 600; + } + + img { + pointer-events: none; + } + + p { + margin-bottom: 32px; + } + + .title { + font-size: 36px; + font-weight: 600; + line-height: 44px; + margin-top: 0; + margin-bottom: 8px; + + @include mediaMax($tablet-max-width) { + font-size: 24px; + margin-top: 0; + } + } + + .numbersContainer { + display: flex; + justify-content: space-between; + gap: 32px; + background-color: #f5f5f7; + border-radius: 16px; + margin-bottom: 64px; + + @media (max-width: 768px) { + flex-direction: column; + gap: 24px; + margin-bottom: 32px; + } + } + + .numberBlock { + flex: 1; + padding: 32px; + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + } + + .number { + 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; + margin-bottom: 16px; + + @media (max-width: 768px) { + font-size: 48px; + } + } + + .numberLabel { + font-size: 18px; + color: #333; + margin: 0; + + @media (max-width: 768px) { + font-size: 16px; + } + } + + .imagesContainer { + display: flex; + gap: 32px; + margin-bottom: 64px; + + @media (max-width: 768px) { + flex-direction: column; + gap: 24px; + margin-bottom: 32px; + } + } + + .imageBlock { + flex: 1; + background-color: #f5f5f7; + border-radius: 16px; + padding: 32px 48px 48px 48px; + display: flex; + flex-direction: column; + } + + .imageTitle { + font-weight: 550; + margin-bottom: 16px + } + + .microcontrollerPhoto { + width: 100%; + height: auto; + object-fit: contain; + max-height: 300px; + } +} + +.featuresContainer { + display: flex; + gap: 32px; + margin-bottom: 64px; + padding-top: 24px; + + @media (max-width: 768px) { + flex-direction: column; + gap: 24px; + margin-bottom: 32px; + } +} + +.featuresList { + flex: 1; + display: flex; + flex-direction: column; + gap: 32px; +} + +.featureItem { + display: flex; + gap: 8px; + align-items: center; + cursor: pointer; + font-size: 24px; + font-weight: 600; + + &.active { + color: #072AC8; + } + + img { + width: 24px; + height: 24px; + } +} + +.featureContent { + flex: 0 0 600px; + + @media (max-width: 768px) { + flex: 1; + width: 100%; + } +} + +.featureDescription { + animation: fadeIn 0.3s ease; +} + +.mcuContainer { + display: flex; + gap: 32px; + margin-bottom: 0; + + @media (max-width: 768px) { + flex-direction: column; + gap: 24px; + } +} + +// слайдер +.sliderHeaderContainer { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 32px; + width: 100%; + flex-wrap: wrap; + + @media (max-width: 768px) { + flex-direction: column; + align-items: flex-start; + gap: 16px; + } + + h2 { + font-size: 36px; + font-weight: 600; + } +} + +.sliderNav { + display: flex; + gap: 16px; +} + +.sliderButton { + width: 40px; + height: 40px; + border-radius: 50%; + background: #f5f5f7; + border: none; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + + img { + width: 16px; + height: 16px; + } +} + +.slideActive, +.slideNext { + background: #f5f5f7; + border-radius: 16px; + display: flex; + align-items: center; + justify-content: center; + transition: all 0.5s ease-in-out; + opacity: 1; + transform: scale(1); +} + +.slideActive { + flex: 2; + padding: 48px; + border: 2px solid #0867F4; + + .activeImage { + width: 100%; + height: 300px; + object-fit: contain; + } +} + +.slideNext { + flex: 1; + padding: 32px; + + .nextImage { + width: 100%; + max-height: 200px; + height: auto; + object-fit: contain; + } +} + +.slideActive.fade-out, +.slideNext.fade-out, +.fadeOut { + opacity: 0; + transform: scale(0.98); +} + +@media (max-width: 768px) { + + .slideActive, + .slideNext { + width: 100%; + flex: none; + } + + .slideNext { + display: none; + } + + .sliderNav { + display: none; + } + + .swiper-slide { + opacity: 1 !important; + transition: none !important; + height: 48vh !important; + + .slide-image { + height: 350px !important; + } + } + + .slideActive .activeImage { + height: 200px; // или auto, если хочешь, чтобы она заполняла контейнер + max-height: 60vh; // чтобы не вылезала за экран + width: 100%; + object-fit: contain; + } + + .swiper-slide { + height: auto; // либо установи нужную высоту, например: 60vh + } + + .slideActive { + padding: 16px; // уменьшить паддинги, чтобы картинка влезала лучше + } +} + + + +.swiper-slide { + opacity: 0.5; + transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out; + height: 65vh; + + .slide-image { + height: 500px; + } +} + +.swiper-slide-active { + opacity: 1; + transform: scale(1); +} + +.swiper-slide-prev, +.swiper-slide-next { + opacity: 0.7; + transform: scale(0.9); + + @media (max-width: 768px) { + opacity: 1; + transform: none; + } +} + +.sliderWrapper { + display: flex; + align-items: center; + gap: 16px; + width: 100%; + margin-bottom: 34px; + + @media (max-width: 768px) { + .sliderNav { + display: none; + } + } +} + +.sliderContainer { + display: flex; + gap: 32px; + width: 100%; + margin-bottom: 32px; + + @media (max-width: 768px) { + flex: 1; + gap: 0; + + .slideNext { + display: none; + } + } +} + +.sliderButton2 { + width: 40px; + height: 40px; + border-radius: 50%; + background: #f5f5f7; + border: none; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + + img { + width: 16px; + height: 16px; + } + + @media (min-width: 769px) { + display: none; + } +} \ No newline at end of file diff --git a/src/pages/CustomProjects/LabBoard/LabBoard.tsx b/src/pages/CustomProjects/LabBoard/LabBoard.tsx new file mode 100644 index 0000000..63fa003 --- /dev/null +++ b/src/pages/CustomProjects/LabBoard/LabBoard.tsx @@ -0,0 +1,239 @@ +import styles from "./LabBoard.module.scss"; +import { HashLink } from "react-router-hash-link"; +import { useState } from 'react'; +import angle_small_down from "@/shared/assets/images/LabBoard/angle-small-down.svg"; +import angle_small_down_one from "@/shared/assets/images/LabBoard/angle-small-down-one.svg"; +import microcontroller_left from "@/shared/assets/images/LabBoard/microcontroller_left.svg"; +import microcontroller_rear from "@/shared/assets/images/LabBoard/microcontroller_rear.svg"; +import Group_one from "@/shared/assets/images/LabBoard/Group_one.svg"; +import Group_two from "@/shared/assets/images/LabBoard/Group_two.svg"; +import Vector from "@/shared/assets/images/LabBoard/Vector.svg"; +import { useSwipeable } from 'react-swipeable'; + +import ContactUs from "@/widgets/ContactUs"; + +function LabBoard() { + const [activeFeature, setActiveFeature] = useState(null); + + const features = [ + { + title: "OLED дисплей", + content: "Pizza ipsum dolor meat lovers buffalo. Buffalo chicken pie mozzarella tomatoes pepperoni bacon buffalo chicken. Deep parmesan Hawaiian anchovies chicken personal stuffed tomato black. Wing wing crust sausage ham Philly." + }, + { + title: "Драйверы для двигателей", + content: "Описание драйверов для двигателей..." + }, + { + title: "Модули беспроводной связи", + content: "Описание модулей беспроводной связи..." + }, + { + title: "IMU", + content: "Описание IMU..." + }, + { + title: "EEPROM", + content: "Описание EEPROM..." + }, + { + title: "Различные сенсоры", + content: "Описание сенсоров..." + }, + { + title: "Кнопки", + content: "Описание кнопок..." + } + ]; + + const toggleFeature = (index) => { + setActiveFeature(activeFeature === index ? null : index); + }; + + const [currentSlide, setCurrentSlide] = useState(0); + const slides = [ + { + image: Group_one, title: "Блок \"MCU\"", + description1: "Основным вычислительным устройством лабораторного стенда является микроконтроллер STM32F407IG использующий архитектуру ARMv7-M и работающий с максимальной частотой 168MHz. На борту устройства установлено 192Kb оперативной памяти (RAM) и 1Mb постоянной FLASH (ROM). Тактирование осуществляется с помощью двух кварцевых резонаторов: 8MHz для основной системы тактирования и 32.768KHz для встроенных часов реального времени (RTC). Напряжение питания микроконтроллера и логических выводов 3.3V, но большинство контактов толерантных к 5V логике." + , description2: "Для взаимодействия с микроконтроллером на панели блока \"MCU\" установлены три тактовых выключателя: RESET - сброс MK, TEST - пользовательская кнопка, BOOT - переход в режим встроенного загрузчика. Выключатель TEST подаёт на контакт PI10 высокий сигнал. Светодиод LD110 управляется контактом PI11 и может использоваться программой пользователя для индикации режима работы. Питания встроенных часов реального времени осуществляется с помощью батареи CR1220." + }, + { image: Group_two, title: "Slide 2", description1: "Текст для слайда 2", description2: "222" }, + { + image: Group_one, title: "Блок \"MCU\"", + description1: "Основным вычислительным устройством лабораторного стенда является микроконтроллер STM32F407IG использующий архитектуру ARMv7-M и работающий с максимальной частотой 168MHz. На борту устройства установлено 192Kb оперативной памяти (RAM) и 1Mb постоянной FLASH (ROM). Тактирование осуществляется с помощью двух кварцевых резонаторов: 8MHz для основной системы тактирования и 32.768KHz для встроенных часов реального времени (RTC). Напряжение питания микроконтроллера и логических выводов 3.3V, но большинство контактов толерантных к 5V логике." + + , description2: "Для взаимодействия с микроконтроллером на панели блока \"MCU\" установлены три тактовых выключателя: RESET - сброс MK, TEST - пользовательская кнопка, BOOT - переход в режим встроенного загрузчика. Выключатель TEST подаёт на контакт PI10 высокий сигнал. Светодиод LD110 управляется контактом PI11 и может использоваться программой пользователя для индикации режима работы. Питания встроенных часов реального времени осуществляется с помощью батареи CR1220." + }, + { image: Group_two, title: "Slide 2", description1: "Текст для слайда 2", description2: "222" } + ]; + + const [fade, setFade] = useState(false); + + const nextSlide = () => { + setFade(true); + setTimeout(() => { + setCurrentSlide((prev) => (prev + 1) % slides.length); + setFade(false); + }, 200); + }; + + const prevSlide = () => { + setFade(true); + setTimeout(() => { + setCurrentSlide((prev) => (prev - 1 + slides.length) % slides.length); + setFade(false); + }, 200); + }; + + return ( +
10
+ +1
+ +25
+ +
+ Для изучения принципов работы микроконтроллеров, их
+ интерфейсов и подключаемой периферии был разработан
+ лабораторный учебный стенд “LabBoard 1.1”. Он состоит из 25
+ независимых блоков, соединённых с микроконтроллером.
+
Лицевая сторона
+Тыльная сторона
++
+