diff --git a/public/images/kamaz.webp b/public/images/kamaz.webp new file mode 100644 index 0000000..4816650 Binary files /dev/null and b/public/images/kamaz.webp differ diff --git a/src/components/Kamaz.tsx b/src/components/Kamaz.tsx new file mode 100644 index 0000000..4cc68c7 --- /dev/null +++ b/src/components/Kamaz.tsx @@ -0,0 +1,129 @@ +/* eslint-disable @next/next/no-img-element */ +import { fluxgore } from "@/utils/fonts"; +import { useEffect, useRef } from "react"; + +function Kamaz() { + const containerRef = useRef(null); + const imageRef = useRef(null); + const elementsRef = useRef<(HTMLDivElement | null)[]>([]); + + useEffect(() => { + const observer = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + entry.target.classList.add("animate-fade-in-up"); + entry.target.classList.remove("opacity-0", "translate-y-8"); + } + }); + }, + { threshold: 0.1, rootMargin: "0px 0px -50px 0px" } + ); + + elementsRef.current.forEach((el) => { + if (el) observer.observe(el); + }); + + return () => observer.disconnect(); + }, []); + + useEffect(() => { + const observer = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) { + entry.target.classList.remove("opacity-0", "translate-y-8"); + entry.target.classList.add("opacity-100", "translate-y-0"); + } + }); + }, + { threshold: 0.1 } + ); + + if (containerRef.current) observer.observe(containerRef.current); + if (imageRef.current) observer.observe(imageRef.current); + + return () => observer.disconnect(); + }, []); + + const addToRefs = (el: HTMLDivElement | null) => { + if (el && !elementsRef.current.includes(el)) { + elementsRef.current.push(el); + } + }; + + return ( +
+
+
+
+

+ КАМАЗ-МАСТЕР +

+
+
+ +
+
+ Tech Festival - Previous Event Highlights +
+
+
+ +
+
+
+

+
+
+

+ Команда "КАМАЗ-мастер" с удовольствием принимает + участие в фестивале технических видов спорта, который проходит в + Москве. Это мероприятие собирает ведущие команды и специалистов + в области автоспорта, технических инноваций и инженерных + решений. Участие "КАМАЗ-мастер" подчеркивает их статус + лидеров в мире ралли-рейдов и их приверженность развитию + технологий и профессионального мастерства. Посетители фестиваля + имеют уникальную возможность ознакомиться с техникой команды, + пообщаться с пилотами и инженерами, а также получить вдохновение + от ярких выступлений и демонстраций. Такое участие способствует + популяризации технических видов спорта и укреплению позиций + российской команды на международной арене. +

+
+
+
+
+
+ ); +} + +export default Kamaz; diff --git a/src/pages/preview.tsx b/src/pages/preview.tsx index 3639a9c..258c879 100644 --- a/src/pages/preview.tsx +++ b/src/pages/preview.tsx @@ -9,6 +9,7 @@ import Navbar from "@/components/Navbar"; import Partners from "@/components/Partners"; import Scheme from "@/components/Scheme"; import Video from "@/components/Video"; +import Kamaz from "@/components/Kamaz"; import Head from "next/head"; export default function Home() { @@ -392,12 +393,14 @@ export default function Home() { Фестиваль технических видов спорта -
+