diff --git a/src/components/HoverTicker.tsx b/src/components/HoverTicker.tsx deleted file mode 100644 index b2c242f..0000000 --- a/src/components/HoverTicker.tsx +++ /dev/null @@ -1,100 +0,0 @@ -"use client"; - -import { useRef, useEffect, ReactNode } from "react"; - -interface HoverTickerProps { - children: ReactNode; - className?: string; - baseSpeed?: number; - hoverSpeed?: number; -} - -export default function HoverTicker({ - children, - className = "", - baseSpeed = 1.2, - hoverSpeed = 3.5, - }: HoverTickerProps) { - - const containerRef = useRef(null); - const mouseZoneRef = useRef<"left" | "right" | "paused" | "none">("none"); - - useEffect(() => { - const container = containerRef.current; - if (!container) return; - - let animationFrameId: number; - - const animate = () => { - if (container) { - const zone = mouseZoneRef.current; - - if (zone === "none") { - container.scrollLeft += baseSpeed; - } else if (zone === "right") { - container.scrollLeft += hoverSpeed; - } else if (zone === "left") { - container.scrollLeft -= hoverSpeed; - } - - // Infinite scroll cycle - const maxScroll = container.scrollWidth / 2; - - if (container.scrollLeft >= maxScroll) { - container.scrollLeft -= maxScroll / 2; - } else if (container.scrollLeft <= 0 && (zone === "left" || zone === "paused")) { - container.scrollLeft += maxScroll / 2; - } - } - animationFrameId = requestAnimationFrame(animate); - }; - - animationFrameId = requestAnimationFrame(animate); - - return () => cancelAnimationFrame(animationFrameId); - }, [baseSpeed, hoverSpeed]); - - const handleMouseMove = (e: React.MouseEvent) => { - const container = containerRef.current; - if (!container) return; - - const rect = container.getBoundingClientRect(); - const mouseX = e.clientX - rect.left; - const width = rect.width; - - if (mouseX < width * 0.3) { - mouseZoneRef.current = "left"; - } else if (mouseX > width * 0.7) { - mouseZoneRef.current = "right"; - } else { - mouseZoneRef.current = "paused"; - } - }; - - const handleMouseLeave = () => { - mouseZoneRef.current = "none"; - }; - - return ( -
-
- {children} -
- - -
- ); -} \ No newline at end of file diff --git a/src/components/Sponsors.tsx b/src/components/Sponsors.tsx index 2688a4b..c4537c6 100644 --- a/src/components/Sponsors.tsx +++ b/src/components/Sponsors.tsx @@ -4,7 +4,6 @@ import { vipnagorgialla } from "@/components/Vipnagorgialla"; import { useTranslations } from "next-intl"; import Image from "next/image"; import NextLink from "next/link"; -import HoverTicker from "@/components/HoverTicker"; interface Sponsor { href: string; @@ -163,7 +162,7 @@ const sponsors: Sponsor[] = [ src: "/sponsors/istar.jpg", alt: "iStar Kebab", width: 244, - height: 244 + height: 244, }, ]; @@ -181,65 +180,53 @@ export default function Sponsors({ const t = useTranslations(); return ( -
- {showTitle && ( -

- {t("home.sections.poweredBy")} -

- )} +
+ {showTitle && ( +

+ {t("home.sections.poweredBy")} +

+ )} - -
- {tickerSponsors.map((sponsor, index) => ( - = sponsors.length} - tabIndex={index >= sponsors.length ? -1 : undefined} - > - {sponsor.alt} - - ))} -
-
- - +
+
+ {tickerSponsors.map((sponsor, index) => ( + = sponsors.length} + tabIndex={index >= sponsors.length ? -1 : undefined} + > + {sponsor.alt} + + ))} +
+ + +
); }