diff --git a/pom.xml b/pom.xml index 1f5d3c472..857b256e3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ in.javahome myweb war - 8.6.9 + 8.7.5 Java Home myweb http://maven.apache.org @@ -28,12 +28,12 @@ nexusRepo - http://34.208.218.12:8081/repository/sample-snapshots/ + http://3.236.110.68:8081 nexusRepo - http://44.202.251.20:8081/repository/flm-releases/ + http://3.236.110.68:8081 diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 1c2a93f52..d05422a95 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,70 +1,89 @@ - + - - - SRCAS - + + + ShopEasy - Your One-Stop Online Store + + - -
-
-

Welcome to Home Of Beauty

-

Transforming spaces into your dream home

- Get Started -
-
+
+ + +
- -
-

Our Services

-
-
- Residential Design -

Residential Design

-

We create beautiful and functional living spaces tailored to your needs.

-
-
- Commercial Design -

Commercial Design

-

Designing workspaces that inspire productivity and creativity.

-
-
- Consultation -

Consultation

-

Expert advice to help you make the best design decisions.

-
-
-
+
+
+

Smartphones

+
+ +
+
- - +
+

Laptops

+
+ +
+
- -
-

Contact Us

-
- - - - -
-
+
+

Clothing

+
+ +
+
+
- - + + + - + diff --git a/src/main/webapp/script.js b/src/main/webapp/script.js index 1fe2c5516..a5f4bc2d4 100644 --- a/src/main/webapp/script.js +++ b/src/main/webapp/script.js @@ -1,14 +1,351 @@ -// Form Submission Handling -document.getElementById('contact-form').addEventListener('submit', function (e) { - e.preventDefault(); - const name = document.getElementById('name').value; - const email = document.getElementById('email').value; - const message = document.getElementById('message').value; - - if (name && email && message) { - alert('Thank you for contacting us! We will get back to you soon.'); - document.getElementById('contact-form').reset(); - } else { - alert('Please fill out all fields.'); - } +// Product data +const products = { + mobiles: [ + { + id: 'm1', + title: 'iPhone 15 Pro', + price: 104900, + image: 'https://m.media-amazon.com/images/I/81Os1SDWpcL._SL1500_.jpg' + }, + { + id: 'm2', + title: 'Samsung Galaxy S23 Ultra', + price: 154999, + image: 'https://m.media-amazon.com/images/I/61RZ0bN0VjL._SL1500_.jpg' + }, + { + id: 'm3', + title: 'OnePlus 11 5G', + price: 56999, + image: 'https://m.media-amazon.com/images/I/61amb0CfMGL._SL1500_.jpg' + }, + { + id: 'm4', + title: 'Google Pixel 7 Pro', + price: 66999, + image: 'https://m.media-amazon.com/images/I/71Gh9a4zYFL._SL1500_.jpg' + }, + { + id: 'm5', + title: 'Xiaomi 13 Pro', + price: 79999, + image: 'https://m.media-amazon.com/images/I/61g+McQpg7L._SL1500_.jpg' + }, + { + id: 'm6', + title: 'Vivo X90 Pro', + price: 84990, + image: 'https://m.media-amazon.com/images/I/61QdGZIj5GL._SL1500_.jpg' + }, + { + id: 'm7', + title: 'OPPO Reno 8 Pro', + price: 45990, + image: 'https://m.media-amazon.com/images/I/71V+6xJd1IL._SL1500_.jpg' + }, + { + id: 'm8', + title: 'Realme GT Neo 3', + price: 32999, + image: 'https://m.media-amazon.com/images/I/61iYVOSWnFL._SL1500_.jpg' + }, + { + id: 'm9', + title: 'Nothing Phone (2)', + price: 44999, + image: 'https://m.media-amazon.com/images/I/61fy+u9oqYL._SL1500_.jpg' + }, + { + id: 'm10', + title: 'Motorola Edge 40', + price: 29999, + image: 'https://m.media-amazon.com/images/I/61x5mKofQVL._SL1500_.jpg' + } + ], + laptops: [ + { + id: 'l1', + title: 'MacBook Pro M2', + price: 159900, + image: 'https://m.media-amazon.com/images/I/61L5QgPvgxL._SL1500_.jpg' + }, + { + id: 'l2', + title: 'Dell XPS 13', + price: 124990, + image: 'https://m.media-amazon.com/images/I/71w3oJ7a-0L._SL1500_.jpg' + }, + { + id: 'l3', + title: 'HP Spectre x360', + price: 139990, + image: 'https://m.media-amazon.com/images/I/71QkYw3vPJL._SL1500_.jpg' + }, + { + id: 'l4', + title: 'Asus ROG Zephyrus G14', + price: 109990, + image: 'https://m.media-amazon.com/images/I/71PjAvf1ZLL._SL1500_.jpg' + }, + { + id: 'l5', + title: 'Lenovo ThinkPad X1 Carbon', + price: 149990, + image: 'https://m.media-amazon.com/images/I/61nAxyF1wLL._SL1500_.jpg' + }, + { + id: 'l6', + title: 'Acer Predator Helios 300', + price: 99990, + image: 'https://m.media-amazon.com/images/I/71--D0NtSkL._SL1500_.jpg' + }, + { + id: 'l7', + title: 'Microsoft Surface Laptop 5', + price: 119990, + image: 'https://m.media-amazon.com/images/I/61q6WE9YbAL._SL1500_.jpg' + }, + { + id: 'l8', + title: 'MSI Katana GF66', + price: 89990, + image: 'https://m.media-amazon.com/images/I/71qod6xMq2L._SL1500_.jpg' + }, + { + id: 'l9', + title: 'Lenovo IdeaPad Slim 5', + price: 54990, + image: 'https://m.media-amazon.com/images/I/71S8qt+K8hL._SL1500_.jpg' + }, + { + id: 'l10', + title: 'HP Pavilion 15', + price: 62990, + image: 'https://m.media-amazon.com/images/I/71w3oJ7a-0L._SL1500_.jpg' + } + ], + clothes: [ + { + id: 'c1', + title: 'Men\'s Casual Shirt', + price: 899, + image: 'https://m.media-amazon.com/images/I/61+Q9Zt+QjL._UL1500_.jpg' + }, + { + id: 'c2', + title: 'Women\'s Floral Dress', + price: 1299, + image: 'https://m.media-amazon.com/images/I/71Z+0q9ZJjL._UL1500_.jpg' + }, + { + id: 'c3', + title: 'Men\'s Jeans', + price: 1499, + image: 'https://m.media-amazon.com/images/I/81t2j4U-+VL._UL1500_.jpg' + }, + { + id: 'c4', + title: 'Women\'s T-Shirt', + price: 599, + image: 'https://m.media-amazon.com/images/I/61+Q9Zt+QjL._UL1500_.jpg' + }, + { + id: 'c5', + title: 'Men\'s Formal Suit', + price: 3999, + image: 'https://m.media-amazon.com/images/I/71Z+0q9ZJjL._UL1500_.jpg' + }, + { + id: 'c6', + title: 'Women\'s Denim Jacket', + price: 1999, + image: 'https://m.media-amazon.com/images/I/81t2j4U-+VL._UL1500_.jpg' + }, + { + id: 'c7', + title: 'Men\'s Polo T-Shirt', + price: 799, + image: 'https://m.media-amazon.com/images/I/61+Q9Zt+QjL._UL1500_.jpg' + }, + { + id: 'c8', + title: 'Women\'s Jumpsuit', + price: 1599, + image: 'https://m.media-amazon.com/images/I/71Z+0q9ZJjL._UL1500_.jpg' + }, + { + id: 'c9', + title: 'Men\'s Hoodie', + price: 1299, + image: 'https://m.media-amazon.com/images/I/81t2j4U-+VL._UL1500_.jpg' + }, + { + id: 'c10', + title: 'Women\'s Skirt', + price: 899, + image: 'https://m.media-amazon.com/images/I/61+Q9Zt+QjL._UL1500_.jpg' + } + ] +}; + +// Shopping cart +let cart = []; + +// DOM elements +const mobileProductsContainer = document.getElementById('mobile-products'); +const laptopProductsContainer = document.getElementById('laptop-products'); +const clothingProductsContainer = document.getElementById('clothing-products'); +const cartCountElement = document.getElementById('cart-count'); +const cartModal = document.getElementById('cart-modal'); +const cartItemsContainer = document.getElementById('cart-items'); +const totalAmountElement = document.getElementById('total-amount'); +const checkoutBtn = document.getElementById('checkout-btn'); +const closeModal = document.querySelector('.close'); + +// Display products +function displayProducts() { + // Display mobile products + products.mobiles.forEach(product => { + const productElement = createProductElement(product); + mobileProductsContainer.appendChild(productElement); + }); + + // Display laptop products + products.laptops.forEach(product => { + const productElement = createProductElement(product); + laptopProductsContainer.appendChild(productElement); + }); + + // Display clothing products + products.clothes.forEach(product => { + const productElement = createProductElement(product); + clothingProductsContainer.appendChild(productElement); + }); +} + +// Create product element +function createProductElement(product) { + const productCard = document.createElement('div'); + productCard.className = 'product-card'; + productCard.innerHTML = ` + ${product.title} +
+

${product.title}

+

₹${product.price.toLocaleString('en-IN')}

+ +
+ `; + return productCard; +} + +// Add to cart +function addToCart(productId) { + // Find product in any category + let product; + for (const category in products) { + product = products[category].find(p => p.id === productId); + if (product) break; + } + + if (!product) return; + + // Check if product already in cart + const existingItem = cart.find(item => item.id === productId); + if (existingItem) { + existingItem.quantity += 1; + } else { + cart.push({ + ...product, + quantity: 1 + }); + } + + updateCart(); +} + +// Remove from cart +function removeFromCart(productId) { + cart = cart.filter(item => item.id !== productId); + updateCart(); +} + +// Update cart +function updateCart() { + // Update cart count + const totalItems = cart.reduce((total, item) => total + item.quantity, 0); + cartCountElement.textContent = totalItems; + + // Update cart modal + cartItemsContainer.innerHTML = ''; + if (cart.length === 0) { + cartItemsContainer.innerHTML = '

Your cart is empty

'; + document.getElementById('cart-total').style.display = 'none'; + } else { + document.getElementById('cart-total').style.display = 'block'; + let totalAmount = 0; + + cart.forEach(item => { + const itemTotal = item.price * item.quantity; + totalAmount += itemTotal; + + const cartItemElement = document.createElement('div'); + cartItemElement.className = 'cart-item'; + cartItemElement.innerHTML = ` + ${item.title} +
+

${item.title}

+

₹${item.price.toLocaleString('en-IN')} x ${item.quantity} = ₹${itemTotal.toLocaleString('en-IN')}

+
+ + `; + cartItemsContainer.appendChild(cartItemElement); + }); + + totalAmountElement.textContent = totalAmount.toLocaleString('en-IN'); + } +} + +// Event listeners +document.addEventListener('DOMContentLoaded', () => { + displayProducts(); + + // Add to cart button click + document.addEventListener('click', (e) => { + if (e.target.classList.contains('add-to-cart')) { + const productId = e.target.getAttribute('data-id'); + addToCart(productId); + } + + // Remove item from cart + if (e.target.classList.contains('remove-item')) { + const productId = e.target.getAttribute('data-id'); + removeFromCart(productId); + } + + // Cart icon click + if (e.target.closest('a[href="#cart"]') || e.target.closest('#cart a')) { + e.preventDefault(); + cartModal.style.display = 'block'; + } + + // Close modal + if (e.target === closeModal || e.target === cartModal) { + cartModal.style.display = 'none'; + } + + // Checkout button + if (e.target === checkoutBtn) { + alert('Thank you for your purchase!'); + cart = []; + updateCart(); + cartModal.style.display = 'none'; + } + }); +}); + +// Close modal with ESC key +document.addEventListener('keydown', (e) => { + if (e.key === 'Escape' && cartModal.style.display === 'block') { + cartModal.style.display = 'none'; + } }); diff --git a/src/main/webapp/styles.css b/src/main/webapp/styles.css index e3a6fe7ee..c35968233 100644 --- a/src/main/webapp/styles.css +++ b/src/main/webapp/styles.css @@ -1,145 +1,304 @@ -/* General Styles */ +/* Global Styles */ +* { + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; +} + body { - font-family: Arial, sans-serif; - margin: 0; - padding: 0; - box-sizing: border-box; + background-color: #f5f5f5; + color: #333; + line-height: 1.6; } -h1, h2, h3 { - color: #333; +header { + background-color: #2c3e50; + color: white; + padding: 1rem 2rem; + display: flex; + justify-content: space-between; + align-items: center; + position: sticky; + top: 0; + z-index: 100; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); } -a { - text-decoration: none; - color: inherit; +.logo h1 { + font-size: 1.8rem; + color: #ecf0f1; } -.btn { - display: inline-block; - padding: 10px 20px; - background-color: #ff6f61; - color: white; - border-radius: 5px; - transition: background-color 0.3s ease; +nav ul { + display: flex; + list-style: none; } -.btn:hover { - background-color: #ff4a3d; +nav ul li { + margin-left: 1.5rem; } -/* Hero Section */ -.hero { - background-image: url('https://via.placeholder.com/1920x1080'); - background-size: cover; - background-position: center; - height: 100vh; - display: flex; - justify-content: center; - align-items: center; - text-align: center; - color: white; +nav ul li a { + color: white; + text-decoration: none; + font-weight: 500; + transition: color 0.3s; } -.hero-content h1 { - font-size: 3rem; - margin-bottom: 10px; +nav ul li a:hover { + color: #3498db; } -.hero-content p { - font-size: 1.5rem; - margin-bottom: 20px; +.fa-shopping-cart { + margin-right: 5px; } -/* Services Section */ -.services { - padding: 50px 20px; - text-align: center; +main { + padding: 2rem; } -.service-cards { - display: flex; - justify-content: space-around; - flex-wrap: wrap; +.product-section { + margin-bottom: 3rem; } -.card { - width: 30%; - margin: 20px 0; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); - border-radius: 10px; - overflow: hidden; +.product-section h2 { + margin-bottom: 1.5rem; + color: #2c3e50; + border-bottom: 2px solid #3498db; + padding-bottom: 0.5rem; + display: inline-block; } -.card img { - width: 100%; - height: 200px; - object-fit: cover; +.product-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); + gap: 1.5rem; } -.card h3 { - margin: 15px 0; +.product-card { + background-color: white; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); + transition: transform 0.3s, box-shadow 0.3s; } -.card p { - padding: 0 15px 15px; +.product-card:hover { + transform: translateY(-5px); + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); } -/* Gallery Section */ -.gallery { - padding: 50px 20px; - text-align: center; +.product-image { + width: 100%; + height: 200px; + object-fit: contain; + background-color: #f9f9f9; + padding: 10px; } -.gallery-images { - display: flex; - justify-content: space-around; - flex-wrap: wrap; +.product-info { + padding: 1rem; } -.gallery-images img { - width: 45%; - margin: 10px 0; - border-radius: 10px; +.product-title { + font-size: 1rem; + margin-bottom: 0.5rem; + color: #2c3e50; } -/* Contact Section */ -.contact { - padding: 50px 20px; - text-align: center; +.product-price { + font-weight: bold; + color: #e74c3c; + margin-bottom: 0.8rem; + font-size: 1.1rem; } -#contact-form { - display: flex; - flex-direction: column; - align-items: center; +.add-to-cart { + background-color: #3498db; + color: white; + border: none; + padding: 0.5rem 1rem; + border-radius: 4px; + cursor: pointer; + width: 100%; + font-weight: 500; + transition: background-color 0.3s; } -#contact-form input, #contact-form textarea { - width: 80%; - padding: 10px; - margin: 10px 0; - border: 1px solid #ccc; - border-radius: 5px; +.add-to-cart:hover { + background-color: #2980b9; } -#contact-form button { - padding: 10px 20px; - background-color: #ff6f61; - color: white; - border: none; - border-radius: 5px; - cursor: pointer; +footer { + background-color: #2c3e50; + color: white; + padding: 2rem 0 0; } -#contact-form button:hover { - background-color: #ff4a3d; +.footer-content { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + gap: 2rem; + padding: 0 2rem 2rem; } -/* Footer */ -footer { - background-color: #333; - color: white; - text-align: center; - padding: 20px; +.footer-section h3 { + margin-bottom: 1rem; + font-size: 1.2rem; +} + +.footer-section ul { + list-style: none; +} + +.footer-section ul li { + margin-bottom: 0.5rem; +} + +.footer-section ul li a { + color: #ecf0f1; + text-decoration: none; + transition: color 0.3s; +} + +.footer-section ul li a:hover { + color: #3498db; +} + +.footer-bottom { + text-align: center; + padding: 1rem; + background-color: #1a252f; + font-size: 0.9rem; +} + +/* Modal Styles */ +.modal { + display: none; + position: fixed; + z-index: 1000; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); +} + +.modal-content { + background-color: white; + margin: 5% auto; + padding: 2rem; + border-radius: 8px; + width: 80%; + max-width: 600px; + max-height: 80vh; + overflow-y: auto; + box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); +} + +.close { + color: #aaa; + float: right; + font-size: 1.5rem; + font-weight: bold; + cursor: pointer; +} + +.close:hover { + color: #333; +} + +#cart-items { + margin: 1rem 0; +} + +.cart-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.8rem 0; + border-bottom: 1px solid #eee; +} + +.cart-item img { + width: 50px; + height: 50px; + object-fit: contain; + margin-right: 1rem; +} + +.cart-item-info { + flex-grow: 1; +} + +.cart-item-title { + font-weight: 500; +} + +.cart-item-price { + color: #e74c3c; + font-weight: bold; +} + +.remove-item { + color: #e74c3c; + background: none; + border: none; + cursor: pointer; + font-size: 1.2rem; + margin-left: 1rem; +} + +#cart-total { + text-align: right; + margin-top: 1rem; + font-size: 1.2rem; + font-weight: bold; +} + +#checkout-btn { + background-color: #2ecc71; + color: white; + border: none; + padding: 0.8rem 1.5rem; + border-radius: 4px; + cursor: pointer; + font-weight: 500; + margin-top: 1rem; + transition: background-color 0.3s; +} + +#checkout-btn:hover { + background-color: #27ae60; +} + +/* Responsive Styles */ +@media (max-width: 768px) { + header { + flex-direction: column; + padding: 1rem; + } + + nav ul { + margin-top: 1rem; + } + + nav ul li { + margin-left: 1rem; + } + + .product-grid { + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + } +} + +@media (max-width: 480px) { + .product-grid { + grid-template-columns: 1fr; + } + + .modal-content { + width: 95%; + } }