'use client'; import React, { useState, useEffect } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; import Image from 'next/image'; const features = [ { step: 'Step 1', content: 'Start your Web3 journey by learning the basics of blockchain.', image: 'https://images.unsplash.com/photo-1723958929247-ef054b525153?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' }, { step: 'Step 2', content: 'Dive deep into blockchain fundamentals and smart contract development.', image: 'https://images.unsplash.com/photo-1723931464622-b7df7c71e380?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' }, { step: 'Step 3', content: 'Graduate with hands-on Web3 experience through building decentralized applications.', image: 'https://images.unsplash.com/photo-1725961476494-efa87ae3106a?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D' }, ]; const FeatureSection = () => { const [currentFeature, setCurrentFeature] = useState(0); const [progress, setProgress] = useState(0); const [, setIsMobile] = useState(false); useEffect(() => { const handleResize = () => { setIsMobile(window.innerWidth < 768); }; handleResize(); window.addEventListener('resize', handleResize); return () => window.removeEventListener('resize', handleResize); }, []); useEffect(() => { const timer = setInterval(() => { if (progress < 100) { setProgress((prev) => prev + 3.33); } else { setCurrentFeature((prev) => (prev + 1) % features.length); setProgress(0); } }, 100); return () => clearInterval(timer); }, [progress]); return (
{feature.content}