diff --git a/package.json b/package.json
index 39a6091..93fe901 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1",
+ "react-swipeable": "^7.0.1",
"zustand": "^4.5.4"
},
"devDependencies": {
diff --git a/src/components/Layout/Footer.tsx b/src/components/Layout/Footer.tsx
index 34632fa..9d00ffd 100644
--- a/src/components/Layout/Footer.tsx
+++ b/src/components/Layout/Footer.tsx
@@ -9,10 +9,10 @@ export function Footer() {
+
Политика конфиденциальности graff.tech
-+
© 2024 GRAFF interactive. Все права защищены
- {children} -
- ); + return{children}
; } diff --git a/src/components/Layout/Header.tsx b/src/components/Layout/Header.tsx index b2f0230..db885a4 100644 --- a/src/components/Layout/Header.tsx +++ b/src/components/Layout/Header.tsx @@ -4,7 +4,7 @@ export function Header() { return (- {text} -
+{text}
Свяжитесь с нами
Социальные сети
- {text} -
- ); + return{text}
; } function Number({ text }: { text: string }) { - return ( -- {text} -
- ); + return{text}
; } diff --git a/src/components/Main/Distance.tsx b/src/components/Main/Distance.tsx index 668abdb..1bfd2e2 100644 --- a/src/components/Main/Distance.tsx +++ b/src/components/Main/Distance.tsx @@ -19,7 +19,7 @@ export function Distance() {+
Обучающиеся будут получать доступ к системе с высоко детализированной 3D графикой для прохождения сценариев на любом устройстве, без необходимости установки дополнительного ПО. diff --git a/src/components/Main/Efficiency.tsx b/src/components/Main/Efficiency.tsx index d5cf09e..2b94341 100644 --- a/src/components/Main/Efficiency.tsx +++ b/src/components/Main/Efficiency.tsx @@ -23,13 +23,13 @@ export function Effeciency() { title={'готовность к опасным ситуациямние выше на'} />
+
+
- {text} -
+ +{text}
+
Может быть еще какой-нибудь небольшой текст, а то мне не хватает для балланса. Ну если не будет, то как-нибудь переживем
@@ -147,7 +169,6 @@ function TrainingsTab() { function SimulatorsTab() { const width = useWindowWidth(); const [slide, setSlide] = useState(0); - const [touchStart, setTouchStart] = useState(0); const [sliderOffset, setSliderOffset] = useState(-width + 80); const [order, dispatch] = useReducer( @@ -178,13 +199,24 @@ function SimulatorsTab() { setSliderOffset(-width + 80); }, [order, slide, width]); + const handlers = useSwipeable({ + onSwipedLeft: () => { + dispatch('next'); + setSlide(prev => (prev === order.length - 3 ? 0 : prev + 1)); + }, + onSwipedRight: () => { + dispatch('prev'); + setSlide(prev => (prev === 0 ? order.length - 3 : prev - 1)); + }, + }); + return ( -+ +
модель позволяет производить расчеты характеристик работы, отслеживать безопасность работы устройств и симулировать внештатные ситуации.
+
модель позволяет производить расчеты характеристик работы, отслеживать безопасность работы устройств и симулировать внештатные ситуации. @@ -282,7 +302,7 @@ function SimulatorsTab() { function SimulatorsItem({ text }: { text: string }) { return ( -
- +
Проведение виртуальных практических работ, создание учебных мастерских и стендов
@@ -338,21 +358,21 @@ function ForTeachingTab() { className="desktop:hidden" alt="" /> -+
Тренажер для проведения лабораториных работ позволит избежать поломки оборудования, а также экономить на расходных средствах
+
{tag}
@@ -106,7 +105,16 @@ function Slider({ [projects[projects.length - 1], ...projects, projects[0]], ); - const [touchStart, setTouchStart] = useState(0); + const handlers = useSwipeable({ + onSwipedLeft: () => { + setSlide(prev => (prev === order.length - 3 ? 0 : prev + 1)); + dispatch('next'); + }, + onSwipedRight: () => { + setSlide(prev => (prev === 0 ? order.length - 3 : prev - 1)); + dispatch('prev'); + }, + }); useEffect(() => { setSliderOffset(-baseOffset); @@ -120,23 +128,7 @@ function Slider({ transition: `${sliderOffset === 0 || sliderOffset === -baseOffset * 2 ? 0 : 0.4}s`, transform: `translateX(${sliderOffset}px)`, }} - onTouchStart={e => { - setTouchStart(e.targetTouches[0].clientX); - }} - onTouchEnd={e => { - if (e.nativeEvent.changedTouches[0].clientX - touchStart > 100) { - dispatch('prev'); - setSlide(prev => (prev === 0 ? order.length - 3 : prev - 1)); - return; - } else if ( - e.nativeEvent.changedTouches[0].clientX - touchStart < - -100 - ) { - dispatch('next'); - setSlide(prev => (prev === order.length - 3 ? 0 : prev + 1)); - return; - } - }} + {...handlers} > {order.map((project, index) => (- {children} -
- ); + return{children}
; } - -// function TeachingFeature({ -// className = '', -// children, -// }: PropsWithChildren<{ className?: string }>) { -// return ( -//- {text} -
+ +{text}
{order}
+{order}
- {order} -
+{order}
+
{order}