-
- партнеры
-
+
-
+
+
+
+ партнеры
+
+
+
+
+
+
+
+
);
diff --git a/src/components/Video.tsx b/src/components/Video.tsx
index 5f909f0..d56624f 100644
--- a/src/components/Video.tsx
+++ b/src/components/Video.tsx
@@ -1,5 +1,6 @@
/* eslint-disable @next/next/no-img-element */
import { fluxgore, gothampro } from "@/utils/fonts";
+import { useEffect, useRef } from "react";
interface VideoStatsProps {
number: string;
@@ -26,6 +27,34 @@ function VideoStats(props: VideoStatsProps) {
}
function Video() {
+ 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();
+ }, []);
+
+ const addToRefs = (el: HTMLDivElement | null) => {
+ if (el && !elementsRef.current.includes(el)) {
+ elementsRef.current.push(el);
+ }
+ };
+
return (
+
+
-
+
@@ -59,14 +107,17 @@ function Video() {
-