From 895417e25a7aa4f45d034ef04dcbc3e5de250c3b Mon Sep 17 00:00:00 2001 From: kleap-admin Date: Thu, 15 Jan 2026 13:41:51 +0000 Subject: [PATCH] Update components/companies.tsx --- components/companies.tsx | 120 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 components/companies.tsx diff --git a/components/companies.tsx b/components/companies.tsx new file mode 100644 index 0000000..bb2d109 --- /dev/null +++ b/components/companies.tsx @@ -0,0 +1,120 @@ +"use client"; +import { useEffect, useState } from "react"; +import { Heading } from "./heading"; +import { Subheading } from "./subheading"; +import Image from "next/image"; +import { AnimatePresence, motion } from "framer-motion"; + +export const Companies = () => { + let [logos, setLogos] = useState([ + [ + { + title: "netflix", + src: "/logos/netflix.png", + }, + { + title: "google", + src: "/logos/google.webp", + }, + { + title: "meta", + src: "/logos/meta.png", + }, + { + title: "onlyfans", + src: "/logos/onlyfans.png", + }, + ], + [ + { + title: "netflix second", + src: "/logos/netflix.png", + }, + { + title: "google second", + src: "/logos/google.webp", + }, + { + title: "meta second", + src: "/logos/meta.png", + }, + { + title: "onlyfans second", + src: "/logos/onlyfans.png", + }, + ], + ]); + const [activeLogoSet, setActiveLogoSet] = useState(logos[0]); + const [isAnimating, setIsAnimating] = useState(false); + + const flipLogos = () => { + setLogos((currentLogos) => { + const newLogos = [...currentLogos.slice(1), currentLogos[0]]; + setActiveLogoSet(newLogos[0]); + setIsAnimating(true); + return newLogos; + }); + }; + + useEffect(() => { + if (!isAnimating) { + const timer = setTimeout(() => { + flipLogos(); + }, 3000); + return () => clearTimeout(timer); // Clear timeout if component unmounts or isAnimating changes + } + }, [isAnimating]); + + return ( +
+ Trusted by the best companies + + [App Name] is trusted by leading companies worldwide. + + +
+ { + setIsAnimating(false); + }} + > + {activeLogoSet.map((logo, idx) => ( + + {logo.title} + + ))} + +
+
+ ); +};