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
35909dce1f
commit
5359359833
3 files changed
+154
-171
No files matched your search
@@ -1,7 +1,3 @@
|
|||||||
#padding {
|
|
||||||
padding: 0 10%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pageheader {
|
#pageheader {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -77,6 +73,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#padding {
|
||||||
|
padding: 0 10%;
|
||||||
|
}
|
||||||
|
|
||||||
#page_container {
|
#page_container {
|
||||||
padding: 0 10%;
|
padding: 0 10%;
|
||||||
|
|
||||||
@@ -97,7 +97,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
font-size: 36px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
line-height: 44px;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
@include mediaMax($tablet-max-width) {
|
||||||
|
font-size: 24px;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.numbersContainer {
|
.numbersContainer {
|
||||||
@@ -123,7 +132,7 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.namber {
|
.number {
|
||||||
font-size: 64px;
|
font-size: 64px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-family: 'Montserrat', sans-serif;
|
font-family: 'Montserrat', sans-serif;
|
||||||
@@ -247,185 +256,105 @@
|
|||||||
|
|
||||||
// слайдер
|
// слайдер
|
||||||
.sliderHeaderContainer {
|
.sliderHeaderContainer {
|
||||||
padding: 0 10%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
|
width: 100%;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.sliderNav {
|
.sliderNav {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
order: 2;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.sliderButton {
|
.sliderButton {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: #f5f5f7;
|
background: #f5f5f7;
|
||||||
border: none;
|
border: none;
|
||||||
font-size: 20px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Карточка слайда
|
||||||
.sliderWrapper {
|
.sliderWrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
height: 356px;
|
|
||||||
margin-bottom: 64px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sliderContainer {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
position: relative;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slide {
|
|
||||||
position: absolute;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
margin-bottom: 64px;
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
margin-bottom: 32px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.imageContainer {
|
|
||||||
|
|
||||||
|
.slideContent {
|
||||||
|
width: 100%;
|
||||||
background: #f5f5f7;
|
background: #f5f5f7;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
|
padding: 48px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
height: 352px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.centerSlide {
|
|
||||||
width: 736px;
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
z-index: 3;
|
|
||||||
|
|
||||||
.imageContainer {
|
.slideImage {
|
||||||
width: 100%;
|
width: 80%;
|
||||||
height: 100%;
|
height: auto;
|
||||||
|
|
||||||
.sliderImage {
|
|
||||||
width: 74%;
|
|
||||||
height: 68%;
|
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.leftSlide {
|
|
||||||
width: 352px;
|
|
||||||
left: calc(50% - 736px/2 - 352px - 32px);
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
.imageContainer {
|
.swiperSlide {
|
||||||
width: 100%;
|
flex-shrink: 0;
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.sliderImage {
|
|
||||||
width: 72.5%;
|
|
||||||
height: 26%;
|
|
||||||
object-fit: contain;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightSlide {
|
|
||||||
width: 352px;
|
|
||||||
left: calc(50% + 736px/2 + 32px);
|
|
||||||
z-index: 2;
|
|
||||||
|
|
||||||
.imageContainer {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.sliderImage {
|
|
||||||
width: 72.5%;
|
|
||||||
height: 26%;
|
|
||||||
object-fit: contain;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.hiddenSlide {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1200px) {
|
|
||||||
.sliderWrapper {
|
|
||||||
height: 300px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.centerSlide {
|
|
||||||
width: 600px;
|
|
||||||
|
|
||||||
.sliderImage {
|
|
||||||
width: 70%;
|
|
||||||
height: 65%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.leftSlide,
|
|
||||||
.rightSlide {
|
|
||||||
width: 280px;
|
|
||||||
|
|
||||||
.sliderImage {
|
|
||||||
width: 70%;
|
|
||||||
height: 25%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.leftSlide {
|
|
||||||
left: calc(50% - 600px/2 - 280px - 24px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.rightSlide {
|
|
||||||
left: calc(50% + 600px/2 + 24px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
|
||||||
.sliderHeaderContainer {
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: flex-start;
|
|
||||||
gap: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sliderNav {
|
|
||||||
align-self: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sliderWrapper {
|
|
||||||
height: 250px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.centerSlide {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.sliderImage {
|
transition: all 0.3s ease;
|
||||||
width: 60%;
|
transform: scale(0.8);
|
||||||
height: 60%;
|
opacity: 0.6;
|
||||||
}
|
cursor: pointer;
|
||||||
}
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
.leftSlide,
|
|
||||||
.rightSlide {
|
.slideActive {
|
||||||
display: none;
|
transform: scale(1);
|
||||||
}
|
opacity: 1;
|
||||||
|
border: 2px solid #0867F4;
|
||||||
|
border-radius: 16px;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
@@ -9,12 +9,17 @@ import Group_one from "@/shared/assets/images/LabBoard/Group_one.svg";
|
|||||||
import Group_two from "@/shared/assets/images/LabBoard/Group_two.svg";
|
import Group_two from "@/shared/assets/images/LabBoard/Group_two.svg";
|
||||||
import Vector from "@/shared/assets/images/LabBoard/Vector.svg";
|
import Vector from "@/shared/assets/images/LabBoard/Vector.svg";
|
||||||
|
|
||||||
|
import { Swiper, SwiperSlide } from "swiper/react";
|
||||||
|
import { Navigation, Pagination } from "swiper/modules";
|
||||||
|
import "swiper/css";
|
||||||
|
import "swiper/css/navigation";
|
||||||
|
import "swiper/css/pagination";
|
||||||
|
|
||||||
import ContactUs from "@/widgets/ContactUs";
|
import ContactUs from "@/widgets/ContactUs";
|
||||||
|
|
||||||
function LabBoard() {
|
function LabBoard() {
|
||||||
const [activeFeature, setActiveFeature] = useState(null);
|
const [activeFeature, setActiveFeature] = useState(null);
|
||||||
const [currentSlide, setCurrentSlide] = useState(0);
|
|
||||||
const mcuImages = [Group_one, Group_two, Group_one, Group_two];
|
|
||||||
const features = [
|
const features = [
|
||||||
{
|
{
|
||||||
title: "OLED дисплей",
|
title: "OLED дисплей",
|
||||||
@@ -50,8 +55,23 @@ function LabBoard() {
|
|||||||
setActiveFeature(activeFeature === index ? null : index);
|
setActiveFeature(activeFeature === index ? null : index);
|
||||||
};
|
};
|
||||||
|
|
||||||
const nextSlide = () => setCurrentSlide(prev => (prev + 1) % mcuImages.length);
|
const [currentSlide, setCurrentSlide] = useState(0);
|
||||||
const prevSlide = () => setCurrentSlide(prev => (prev - 1 + mcuImages.length) % mcuImages.length);
|
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" }
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div id={styles.pageheader}>
|
<div id={styles.pageheader}>
|
||||||
@@ -73,15 +93,15 @@ function LabBoard() {
|
|||||||
<h2 className={styles.title}>LabBoard в цифрах</h2>
|
<h2 className={styles.title}>LabBoard в цифрах</h2>
|
||||||
<div className={styles.numbersContainer}>
|
<div className={styles.numbersContainer}>
|
||||||
<div className={styles.numberBlock}>
|
<div className={styles.numberBlock}>
|
||||||
<p className={styles.namber}>10</p>
|
<p className={styles.number}>10</p>
|
||||||
<label className={styles.numberLabel}>различных кнопок</label>
|
<label className={styles.numberLabel}>различных кнопок</label>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.numberBlock}>
|
<div className={styles.numberBlock}>
|
||||||
<p className={styles.namber}>1</p>
|
<p className={styles.number}>1</p>
|
||||||
<label className={styles.numberLabel}>OLED дисплей</label>
|
<label className={styles.numberLabel}>OLED дисплей</label>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.numberBlock}>
|
<div className={styles.numberBlock}>
|
||||||
<p className={styles.namber}>25</p>
|
<p className={styles.number}>25</p>
|
||||||
<label className={styles.numberLabel}>микроконтроллеров</label>
|
<label className={styles.numberLabel}>микроконтроллеров</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -129,47 +149,81 @@ function LabBoard() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className={styles.sliderHeaderContainer}>
|
<div className={styles.sliderHeaderContainer}>
|
||||||
<h2 className={styles.title}>Подробнее о микроконтроллерах</h2>
|
<h2 className={styles.title}>Подробнее о микроконтроллерах</h2>
|
||||||
<div className={styles.sliderNav}>
|
<div className={styles.sliderNav}>
|
||||||
<button onClick={prevSlide} className={styles.sliderButton}><img src={Vector} style={{ transform: 'scaleX(-1)' }} /></button>
|
<button className={`${styles.sliderButton} ${styles.sliderPrevBtn}`}>
|
||||||
<button onClick={nextSlide} className={styles.sliderButton}><img src={Vector}/></button>
|
<img src={Vector} style={{ transform: 'scaleX(-1)' }} alt="Previous" />
|
||||||
|
</button>
|
||||||
|
<button className={`${styles.sliderButton} ${styles.sliderNextBtn}`}>
|
||||||
|
<img src={Vector} alt="Next" />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.sliderWrapper}>
|
<div className={styles.sliderWrapper}>
|
||||||
<div className={styles.sliderTrack}>
|
<Swiper
|
||||||
{mcuImages.map((img, index) => {
|
modules={[Navigation]}
|
||||||
const position = (index - currentSlide + mcuImages.length) % mcuImages.length;
|
navigation={{
|
||||||
const slideClass =
|
nextEl: `.${styles.sliderNextBtn}`,
|
||||||
position === 0 ? styles.centerSlide :
|
prevEl: `.${styles.sliderPrevBtn}`,
|
||||||
position === 1 ? styles.rightSlide :
|
}}
|
||||||
position === mcuImages.length - 1 ? styles.leftSlide :
|
spaceBetween={32}
|
||||||
styles.hiddenSlide;
|
slidesPerView={2}
|
||||||
|
centeredSlides={true}
|
||||||
|
loop={true}
|
||||||
|
onSlideChange={(swiper) => setCurrentSlide(swiper.realIndex)}
|
||||||
|
className={styles.sliderContainer}
|
||||||
|
allowTouchMove={false}
|
||||||
|
breakpoints={{
|
||||||
|
0: {
|
||||||
|
slidesPerView: 1,
|
||||||
|
centeredSlides: false,
|
||||||
|
},
|
||||||
|
768: {
|
||||||
|
slidesPerView: 2,
|
||||||
|
centeredSlides: true,
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{slides.map((slide, index) => (
|
||||||
|
<SwiperSlide
|
||||||
|
key={index}
|
||||||
|
className={`${styles.swiperSlide} ${currentSlide === index ? styles.slideActive : ""}`}
|
||||||
|
>
|
||||||
|
<div className={styles.slideContent}>
|
||||||
|
<img
|
||||||
|
src={slide.image}
|
||||||
|
alt={slide.title}
|
||||||
|
className={styles.slideImage}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</SwiperSlide>
|
||||||
|
))}
|
||||||
|
</Swiper>
|
||||||
|
|
||||||
return (
|
|
||||||
<div key={index} className={`${styles.slide} ${slideClass}`}>
|
|
||||||
<div className={styles.imageContainer}>
|
|
||||||
<img src={img} alt={`Слайд ${index + 1}`} className={styles.sliderImage} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
);
|
<h4><div className={styles.slideDescription}>
|
||||||
})}
|
{slides[currentSlide]?.title}
|
||||||
</div>
|
</div></h4>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id={styles.page_container}>
|
|
||||||
<h4>Блок "MCU"</h4>
|
|
||||||
<div className={styles.mcuContainer}>
|
<div className={styles.mcuContainer}>
|
||||||
<p>
|
<p>
|
||||||
Основным вычислительным устройством лабораторного стенда является микроконтроллер STM32F407IG использующий архитектуру ARMv7-M и работающий с максимальной частотой 168MHz. На борту устройства установлено 192Kb оперативной памяти (RAM) и 1Mb постоянной FLASH (ROM). Тактирование осуществляется с помощью двух кварцевых резонаторов: 8MHz для основной системы тактирования и 32.768KHz для встроенных часов реального времени (RTC). Напряжение питания микроконтроллера и логических выводов 3.3V, но большинство контактов толерантных к 5V логике.
|
<div className={styles.slideDescription}>
|
||||||
|
{slides[currentSlide]?.description1}
|
||||||
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Для взаимодействия с микроконтроллером на панели блока "MCU" установлены три тактовых выключателя: RESET - сброс MK, TEST - пользовательская кнопка, BOOT - переход в режим встроенного загрузчика. Выключатель TEST подаёт на контакт PI10 высокий сигнал. Светодиод LD110 управляется контактом PI11 и может использоваться программой пользователя для индикации режима работы. Питания встроенных часов реального времени осуществляется с помощью батареи CR1220.
|
<div className={styles.slideDescription}>
|
||||||
|
{slides[currentSlide]?.description2}
|
||||||
|
</div>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id={styles.padding}>
|
<div id={styles.padding}>
|
||||||
<ContactUs /></div>
|
<ContactUs /></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ const customProjects: Record<string, ReactNode> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getCustomProject = (title: string): ReactNode | null => {
|
export const getCustomProject = (title: string): ReactNode | null => {
|
||||||
const normalizedKey = title.toLowerCase().replace(/\s+/g, "").replace(/[^a-z0-9]/g, "");
|
// const normalizedKey = title.toLowerCase().replace(/\s+/g, "").replace(/[^a-z0-9]/g, "");
|
||||||
return customProjects[normalizedKey] || null;
|
return customProjects[title] || null;
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user