diff --git a/.gitignore b/.gitignore index a547bf3..578bac1 100644 --- a/.gitignore +++ b/.gitignore @@ -7,16 +7,38 @@ yarn-error.log* pnpm-debug.log* lerna-debug.log* +# Dependencies node_modules + +# Build output dist dist-ssr + +# Environment files +.env +.env.* +!.env.example +!.env.sample +!.env.template + +# Local overrides *.local +# Cache and temp files +.cache +.temp +tmp +temp +.eslintcache +.vite +coverage + # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store +Thumbs.db *.suo *.ntvs* *.njsproj diff --git a/src/components/PaginationControls.jsx b/src/components/PaginationControls.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/components/ToolCard.jsx b/src/components/ToolCard.jsx new file mode 100644 index 0000000..e69de29 diff --git a/src/data/toolsData.js b/src/data/toolsData.js new file mode 100644 index 0000000..d3a1608 --- /dev/null +++ b/src/data/toolsData.js @@ -0,0 +1,132 @@ +import { + Contrast, + FileEdit, + Hash, + Image as ImageIcon, + Images, + Layers, + LayoutGrid, + Lock, + Minimize2, + RefreshCw, + SplitSquareHorizontal, + Stamp, +} from "lucide-react"; + +export const ALL_TOOLS = [ + { + id: 1, + name: "Merge PDF", + description: + "Combine multiple PDFs into a single document in milliseconds. Drag, drop, and organize securely.", + icon: Layers, + path: "/merge", + buttonText: "Open Merge Tool", + iconSize: "w-6 h-6", + }, + { + id: 2, + name: "Split PDF", + description: + "Extract specific pages or break a massive document down into smaller files instantly.", + icon: SplitSquareHorizontal, + path: "/split", + buttonText: "Open Split Tool", + iconSize: "w-6 h-6", + }, + { + id: 3, + name: "Add Watermark", + description: + "Stamp custom text diagonally across your documents. Perfect for sensitive drafts and contracts.", + icon: Stamp, + path: "/watermark", + buttonText: "Open Watermark Tool", + iconSize: "w-6 h-6", + }, + { + id: 4, + name: "Image to PDF", + description: + "Convert JPG and PNG images into a high-quality PDF document. Drag to reorder your pages.", + icon: ImageIcon, + path: "/image-to-pdf", + buttonText: "Open Image to PDF", + iconSize: "w-6 h-6", + }, + { + id: 5, + name: "Compress PDF", + description: "Reduce file size while maintaining visual quality.", + icon: Minimize2, + path: "/compress", + buttonText: "Open Compress PDF", + iconSize: "w-6 h-6", + }, + { + id: 6, + name: "Rotate PDF", + description: "Rotate pages in your PDF document.", + icon: RefreshCw, + path: "/rotate", + buttonText: "Open Rotate PDF", + iconSize: "w-10 h-10", + }, + { + id: 7, + name: "Organize PDF", + description: "Organize pages in your PDF document.", + icon: LayoutGrid, + path: "/organize", + buttonText: "Open Organize PDF", + iconSize: "w-10 h-10", + }, + { + id: 8, + name: "PDF to Images", + description: "Extract images from your PDF document.", + icon: Images, + path: "/pdf-to-image", + buttonText: "Open PDF to Images", + iconSize: "w-6 h-6", + }, + { + id: 9, + name: "Grayscale PDF", + description: "Convert your PDF to grayscale.", + icon: Contrast, + path: "/grayscale", + buttonText: "Open Grayscale PDF", + iconSize: "w-6 h-6", + }, + { + id: 10, + name: "Page Numbers", + description: + "Auto-stamp sequential numbers on every page footer. Choose position, prefix, and start number.", + icon: Hash, + path: "/page-numbers", + buttonText: "Open Page Numbers", + iconSize: "w-6 h-6", + }, + { + id: 11, + name: "Lock PDF", + description: + "Password-protect your PDF with RC4 encryption. Processed entirely in your browser - nothing is uploaded.", + icon: Lock, + path: "/lock-pdf", + buttonText: "Open Lock PDF", + iconSize: "w-6 h-6", + }, + { + id: 12, + name: "Edit PDF", + description: + "Draw, highlight, add text, and annotate your PDF pages directly in the browser.", + icon: FileEdit, + path: "/edit-pdf", + buttonText: "Open PDF Editor", + iconSize: "w-6 h-6", + }, +]; diff --git a/src/pages/Home/components/ToolsGrid.jsx b/src/pages/Home/components/ToolsGrid.jsx index be8a2c4..43172e6 100644 --- a/src/pages/Home/components/ToolsGrid.jsx +++ b/src/pages/Home/components/ToolsGrid.jsx @@ -1,5 +1,7 @@ -import React from "react"; +import React, { useState } from "react"; import { Link } from "react-router-dom"; +import { motion as Motion } from 'framer-motion'; + import { Layers, SplitSquareHorizontal, @@ -14,358 +16,282 @@ import { Lock, FileEdit, } from "lucide-react"; -import { motion } from "framer-motion"; + +// FIX #1: Move tools data outside component to avoid recreation on every render +const TOOLS_DATA = [ + { + id: 1, + name: "Merge PDF", + description: "Combine multiple PDFs into a single document in milliseconds. Drag, drop, and organize securely.", + icon: Layers, + path: "/merge", + buttonText: "Open Merge Tool", + iconSize: "w-6 h-6", + delay: 0, + }, + { + id: 2, + name: "Split PDF", + description: "Extract specific pages or break a massive document down into smaller files instantly.", + icon: SplitSquareHorizontal, + path: "/split", + buttonText: "Open Split Tool", + iconSize: "w-6 h-6", + delay: 0.1, + }, + { + id: 3, + name: "Add Watermark", + description: "Stamp custom text diagonally across your documents. Perfect for sensitive drafts and contracts.", + icon: Stamp, + path: "/watermark", + buttonText: "Open Watermark Tool", + iconSize: "w-6 h-6", + delay: 0.2, + }, + { + id: 4, + name: "Image to PDF", + description: "Convert JPG and PNG images into a high-quality PDF document. Drag to reorder your pages.", + icon: ImageIcon, + path: "/image-to-pdf", + buttonText: "Open Image to PDF", + iconSize: "w-6 h-6", + delay: 0.3, + }, + { + id: 5, + name: "Compress PDF", + description: "Reduce file size while maintaining visual quality.", + icon: Minimize2, + path: "/compress", + buttonText: "Open Compress PDF", + iconSize: "w-6 h-6", + delay: 0.3, + }, + { + id: 6, + name: "Rotate PDF", + description: "Rotate pages in your PDF document.", + icon: RefreshCw, + path: "/rotate", + buttonText: "Open Rotate PDF", + iconSize: "w-10 h-10", + delay: 0.3, + }, + { + id: 7, + name: "Organize PDF", + description: "Organize pages in your PDF document.", + icon: LayoutGrid, + path: "/organize", + buttonText: "Open Organize PDF", + iconSize: "w-10 h-10", + delay: 0.3, + }, + { + id: 8, + name: "PDF to Images", + description: "Extract images from your PDF document.", + icon: Images, + path: "/pdf-to-image", + buttonText: "Open PDF to Images", + iconSize: "w-6 h-6", + delay: 0.3, + }, + { + id: 9, + name: "Grayscale PDF", + description: "Convert your PDF to grayscale.", + icon: Contrast, + path: "/grayscale", + buttonText: "Open Grayscale PDF", + iconSize: "w-6 h-6", + delay: 0.3, + }, + { + id: 10, + name: "Page Numbers", + description: "Auto-stamp sequential numbers on every page footer. Choose position, prefix, and start number.", + icon: Hash, + path: "/page-numbers", + buttonText: "Open Page Numbers", + iconSize: "w-6 h-6", + delay: 0.4, + }, + { + id: 11, + name: "Lock PDF", + description: "Password-protect your PDF with RC4 encryption. Processed entirely in your browser — nothing is uploaded.", + icon: Lock, + path: "/lock-pdf", + buttonText: "Open Lock PDF", + iconSize: "w-6 h-6", + delay: 0.4, + }, + { + id: 12, + name: "Edit PDF", + description: "Draw, highlight, add text, and annotate your PDF pages directly in the browser.", + icon: FileEdit, + path: "/edit-pdf", + buttonText: "Open PDF Editor", + iconSize: "w-6 h-6", + delay: 0.4, + }, +]; export function ToolsGrid() { - const cardVariants = { + const [currentPage, setCurrentPage] = useState(1); + const toolsPerPage = 6; + const totalPages = Math.ceil(TOOLS_DATA.length / toolsPerPage); + + // FIX #4: Convert cardVariants to a function to use the custom prop for per-card delays + const cardVariants = (delay) => ({ hidden: { opacity: 0, y: 40 }, visible: { opacity: 1, y: 0, - transition: { type: "spring", stiffness: 200, damping: 20 }, + transition: { type: "spring", stiffness: 200, damping: 20, delay }, }, - }; + }); - return ( -
- Combine multiple PDFs into a single document in milliseconds. Drag, - drop, and organize securely. -
-- Extract specific pages or break a massive document down into smaller - files instantly. -
-- Stamp custom text diagonally across your documents. Perfect for - sensitive drafts and contracts. -
-- Convert JPG and PNG images into a high-quality PDF document. Drag to - reorder your pages. -
-- Reduce file size while maintaining visual quality. -
-- Rotate pages in your PDF document. -
-- Organize pages in your PDF document. -
-- Extract images from your PDF document. -
-+ {tool.description} +
+- Convert your PDF to grayscale. -
-- Auto-stamp sequential numbers on every page footer. Choose position, prefix, and start number. -
-- Password-protect your PDF with RC4 encryption. Processed entirely in your browser — nothing is uploaded. -
-- Draw, highlight, add text, and annotate your PDF pages directly in the browser. -
-