import React, { useState, useEffect } from 'react'; import { ChevronLeft, ChevronRight } from 'lucide-react'; const MagazineFlipbook = () => { const [currentPage, setCurrentPage] = useState(0); const [isFlipping, setIsFlipping] = useState(false); const totalPages = 20; // Sample content for pages const pages = Array.from({ length: totalPages }, (_, i) => ({ id: i, content: `Page ${i + 1}`, bgColor: i % 2 === 0 ? 'bg-gray-50' : 'bg-white' })); const handleNextPage = () => { if (currentPage < totalPages - 1 && !isFlipping) { setIsFlipping(true); setCurrentPage(prev => prev + 1); setTimeout(() => setIsFlipping(false), 500); } }; const handlePrevPage = () => { if (currentPage > 0 && !isFlipping) { setIsFlipping(true); setCurrentPage(prev => prev - 1); setTimeout(() => setIsFlipping(false), 500); } }; return (
{/* Magazine Container */}
{/* Page Counter */}
{currentPage + 1} / {totalPages}
{/* Pages Container */}
{pages.map((page, index) => (
{/* Page Content */}
{/* Header */}
{index === 0 ? '1:1 MAGAZINE' : `Chapter ${index}`}
{/* Sample Content */}
{`Content

{index === 0 ? "Spring Collection 2024" : `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.` }

{index === 0 ? "Editor's Note" : `Section ${index}`}

Fashion meets innovation in our latest issue.

))}
{/* Navigation Buttons */}
{/* Page Thumbnails */}
{pages.map((page, index) => ( ))}
); }; export default MagazineFlipbook;