generate a webpage for a ecomerce landing site
- User
generate a webpage for a ecomerce landing site
Assistant
generate a webpage for a ecomerce landing site
I'll create a modern ecommerce landing page for you. Here's a complete HTML page with embedded CSS and JavaScript:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TechStyle - Premium Electronics & Accessories</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
color: #333;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
/* Header */
header {
background: #fff;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
}
.logo {
font-size: 1.8rem;
font-weight: bold;
color: #2c3e50;
}
.nav-links {
display: flex;
list-style: none;
gap: 2rem;
}
.nav-links a {
text-decoration: none;
color: #333;
font-weight: 500;
transition: color 0.3s;
}
.nav-links a:hover {
color: #3498db;
}
.cart-icon {
background: #3498db;
color: white;
padding: 0.5rem 1rem;
border-radius: 25px;
text-decoration: none;
transition: background 0.3s;
}
.cart-icon:hover {
background: #2980b9;
}
/* Hero Section */
.hero {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 120px 0 80px;
text-align: center;
}
.hero h1 {
font-size: 3rem;
margin-bottom: 1rem;
animation: fadeInUp 1s ease;
}
.hero p {
font-size: 1.2rem;
margin-bottom: 2rem;
animation: fadeInUp 1s ease 0.2s both;
}
.cta-button {
display: inline-block;
background: #e74c3c;
color: white;
padding: 15px 30px;
text-decoration: none;
border-radius: 30px;
font-weight: bold;
font-size: 1.1rem;
transition: all 0.3s;
animation: fadeInUp 1s ease 0.4s both;
}
.cta-button:hover {
background: #c0392b;
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
/* Features Section */
.features {
padding: 80px 0;
background: #f8f9fa;
}
.section-title {
text-align: center;
font-size: 2.5rem;
margin-bottom: 3rem;
color: #2c3e50;
}
.features-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.feature-card {
background: white;
padding: 2rem;
border-radius: 10px;
text-align: center;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
transition: transform 0.3s;
}
.feature-card:hover {
transform: translateY(-5px);
}
.feature-icon {
font-size: 3rem;
margin-bottom: 1rem;
}
.feature-card h3 {
font-size: 1.5rem;
margin-bottom: 1rem;
color: #2c3e50;
}
/* Products Section */
.products {
padding: 80px 0;
}
.products-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 2rem;
margin-top: 3rem;
}
.product-card {
background: white;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0,0,0,0.1);
transition: transform 0.3s;
}
.product-card:hover {
transform: translateY(-5px);
}
.product-image {
width: 100%;
height: 250px;
background: #ecf0f1;
display: flex;
align-items: center;
justify-content: center;
font-size: 4rem;
color: #bdc3c7;
}
.product-info {
padding: 1.5rem;
}
.product-title {
font-size: 1.3rem;
margin-bottom: 0.5rem;
color: #2c3e50;
}
.product-price {
font-size: 1.5rem;
font-weight: bold;
color: #e74c3c;
margin-bottom: 1rem;
}
.add-to-cart {
width: 100%;
background: #3498db;
color: white;
border: none;
padding: 12px;
border-radius: 5px;
font-size: 1rem;
cursor: pointer;
transition: background 0.3s;
}
.add-to-cart:hover {
background: #2980b9;
}
/* Newsletter Section */
.newsletter {
background: #2c3e50;
color: white;
padding: 60px 0;
text-align: center;
}
.newsletter h2 {
font-size: 2rem;
margin-bottom: 1rem;
}
.newsletter-form {
display: flex;
justify-content: center;
gap: 1rem;
margin-top: 2rem;
flex-wrap: wrap;
}
.newsletter-input {
padding: 12px 20px;
border: none;
border-radius: 25px;
font-size: 1rem;
min-width: 300px;
}
.newsletter-button {
background: #e74c3c;
color: white;
border: none;
padding: 12px 25px;
border-radius: 25px;
font-size: 1rem;
cursor: pointer;
transition: background 0.3s;
}
.newsletter-button:hover {
background: #c0392b;
}
/* Footer */
footer {
background: #34495e;
color: white;
padding: 40px 0;
text-align: center;
}
/* Animations */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Responsive Design */
@media (max-width: 768px) {
.nav-links {
display: none;
}
.hero h1 {
font-size: 2rem;
}
.newsletter-input {
min-width: 250px;
}
.newsletter-form {
flex-direction: column;
align-items: center;
}
}
</style>
</head>
<body>
<!-- Header -->
<header>
<nav class="container">
<div class="logo">TechStyle</div>
<ul class="nav-links">
<li><a href="#home">Home</a></li>
<li><a href="#products">Products</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
<a href="#" class="cart-icon">🛒 Cart (0)</a>
</nav>
</header>
<!-- Hero Section -->
<section class="hero" id="home">
<div class="container">
<h1>Premium Tech at Unbeatable Prices</h1>
<p>Discover the latest electronics, gadgets, and accessories with free shipping on orders over $50</p>
<a href="#products" class="cta-button">Shop Now</a>
</div>
</section>
<!-- Features Section -->
<section class="features">
<div class="container">
<h2 class="section-title">Why Choose TechStyle?</h2>
<div class="features-grid">
<div class="feature-card">
<div class="feature-icon">🚚</div>
<h3>Free Shipping</h3>
<p>Free delivery on all orders over $50. Fast and reliable shipping worldwide.</p>
</div>
<div class="feature-card">
<div class="feature-icon">🔒</div>
<h3>Secure Payment</h3>
<p>Your payment information is protected with bank-level security encryption.</p>
</div>
<div class="feature-card">
<div class="feature-icon">↩️</div>
<h3>Easy Returns</h3>
<p>30-day hassle-free returns. Not satisfied? Get your money back, no questions asked.</p>
</div>
</div>
</div>
</section>
<!-- Products Section -->
<section class="products" id="products">
<div class="container">
<h2 class="section-title">Featured Products</h2>
<div class="products-grid">
<div class="product-card">
<div class="product-image">📱</div>
<div class="product-info">
<h3 class="product-title">Wireless Earbuds Pro</h3>
<div class="product-price">$129.99</div>
<button class="add-to-cart" onclick="addToCart('Wireless Earbuds Pro', 129.99)">Add to Cart</button>
</div>
</div>
<div class="product-card">
<div class="product-image">⌚</div>
<div class="product-info">
<h3 class="product-title">Smart Watch Series X</h3>
<div class="product-price">$299.99</div>
<button class="add-to-cart" onclick="addToCart('Smart Watch Series X', 299.99)">Add to Cart</button>
</div>
</div>
<div class="product-card">
<div class="product-image">💻</div>
<div class="product-info">
<h3 class="product-title">Laptop Stand Premium</h3>
<div class="product-price">$79.99</div>
<button class="add-to-cart" onclick="addToCart('Laptop Stand Premium', 79.99)">Add to Cart</button>
</div>
</div>
<div class="product-card">
<div class="product-image">🔌</div>
<div class="product-info">
<h3 class="product-title">Wireless Charger Pad</h3>
<div class="product-price">$49.99</div>
<button class="add-to-cart" onclick="addToCart('Wireless Charger Pad', 49.99)">Add to Cart</button>
</div>
</div>
<div class="product-card">
<div class="product-image">🎧</div>
<div class="product-info">
<h3 class="product-title">Gaming Headset Elite</h3>
<div class="product-price">$159.99</div>
<button class="add-to-cart" onclick="addToCart('Gaming Headset Elite', 159.99)">Add to Cart</button>
</div>
</div>
<div class="product-card">
<div class="product-image">📷</div>
<div class="product-info">
<h3 class="product-title">4K Action Camera</h3>
<div class="product-price">$199.99</div>
<button class="add-to-cart" onclick="addToCart('4K Action Camera', 199.99)">Add to Cart</button>
</div>
</div>
</div>
</div>
</section>
<!-- Newsletter Section -->
<section class="newsletter">
<div class="container">
<h2>Stay Updated</h2>
<p>Subscribe to our newsletter for exclusive deals and latest product updates</p>
<form class="newsletter-form" onsubmit="subscribeNewsletter(event)">
<input type="email" class="newsletter-input" placeholder="Enter your email address" required>
<button type="submit" class="newsletter-button">Subscribe</button>
</form>
</div>
</section>
<!-- Footer -->
<footer>
<div class="container">
<p>© 2025 TechStyle. All rights reserved. | Privacy Policy | Terms of Service</p>
</div>
</footer>
<script>
let cart = [];
let cartCount = 0;
function addToCart(productName, price) {
cart.push({ name: productName, price: price });
cartCount++;
updateCartDisplay();
// Show confirmation
alert(`${productName} added to cart!`);
}
function updateCartDisplay() {
const cartIcon = document.querySelector('.cart-icon');
cartIcon.textContent = `🛒 Cart (${cartCount})`;
}
function subscribeNewsletter(event) {
event.preventDefault();
const email = event.target.querySelector('input').value;
alert(`Thank you for subscribing with email: ${email}`);
event.target.reset();
}
// Smooth scrolling for navigation links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Add scroll effect to header
window.addEventListener('scroll', function() {
const header = document.querySelector('header');
if (window.scrollY > 100) {
header.style.background = 'rgba(255, 255, 255, 0