From 521ed7a60911d6e660c372d288a88aa2f63abedc Mon Sep 17 00:00:00 2001 From: Lanskikh Date: Mon, 16 Sep 2024 14:07:14 +0500 Subject: [PATCH] products tabs fixed --- src/components/Main/Products/Products.tsx | 12 +- .../Main/Products/Tabs/ForTeachingTab.tsx | 100 +++++++------- .../Main/Products/Tabs/IndustrialTab.tsx | 128 +++++++++-------- .../Main/Products/Tabs/SimulatorsTab.tsx | 130 +++++++++--------- 4 files changed, 183 insertions(+), 187 deletions(-) diff --git a/src/components/Main/Products/Products.tsx b/src/components/Main/Products/Products.tsx index d40e1db..32fccf4 100644 --- a/src/components/Main/Products/Products.tsx +++ b/src/components/Main/Products/Products.tsx @@ -13,18 +13,18 @@ export function Products() { function handleMouseMove(e: WheelEvent) { setSticked1( - Math.round(ref2.current!.getBoundingClientRect().top) <= + ref2.current!.getBoundingClientRect().top <= +window.getComputedStyle(ref2.current!).top.slice(0, -2), ); setSticked2( - Math.round(ref3.current!.getBoundingClientRect().top) <= + ref3.current!.getBoundingClientRect().top <= +window.getComputedStyle(ref3.current!).top.slice(0, -2), ); if (e.deltaY > 0) { if ( ref1.current!.getBoundingClientRect().top === +window.getComputedStyle(ref1.current!).top.slice(0, -2) && - Math.round(ref2.current!.getBoundingClientRect().top) !== + ref2.current!.getBoundingClientRect().top !== +window.getComputedStyle(ref2.current!).top.slice(0, -2) ) { window.scrollBy({ @@ -36,8 +36,10 @@ export function Products() { setSticked1(true); } if ( - Math.round(ref2.current!.getBoundingClientRect().top) === - +window.getComputedStyle(ref2.current!).top.slice(0, -2) + Math.round( + ref2.current!.getBoundingClientRect().top - + +window.getComputedStyle(ref2.current!).top.slice(0, -2), + ) === 0 ) { window.scrollBy({ top: diff --git a/src/components/Main/Products/Tabs/ForTeachingTab.tsx b/src/components/Main/Products/Tabs/ForTeachingTab.tsx index 742f876..6aa8039 100644 --- a/src/components/Main/Products/Tabs/ForTeachingTab.tsx +++ b/src/components/Main/Products/Tabs/ForTeachingTab.tsx @@ -3,58 +3,56 @@ import { useHover } from 'usehooks-ts'; import { getIcon } from '../../../../utils/getIcon'; import { useInView } from 'framer-motion'; -export const ForTeachingTab = forwardRef((_, ref) => { - return ( -
-
-

- Интерактивные тренажеры для учебных заведений -

-

03

-
-
-
-
- - -

- Оснащение учебных классов и центров всем необходимым для - современного обучения под «ключ» -

-
-
- обучение - обучение -
+export const ForTeachingTab = forwardRef((_, ref) => ( +
+
+

+ Интерактивные тренажеры для учебных заведений +

+

03

- ); -}); +
+
+
+ + +

+ Оснащение учебных классов и центров всем необходимым для + современного обучения под «ключ» +

+
+
+ обучение + обучение +
+
+)); function ForTeachingOption({ title, diff --git a/src/components/Main/Products/Tabs/IndustrialTab.tsx b/src/components/Main/Products/Tabs/IndustrialTab.tsx index 0591d82..969ae02 100644 --- a/src/components/Main/Products/Tabs/IndustrialTab.tsx +++ b/src/components/Main/Products/Tabs/IndustrialTab.tsx @@ -37,73 +37,71 @@ function TeachingItem({ } export const IndustrialTab = forwardRef( - ({ sticked }, ref) => { - return ( -
-
-
-

Промышленные тренажеры

-

01

-
-
- - - -
+ ({ sticked }, ref) => ( +
+
+
+

Промышленные тренажеры

+

01

- тренажеры - - тренажеры + > + + + +
- ); - }, + тренажеры + + тренажеры +
+ ), ); diff --git a/src/components/Main/Products/Tabs/SimulatorsTab.tsx b/src/components/Main/Products/Tabs/SimulatorsTab.tsx index 5ec0818..985c3ed 100644 --- a/src/components/Main/Products/Tabs/SimulatorsTab.tsx +++ b/src/components/Main/Products/Tabs/SimulatorsTab.tsx @@ -2,81 +2,79 @@ import { forwardRef } from 'react'; function SimulatorsItem({ text }: { text: string }) { return ( -
+
{text}
); } export const SimulatorsTab = forwardRef( - ({ sticked }, ref) => { - return ( + ({ sticked }, ref) => ( +
-
-

Симуляторы управления техникой

-

02

+

Симуляторы управления техникой

+

02

+
+
+ + + + + + +
+
+
+ ржд +

+ В основу симуляторов заложена математическая модель, полностью + соответствующая работе настоящего оборудования +

-
- - - - - - -
-
-
- ржд -

- В основу симуляторов заложена математическая модель, полностью - соответствующая работе настоящего оборудования -

-
-
- ржд -

- Модель позволяет производить расчеты характеристик работы, - отслеживать безопасность работы устройств и симулировать - внештатные ситуации. -

-
+
+ ржд +

+ Модель позволяет производить расчеты характеристик работы, + отслеживать безопасность работы устройств и симулировать внештатные + ситуации. +

- ); - }, +
+ ), );