Home.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Online Grocery Store - Home</title>
<link rel="stylesheet" href="styles.css">
<script src="js/script.js" defer></script>
</head>
<body>
<header>
<div class="header-container">
<h1>Online Grocery Store</h1>
<nav>
<a href="home.jsp">Home</a>
<a href="products.jsp">Products</a>
<a href="cart.jsp">Cart</a>
<a href="profile.jsp">Profile</a>
<a href="login.jsp">Login</a>
</nav>
<form class="search-form" action="searchResults.jsp" method="get">
<input type="text" name="query" placeholder="Search for products...">
<button type="submit">Search</button>
</form>
</div>
</header>
<main>
<section class="banner">
<img src="images/banner.jpg" alt="Fresh Groceries Delivered to Your Door">
<div class="banner-text">
<h2>Fresh Groceries Delivered to Your Door</h2>
<p>Order now and get free delivery on your first order!</p>
<a href="products.jsp" class="btn-primary">Shop Now</a>
</div>
</section>
<section class="categories">
<h2>Shop by Category</h2>
<div class="category-cards">
<div class="category-card">
<img src="images/fruits.jpg" alt="Fruits">
<h3>Fruits</h3>
<a href="products.jsp?category=fruits" class="btn-secondary">View Products</a>
</div>
<div class="category-card">
<img src="images/vegetables.jpg" alt="Vegetables">
<h3>Vegetables</h3>
<a href="products.jsp?category=vegetables" class="btn-secondary">View Products</a>
</div>
<div class="category-card">
<img src="images/dairy.jpg" alt="Dairy">
<h3>Dairy</h3>
<a href="products.jsp?category=dairy" class="btn-secondary">View Products</a>
</div>
<div class="category-card">
<img src="images/snacks.jpg" alt="Snacks">
<h3>Snacks</h3>
<a href="products.jsp?category=snacks" class="btn-secondary">View Products</a>
</div>
</div>
</section>
<section class="featured-products">
<h2>Featured Products</h2>
<div class="product-cards">
<c:forEach var="product" items="${featuredProducts}">
<div class="product-card">
<img src="images/${product.image}" alt="${product.name}">
<h3>${product.name}</h3>
<p>$${product.price}</p>
<a href="productDetails.jsp?id=${product.id}" class="btn-primary">View Details</a>
</div>
</c:forEach>
</div>
</section>
</main>
<footer>
<p>© 2024 Online Grocery Store</p>
</footer>
</body>
</html>
Comments
Post a Comment