{ "name": "toolpro", "private": true, "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview", "lint": "eslint ." }, "dependencies": { "lucide-react": "^0.383.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.24.1" }, "devDependencies": { "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", "autoprefixer": "^10.4.19", "postcss": "^8.4.39", "tailwindcss": "^3.4.4", "vite": "^5.3.1" } } import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], }); /** @type {import('tailwindcss').Config} */ export default { content: ['./index.html', './src/**/*.{js,jsx}'], theme: { extend: { colors: { charcoal: { DEFAULT: '#1B1D21', 950: '#0E0F11', 900: '#17181B', 800: '#1B1D21', 700: '#26282E', 600: '#34363D', 500: '#4A4D56', }, steel: { 100: '#EDEEF0', 200: '#DFE1E4', 300: '#C6C9CE', 400: '#9A9EA6', 500: '#6B6F78', }, accent: { DEFAULT: '#D9480F', 600: '#C23F0B', 700: '#A3350A', light: '#F0672C', }, }, fontFamily: { display: ['"Oswald"', 'sans-serif'], body: ['"Inter"', 'sans-serif'], }, clipPath: {}, boxShadow: { panel: '0 20px 60px -25px rgba(14, 15, 17, 0.45)', }, keyframes: { fadeUp: { '0%': { opacity: 0, transform: 'translateY(16px)' }, '100%': { opacity: 1, transform: 'translateY(0)' }, }, toastIn: { '0%': { opacity: 0, transform: 'translateX(24px)' }, '100%': { opacity: 1, transform: 'translateX(0)' }, }, }, animation: { fadeUp: 'fadeUp 0.6s ease forwards', toastIn: 'toastIn 0.3s ease forwards', }, }, }, plugins: [], }; export default { plugins: { tailwindcss: {}, autoprefixer: {}, }, }; TOOLPRO — Professional Tools. Built to Perform.
import React from 'react'; import ReactDOM from 'react-dom/client'; import { BrowserRouter } from 'react-router-dom'; import App from './App.jsx'; import { ShopProvider } from './context/ShopContext.jsx'; import './index.css'; ReactDOM.createRoot(document.getElementById('root')).render( ); @tailwind base; @tailwind components; @tailwind utilities; html { scroll-behavior: smooth; } body { font-family: 'Inter', sans-serif; } h1, h2, h3, h4, .font-display { font-family: 'Oswald', sans-serif; } ::selection { background-color: #D9480F; color: #fff; } /* Diagonal-cut industrial corner — the site's one signature structural device, used sparingly on the hero panel, promo banner and primary buttons. */ .cut-corner { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%); } .cut-corner-sm { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); } .industrial-grid { background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px); background-size: 40px 40px; } .diamond-plate { background-image: radial-gradient(circle at 2px 2px, rgba(0,0,0,0.06) 1.5px, transparent 0); background-size: 16px 16px; } .line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } /* Respect reduced motion preference */ @media (prefers-reduced-motion: reduce) { * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; } } import React, { useEffect } from 'react'; import { Routes, Route, useLocation } from 'react-router-dom'; import Navbar from './components/Navbar.jsx'; import Footer from './components/Footer.jsx'; import Toast from './components/Toast.jsx'; import Home from './pages/Home.jsx'; import Products from './pages/Products.jsx'; import ProductDetails from './pages/ProductDetails.jsx'; import Cart from './pages/Cart.jsx'; import Checkout from './pages/Checkout.jsx'; import Wishlist from './pages/Wishlist.jsx'; import OrderSuccess from './pages/OrderSuccess.jsx'; import About from './pages/About.jsx'; import Contact from './pages/Contact.jsx'; import NotFound from './pages/NotFound.jsx'; function ScrollToTop() { const { pathname } = useLocation(); useEffect(() => { window.scrollTo(0, 0); }, [pathname]); return null; } export default function App() { return (
} /> } /> } /> } /> } /> } /> } /> } /> } /> } />
); } import React, { createContext, useContext, useEffect, useMemo, useState, useCallback } from 'react'; const ShopContext = createContext(null); const CART_KEY = 'toolpro_cart_v1'; const WISHLIST_KEY = 'toolpro_wishlist_v1'; function readStorage(key, fallback) { try { const raw = localStorage.getItem(key); return raw ? JSON.parse(raw) : fallback; } catch { return fallback; } } export function ShopProvider({ children }) { const [cart, setCart] = useState(() => readStorage(CART_KEY, [])); const [wishlist, setWishlist] = useState(() => readStorage(WISHLIST_KEY, [])); const [toast, setToast] = useState(null); useEffect(() => { localStorage.setItem(CART_KEY, JSON.stringify(cart)); }, [cart]); useEffect(() => { localStorage.setItem(WISHLIST_KEY, JSON.stringify(wishlist)); }, [wishlist]); const showToast = useCallback((message, type = 'success') => { setToast({ message, type, id: Date.now() }); }, []); useEffect(() => { if (!toast) return; const t = setTimeout(() => setToast(null), 2600); return () => clearTimeout(t); }, [toast]); const addToCart = useCallback( (product, quantity = 1) => { setCart((prev) => { const existing = prev.find((item) => item.id === product.id); if (existing) { return prev.map((item) => item.id === product.id ? { ...item, quantity: item.quantity + quantity } : item ); } return [...prev, { id: product.id, quantity }]; }); showToast(`${product.name} added to cart`, 'success'); }, [showToast] ); const removeFromCart = useCallback((productId) => { setCart((prev) => prev.filter((item) => item.id !== productId)); }, []); const updateQuantity = useCallback((productId, quantity) => { setCart((prev) => prev .map((item) => (item.id === productId ? { ...item, quantity: Math.max(1, quantity) } : item)) .filter((item) => item.quantity > 0) ); }, []); const clearCart = useCallback(() => setCart([]), []); const isInWishlist = useCallback((productId) => wishlist.includes(productId), [wishlist]); const toggleWishlist = useCallback( (product) => { setWishlist((prev) => { if (prev.includes(product.id)) { showToast(`${product.name} removed from wishlist`, 'info'); return prev.filter((id) => id !== product.id); } showToast(`${product.name} added to wishlist`, 'success'); return [...prev, product.id]; }); }, [showToast] ); const removeFromWishlist = useCallback((productId) => { setWishlist((prev) => prev.filter((id) => id !== productId)); }, []); const cartCount = useMemo(() => cart.reduce((sum, item) => sum + item.quantity, 0), [cart]); const value = { cart, wishlist, cartCount, addToCart, removeFromCart, updateQuantity, clearCart, isInWishlist, toggleWishlist, removeFromWishlist, toast, showToast, }; return {children}; } export function useShop() { const ctx = useContext(ShopContext); if (!ctx) throw new Error('useShop must be used within a ShopProvider'); return ctx; } // Central product catalog. Images use seeded picsum.photos placeholders so every // product always resolves to a real image (no broken-link risk). Swap the `image` // field for real product photography before going live. const img = (seed, w = 700, h = 700) => `https://picsum.photos/seed/${seed}/${w}/${h}`; export const categories = [ { id: 'power-tools', name: 'Power Tools', description: 'Cordless drills, saws & grinders for heavy-duty jobs.', image: img('toolpro-power-tools', 500, 400), }, { id: 'hand-tools', name: 'Hand Tools', description: 'Wrenches, screwdrivers & pliers built to last.', image: img('toolpro-hand-tools', 500, 400), }, { id: 'drills', name: 'Drills', description: 'Impact & hammer drills for every material.', image: img('toolpro-drills', 500, 400), }, { id: 'grinders', name: 'Grinders', description: 'Angle & bench grinders for precision finishing.', image: img('toolpro-grinders', 500, 400), }, { id: 'saws', name: 'Saws', description: 'Circular, jig & reciprocating saws.', image: img('toolpro-saws', 500, 400), }, { id: 'measuring-tools', name: 'Measuring Tools', description: 'Tapes, levels & precision instruments.', image: img('toolpro-measuring', 500, 400), }, { id: 'workshop-equipment', name: 'Workshop Equipment', description: 'Benches, storage & shop essentials.', image: img('toolpro-workshop', 500, 400), }, { id: 'accessories', name: 'Accessories', description: 'Bits, blades, cases & consumables.', image: img('toolpro-accessories', 500, 400), }, ]; export const brands = ['TOOLPRO', 'TOOLPRO PRO', 'TOOLPRO Industrial']; export const products = [ { id: 'p1', name: 'TOOLPRO Cordless Impact Drill', category: 'Drills', categoryId: 'drills', brand: 'TOOLPRO', price: 4999, originalPrice: 6499, rating: 4.8, reviewCount: 214, stock: 32, isBestSeller: true, isFeatured: true, description: 'A brushless 18V impact drill built for all-day jobsite use. Delivers high torque for demanding fastening and drilling tasks in wood, metal and masonry, with a lightweight magnesium body that reduces fatigue on long shifts.', features: [ 'Brushless motor for longer runtime and less heat', '2-speed gearbox: 0-450 / 0-1,700 RPM', 'LED work light with 3-second afterglow', 'Includes 2x 2.0Ah batteries and fast charger', ], specifications: { Voltage: '18V', Chuck: '13mm keyless', Torque: '65 Nm', Weight: '1.6 kg', 'Battery Included': 'Yes, 2x 2.0Ah', Warranty: '1 Year', }, images: [img('toolpro-p1-a'), img('toolpro-p1-b'), img('toolpro-p1-c')], }, { id: 'p2', name: 'TOOLPRO Heavy Duty Angle Grinder', category: 'Grinders', categoryId: 'grinders', brand: 'TOOLPRO', price: 3499, originalPrice: 4499, rating: 4.7, reviewCount: 158, stock: 21, isBestSeller: true, isFeatured: true, description: 'A rugged 850W angle grinder for cutting, grinding and finishing steel, tile and stone. Anti-vibration side handle and tool-free guard adjustment make it fast to set up between tasks.', features: [ '850W motor, 11,000 RPM no-load speed', 'Tool-free guard adjustment', 'Spindle lock for fast disc changes', 'Compatible with 100mm discs', ], specifications: { Power: '850W', 'Disc Size': '100mm (4")', Speed: '11,000 RPM', Weight: '1.9 kg', Warranty: '1 Year', }, images: [img('toolpro-p2-a'), img('toolpro-p2-b'), img('toolpro-p2-c')], }, { id: 'p3', name: 'TOOLPRO Professional Hammer Drill', category: 'Drills', categoryId: 'drills', brand: 'TOOLPRO Pro', price: 5999, originalPrice: 7499, rating: 4.9, reviewCount: 302, stock: 18, isBestSeller: true, isFeatured: true, description: 'Built for concrete and masonry, this hammer drill combines high impact energy with precise speed control, so you can move from pilot holes to anchor bolts without switching tools.', features: [ '13mm hammer chuck, 3 modes: drill / hammer / screw', 'Variable speed trigger with lock-on', 'Depth rod for repeatable hole depth', 'Side-assist handle for control on hard surfaces', ], specifications: { Voltage: '20V', Chuck: '13mm', 'Impact Rate': '38,250 BPM', Weight: '2.1 kg', Warranty: '1 Year', }, images: [img('toolpro-p3-a'), img('toolpro-p3-b'), img('toolpro-p3-c')], }, { id: 'p4', name: 'TOOLPRO Circular Saw', category: 'Saws', categoryId: 'saws', brand: 'TOOLPRO', price: 6499, originalPrice: 7999, rating: 4.8, reviewCount: 176, stock: 14, isBestSeller: false, isFeatured: true, description: 'A precision circular saw with a laser-guided cut line and adjustable bevel, built for clean rips and crosscuts on site or in the workshop.', features: [ '185mm carbide-tipped blade included', 'Laser guide for straight cuts', 'Bevel adjustment 0-45°', 'Dust extraction port', ], specifications: { 'Blade Size': '185mm', Power: '1200W', 'Bevel Range': '0-45°', Weight: '3.4 kg', Warranty: '1 Year', }, images: [img('toolpro-p4-a'), img('toolpro-p4-b'), img('toolpro-p4-c')], }, { id: 'p5', name: 'TOOLPRO Adjustable Wrench Set', category: 'Hand Tools', categoryId: 'hand-tools', brand: 'TOOLPRO', price: 1299, originalPrice: 1799, rating: 4.6, reviewCount: 121, stock: 54, isBestSeller: false, isFeatured: true, description: 'A forged chrome-vanadium wrench set in 3 sizes, with a smooth adjustment mechanism and laser-etched scales for quick sizing.', features: [ '3-piece set: 6", 8", 10"', 'Drop-forged chrome vanadium steel', 'Laser-etched measurement scale', 'Rust-resistant chrome finish', ], specifications: { Material: 'Chrome Vanadium Steel', 'Set Size': '3 pieces', Finish: 'Chrome plated', Warranty: '1 Year', }, images: [img('toolpro-p5-a'), img('toolpro-p5-b'), img('toolpro-p5-c')], }, { id: 'p6', name: 'TOOLPRO Professional Screwdriver Set', category: 'Hand Tools', categoryId: 'hand-tools', brand: 'TOOLPRO', price: 899, originalPrice: 1299, rating: 4.7, reviewCount: 198, stock: 67, isBestSeller: true, isFeatured: true, description: 'A 12-piece magnetic-tip screwdriver set covering the Phillips, flathead and Torx profiles technicians reach for most, in a compact roll-up case.', features: [ '12 pieces: Phillips, flathead, Torx', 'Magnetic tips for one-handed work', 'Cushioned non-slip grips', 'Compact roll-up storage case', ], specifications: { 'Set Size': '12 pieces', 'Tip Types': 'Phillips, Flathead, Torx', Grip: 'Cushioned non-slip', Warranty: '1 Year', }, images: [img('toolpro-p6-a'), img('toolpro-p6-b'), img('toolpro-p6-c')], }, { id: 'p7', name: 'TOOLPRO Measuring Tape', category: 'Measuring Tools', categoryId: 'measuring-tools', brand: 'TOOLPRO', price: 399, originalPrice: 599, rating: 4.6, reviewCount: 342, stock: 120, isBestSeller: false, isFeatured: true, description: 'A 5-metre tape with a nylon-coated blade and magnetic hook, built to resist wear from daily site use.', features: [ '5m length, 25mm wide blade', 'Nylon-coated for abrasion resistance', 'Magnetic hook and belt clip', 'Shock-absorbing rubber casing', ], specifications: { Length: '5 metres', 'Blade Width': '25mm', Hook: 'Magnetic', Warranty: '1 Year', }, images: [img('toolpro-p7-a'), img('toolpro-p7-b'), img('toolpro-p7-c')], }, { id: 'p8', name: 'TOOLPRO Socket Tool Kit', category: 'Hand Tools', categoryId: 'hand-tools', brand: 'TOOLPRO', price: 2999, originalPrice: 3999, rating: 4.8, reviewCount: 143, stock: 29, isBestSeller: true, isFeatured: true, description: 'A 46-piece socket kit with a quick-release ratchet, covering metric sizes for automotive and workshop repairs, in a moulded storage case.', features: [ '46 pieces, metric sizes 4-19mm', 'Quick-release reversible ratchet', 'Chrome vanadium sockets', 'Moulded carry case with labelled slots', ], specifications: { 'Set Size': '46 pieces', 'Drive Size': '1/4" & 3/8"', Material: 'Chrome Vanadium Steel', Warranty: '1 Year', }, images: [img('toolpro-p8-a'), img('toolpro-p8-b'), img('toolpro-p8-c')], }, { id: 'p9', name: 'TOOLPRO Jigsaw Cutting Machine', category: 'Saws', categoryId: 'saws', brand: 'TOOLPRO', price: 3299, originalPrice: 4199, rating: 4.5, reviewCount: 87, stock: 25, isBestSeller: false, isFeatured: false, description: 'A variable-speed jigsaw with tool-free blade changes, suited to curved cuts in wood, plastic and thin metal sheet.', features: [ 'Variable speed 500-3,000 SPM', 'Tool-free blade clamp', 'Adjustable base for bevel cuts', 'Dust blower keeps the cut line visible', ], specifications: { Power: '650W', 'Stroke Rate': '500-3,000 SPM', 'Bevel Range': '0-45°', Warranty: '1 Year', }, images: [img('toolpro-p9-a'), img('toolpro-p9-b'), img('toolpro-p9-c')], }, { id: 'p10', name: 'TOOLPRO Bench Vice 6-inch', category: 'Workshop Equipment', categoryId: 'workshop-equipment', brand: 'TOOLPRO Industrial', price: 2199, originalPrice: 2799, rating: 4.7, reviewCount: 64, stock: 19, isBestSeller: false, isFeatured: false, description: 'A cast-iron bench vice with a 360° swivel base, built to hold work steady through heavy filing, sawing and assembly.', features: [ '6-inch jaw width', '360° swivel base with lock', 'Cast iron body for rigidity', 'Serrated + smooth jaw inserts', ], specifications: { 'Jaw Width': '150mm', Material: 'Cast Iron', Base: '360° swivel', Warranty: '1 Year', }, images: [img('toolpro-p10-a'), img('toolpro-p10-b'), img('toolpro-p10-c')], }, { id: 'p11', name: 'TOOLPRO Digital Spirit Level', category: 'Measuring Tools', categoryId: 'measuring-tools', brand: 'TOOLPRO', price: 1599, originalPrice: 2099, rating: 4.6, reviewCount: 52, stock: 40, isBestSeller: false, isFeatured: false, description: 'A digital-readout level with audible alignment alerts, accurate to 0.1°, for framing, tiling and installation work.', features: [ 'Digital angle readout, accuracy ±0.1°', 'Audible alignment alert', 'IP54 dust and splash resistant', 'Magnetic base for hands-free use', ], specifications: { Length: '600mm', Accuracy: '±0.1°', 'Water Resistance': 'IP54', Warranty: '1 Year', }, images: [img('toolpro-p11-a'), img('toolpro-p11-b'), img('toolpro-p11-c')], }, { id: 'p12', name: 'TOOLPRO Rolling Tool Cabinet', category: 'Workshop Equipment', categoryId: 'workshop-equipment', brand: 'TOOLPRO Industrial', price: 8999, originalPrice: 10999, rating: 4.8, reviewCount: 39, stock: 8, isBestSeller: false, isFeatured: false, description: 'A 5-drawer rolling steel cabinet with ball-bearing slides and a lockable top, for organising a full workshop tool set.', features: [ '5 drawers with ball-bearing slides', 'Lockable top compartment', 'Powder-coated steel construction', 'Heavy-duty locking castors', ], specifications: { Drawers: '5', Material: 'Powder-coated steel', 'Load Capacity': '150kg', Warranty: '1 Year', }, images: [img('toolpro-p12-a'), img('toolpro-p12-b'), img('toolpro-p12-c')], }, { id: 'p13', name: 'TOOLPRO Drill Bit & Accessory Set', category: 'Accessories', categoryId: 'accessories', brand: 'TOOLPRO', price: 749, originalPrice: 999, rating: 4.5, reviewCount: 96, stock: 88, isBestSeller: false, isFeatured: false, description: 'A 100-piece drill and driver bit set covering wood, metal and masonry applications, organised in a labelled case.', features: [ '100 pieces: HSS, masonry & driver bits', 'Labelled compartments for fast selection', 'Compatible with all standard drills', 'Titanium-coated HSS bits', ], specifications: { 'Set Size': '100 pieces', Coating: 'Titanium', Case: 'Labelled hard case', Warranty: '6 Months', }, images: [img('toolpro-p13-a'), img('toolpro-p13-b'), img('toolpro-p13-c')], }, { id: 'p14', name: 'TOOLPRO Safety Gear Combo', category: 'Accessories', categoryId: 'accessories', brand: 'TOOLPRO', price: 1099, originalPrice: 1499, rating: 4.4, reviewCount: 58, stock: 73, isBestSeller: false, isFeatured: false, description: 'Safety glasses, ear protection and cut-resistant gloves bundled for daily workshop and jobsite use.', features: [ 'Anti-fog safety glasses', '26dB noise-reduction ear muffs', 'Cut-resistant gloves, size L', 'Compact storage pouch included', ], specifications: { Includes: 'Glasses, ear muffs, gloves', 'Glove Size': 'L', 'Noise Reduction': '26dB', Warranty: 'N/A', }, images: [img('toolpro-p14-a'), img('toolpro-p14-b'), img('toolpro-p14-c')], }, ]; export const getProductById = (id) => products.find((p) => p.id === id); export const getRelatedProducts = (product, count = 4) => products .filter((p) => p.id !== product.id && p.categoryId === product.categoryId) .slice(0, count) .concat( products.filter((p) => p.id !== product.id && p.categoryId !== product.categoryId) ) .slice(0, count); export const testimonials = [ { name: 'Rajesh K.', role: 'Workshop Owner', rating: 5, quote: 'Excellent build quality and very powerful. The impact drill has become an essential part of my workshop.', avatarSeed: 'toolpro-avatar-1', }, { name: 'Arun P.', role: 'Electrician', rating: 5, quote: 'Good quality tools at a reasonable price. Delivery was also fast.', avatarSeed: 'toolpro-avatar-2', }, { name: 'Meera S.', role: 'Interior Contractor', rating: 5, quote: 'We equipped our entire site team with TOOLPRO gear. The hammer drill and grinder have held up through months of daily use.', avatarSeed: 'toolpro-avatar-3', }, { name: 'Vikram N.', role: 'Automobile Mechanic', rating: 4, quote: 'The socket kit is solid and well organised. Wish the case was slightly more compact, but the sockets themselves are great.', avatarSeed: 'toolpro-avatar-4', }, ];