diff --git a/package-lock.json b/package-lock.json index 471fb08..8de0edc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "eslint-config-next": "15.5.4", "jsdom": "^27.4.0", "tailwindcss": "^4", - "typescript": "5.9.3", + "typescript": "^5", "vitest": "^4.0.16" } }, @@ -6045,9 +6045,9 @@ "license": "MIT" }, "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "dev": true, "license": "MIT", "dependencies": { @@ -7945,11 +7945,11 @@ } }, "node_modules/tar": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.1.tgz", - "integrity": "sha512-nlGpxf+hv0v7GkWBK2V9spgactGOp0qvfWRxUMjqHyzrt3SgwE48DIv/FhqPHJYLHpgW1opq3nERbz5Anq7n1g==", + "version": "7.5.6", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.6.tgz", + "integrity": "sha512-xqUeu2JAIJpXyvskvU3uvQW8PAmHrtXp2KDuMJwQqW8Sqq0CaZBAQ+dKS3RBXVhU4wC5NjAdKrmh84241gO9cA==", "dev": true, - "license": "ISC", + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/fs-minipass": "^4.0.0", "chownr": "^3.0.0", diff --git a/src/components/home/FeaturesSection.tsx b/src/components/home/FeaturesSection.tsx index c82fbe5..5dd6d5e 100644 --- a/src/components/home/FeaturesSection.tsx +++ b/src/components/home/FeaturesSection.tsx @@ -1,6 +1,6 @@ 'use client'; -import React, { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useRef, useState, useCallback } from 'react'; import Image from 'next/image'; import { FiUsers, FiBarChart, FiShield, FiMessageCircle, FiGithub, FiClock, FiBell, FiWifi, FiCode, FiChevronLeft, FiChevronRight, FiZap } from 'react-icons/fi'; import { FaTrophy } from 'react-icons/fa'; @@ -103,28 +103,40 @@ const FeaturesSection = () => { } ]; - useEffect(() => { + + const startAutoScroll = useCallback(() => { + if (intervalRef.current) { + clearInterval(intervalRef.current); + } + intervalRef.current = setInterval(() => { setCurrentIndex((prev) => (prev + 1) % features.length); - }, 4000); + }, 10000); + }, [features.length]); + + useEffect(() => { + startAutoScroll(); return () => { if (intervalRef.current) { clearInterval(intervalRef.current); } }; - }, [features.length]); + }, [startAutoScroll]); const nextSlide = () => { setCurrentIndex((prev) => (prev + 1) % features.length); + startAutoScroll(); }; const prevSlide = () => { setCurrentIndex((prev) => (prev - 1 + features.length) % features.length); + startAutoScroll(); }; const goToSlide = (index: number) => { setCurrentIndex(index); + startAutoScroll(); }; return ( @@ -142,7 +154,7 @@ const FeaturesSection = () => { Open Source
- +{features[currentIndex].detailedDescription}
@@ -264,7 +276,7 @@ const FeaturesSection = () => { {/* Side Card */}Join developers building the future of social browsing. Contribute and help shape the project.