Home.jsx 3.95 KB
import React from 'react';
import { Link } from 'react-router-dom';

const Home = () => {
  return (
    <div style={containerStyle}>
      <section style={heroStyle}>
        <h1 style={heroTitleStyle}>Welcome to Our Ecommerce Store</h1>
        <p style={heroSubtitleStyle}>
          Discover amazing products at great prices. Shop with confidence and enjoy fast delivery.
        </p>
        <Link to="/products" style={ctaButtonStyle}>
          Shop Now
        </Link>
      </section>

      <section style={featuresStyle}>
        <h2 style={sectionTitleStyle}>Why Shop With Us?</h2>
        <div style={featuresGridStyle}>
          <div style={featureCardStyle}>
            <h3>๐Ÿšš Fast Shipping</h3>
            <p>Free shipping on orders over $50. Delivery within 2-3 business days.</p>
          </div>
          <div style={featureCardStyle}>
            <h3>๐Ÿ’ณ Secure Payment</h3>
            <p>Your payments are safe with our encrypted checkout process.</p>
          </div>
          <div style={featureCardStyle}>
            <h3>๐Ÿ‘ Quality Products</h3>
            <p>We carefully select all products to ensure the highest quality.</p>
          </div>
          <div style={featureCardStyle}>
            <h3>๐Ÿ“ž 24/7 Support</h3>
            <p>Our customer service team is here to help you anytime.</p>
          </div>
        </div>
      </section>

      <section style={categoriesStyle}>
        <h2 style={sectionTitleStyle}>Popular Categories</h2>
        <div style={categoriesGridStyle}>
          <Link to="/products?category=electronics" style={categoryCardStyle}>
            <h3>Electronics</h3>
            <p>Latest gadgets and devices</p>
          </Link>
          <Link to="/products?category=clothing" style={categoryCardStyle}>
            <h3>Clothing</h3>
            <p>Fashion for everyone</p>
          </Link>
          <Link to="/products?category=home" style={categoryCardStyle}>
            <h3>Home & Garden</h3>
            <p>Everything for your home</p>
          </Link>
          <Link to="/products?category=sports" style={categoryCardStyle}>
            <h3>Sports</h3>
            <p>Equipment and apparel</p>
          </Link>
        </div>
      </section>
    </div>
  );
};

const containerStyle = {
  minHeight: 'calc(100vh - 200px)',
};

const heroStyle = {
  background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
  color: 'white',
  padding: '4rem 1rem',
  textAlign: 'center',
};

const heroTitleStyle = {
  fontSize: '3rem',
  marginBottom: '1rem',
  fontWeight: 'bold',
};

const heroSubtitleStyle = {
  fontSize: '1.2rem',
  marginBottom: '2rem',
  opacity: 0.9,
  maxWidth: '600px',
  margin: '0 auto 2rem',
};

const ctaButtonStyle = {
  display: 'inline-block',
  backgroundColor: 'white',
  color: '#667eea',
  padding: '1rem 2rem',
  borderRadius: '50px',
  textDecoration: 'none',
  fontWeight: 'bold',
  fontSize: '1.1rem',
  transition: 'transform 0.3s',
};

const featuresStyle = {
  padding: '4rem 1rem',
  backgroundColor: '#f8f9fa',
};

const sectionTitleStyle = {
  textAlign: 'center',
  fontSize: '2.5rem',
  marginBottom: '3rem',
  color: '#333',
};

const featuresGridStyle = {
  display: 'grid',
  gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))',
  gap: '2rem',
  maxWidth: '1200px',
  margin: '0 auto',
};

const featureCardStyle = {
  backgroundColor: 'white',
  padding: '2rem',
  borderRadius: '10px',
  textAlign: 'center',
  boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
  transition: 'transform 0.3s',
};

const categoriesStyle = {
  padding: '4rem 1rem',
};

const categoriesGridStyle = {
  display: 'grid',
  gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
  gap: '1.5rem',
  maxWidth: '1200px',
  margin: '0 auto',
};

const categoryCardStyle = {
  backgroundColor: 'white',
  padding: '2rem',
  borderRadius: '10px',
  textAlign: 'center',
  textDecoration: 'none',
  color: '#333',
  boxShadow: '0 4px 6px rgba(0, 0, 0, 0.1)',
  transition: 'transform 0.3s, box-shadow 0.3s',
};

export default Home;