diff --git a/src/components/Main/ModalWithForm.tsx b/src/components/Main/ModalWithForm.tsx index 2836947..a940e1f 100644 --- a/src/components/Main/ModalWithForm.tsx +++ b/src/components/Main/ModalWithForm.tsx @@ -189,8 +189,9 @@ export function ModalWithForm() { id="description" placeholder="Опишите вашу задачу" value={description} + rows={1} onChange={e => setDescription(e.target.value)} - className="bg-transparent border-b py-4 focus:border-white max-h-[300px] h-auto rounded-none border-[#3D425C] resize-none outline-none transition-all w-full placeholder:h4 placeholder:font-medium placeholder:select-none" + className="bg-transparent border-b py-4 focus:border-white max-h-[300px] h-auto rounded-none border-[#3D425C] resize-none outline-none transition-all w-full placeholder:h4 placeholder:font-medium placeholder:select-none placeholder-shown:overflow-hidden" /> diff --git a/src/components/Main/Products/Tabs/ForTeachingTab.tsx b/src/components/Main/Products/Tabs/ForTeachingTab.tsx index 84890c6..6b35ad4 100644 --- a/src/components/Main/Products/Tabs/ForTeachingTab.tsx +++ b/src/components/Main/Products/Tabs/ForTeachingTab.tsx @@ -1,54 +1,55 @@ -import { forwardRef, useRef } from 'react'; +import { useRef } from 'react'; import { getIcon } from '../../../../utils/getIcon'; import { useInView } from 'framer-motion'; -export const ForTeachingTab = forwardRef((_, ref) => ( -
-
-

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

-

03

-
-
-
-
- - -

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

-
+export function ForTeachingTab() { + return ( +
+
+

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

+

03

+
+
+
+
+ + +

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

+
+
+ обучение + обучение
- обучение - обучение
-
-)); + ); +} function ForTeachingOption({ title, diff --git a/src/components/Main/Products/Tabs/IndustrialTab.tsx b/src/components/Main/Products/Tabs/IndustrialTab.tsx index fab370a..fbeb211 100644 --- a/src/components/Main/Products/Tabs/IndustrialTab.tsx +++ b/src/components/Main/Products/Tabs/IndustrialTab.tsx @@ -1,4 +1,4 @@ -import { forwardRef, useRef } from 'react'; +import { useRef } from 'react'; import { getIcon } from '../../../../utils/getIcon'; import { useInView } from 'framer-motion'; @@ -35,33 +35,24 @@ function TeachingItem({ ); } -export const IndustrialTab = forwardRef( - ({ sticked }, ref) => ( +export function IndustrialTab() { + return (
-
-
-

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

-

01

-
+
+

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

+

01

+
+
( title="обучение правилам промышленной безопасности и охраны труда" />
+
+ тренажеры + тренажеры + тренажеры +
- тренажеры - - тренажеры
- ), -); + ); +} diff --git a/src/components/Main/Products/Tabs/SimulatorsTab.tsx b/src/components/Main/Products/Tabs/SimulatorsTab.tsx index 26d4ec5..4f169df 100644 --- a/src/components/Main/Products/Tabs/SimulatorsTab.tsx +++ b/src/components/Main/Products/Tabs/SimulatorsTab.tsx @@ -1,28 +1,20 @@ -import { forwardRef } from 'react'; - function SimulatorsItem({ text }: { text: string }) { return ( -
+
{text}
); } -export const SimulatorsTab = forwardRef( - ({ sticked }, ref) => ( +export function SimulatorsTab() { + return (
-
+

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

02

@@ -30,10 +22,7 @@ export const SimulatorsTab = forwardRef( itemProp="simulatorsTypes" itemScope itemType="http://schema.org/SimulatorsTypes" - className={ - 'flex flex-wrap gap-2 lg:max-w-[1000px]' + - (sticked ? ' transition-opacity sm:opacity-0' : ' opacity-100') - } + className="flex flex-wrap gap-2 lg:max-w-[1000px]" > @@ -46,10 +35,7 @@ export const SimulatorsTab = forwardRef( itemProp="simulatorsModel" itemScope itemType="http://schema.org/SimulatorsModel" - className={ - 'sm:flex max-sm:space-y-6 gap-x-2' + - (sticked ? ' transition-opacity sm:opacity-0' : ' opacity-100') - } + className="sm:flex max-sm:space-y-6 gap-x-2" >
(
- ), -); + ); +} diff --git a/src/components/Main/Products/index.tsx b/src/components/Main/Products/index.tsx index 83ce892..866a285 100644 --- a/src/components/Main/Products/index.tsx +++ b/src/components/Main/Products/index.tsx @@ -1,74 +1,18 @@ -import { useEffect, useRef, useState } from 'react'; import { ForTeachingTab } from './Tabs/ForTeachingTab'; import { SimulatorsTab } from './Tabs/SimulatorsTab'; import { IndustrialTab } from './Tabs/IndustrialTab'; export function Products() { - const ref1 = useRef(null); - const ref2 = useRef(null); - const ref3 = useRef(null); - - const [stiked1, setSticked1] = useState(false); - const [stiked2, setSticked2] = useState(false); - - function handleMouseMove(e: WheelEvent) { - setSticked1( - ref2.current!.getBoundingClientRect().top <= - +window.getComputedStyle(ref2.current!).top.slice(0, -2), - ); - setSticked2( - 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) && - ref2.current!.getBoundingClientRect().top !== - +window.getComputedStyle(ref2.current!).top.slice(0, -2) - ) { - window.scrollBy({ - behavior: 'smooth', - top: - ref2.current!.getBoundingClientRect().top - - +window.getComputedStyle(ref2.current!).top.slice(0, -2), - }); - setSticked1(true); - } - if ( - Math.round( - ref2.current!.getBoundingClientRect().top - - +window.getComputedStyle(ref2.current!).top.slice(0, -2), - ) === 0 - ) { - window.scrollBy({ - top: - ref3.current!.getBoundingClientRect().top - - +window.getComputedStyle(ref3.current!).top.slice(0, -2), - }); - setSticked2(true); - } - } - } - - useEffect(() => { - window?.addEventListener('wheel', handleMouseMove); - - return () => { - window?.removeEventListener('wheel', handleMouseMove); - }; - }, [ref1, ref2, ref3]); - return (
- - - + + +
); } diff --git a/src/components/Main/Project.tsx b/src/components/Main/Project.tsx index 4464289..5e56d0a 100644 --- a/src/components/Main/Project.tsx +++ b/src/components/Main/Project.tsx @@ -2,7 +2,7 @@ import { useRef } from 'react'; import { IProject, Media } from '../../types/IProject'; export function Project({ src, title, tags, media, year }: IProject) { - const ref = useRef(null); + const videoRef = useRef(null); return (
) { ) : (