You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Kernel0/cartinvoice.html

191 lines
4.4 KiB

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cart with Invoice</title>
<style>
/* Basic Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
background-color: #f3f3f3;
color: #333;
}
header {
background-color: #4CAF50;
color: white;
padding: 20px;
text-align: center;
}
#product-list {
display: flex;
flex-wrap: wrap;
justify-content: space-around;
margin: 20px;
}
.product {
background-color: white;
padding: 15px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
text-align: center;
width: 250px;
margin-bottom: 20px;
}
.product img {
width: 100%;
height: auto;
border-radius: 8px;
}
.product h4 {
margin-top: 10px;
}
.product p {
font-weight: bold;
color: #4CAF50;
margin: 10px 0;
}
.add-to-cart-btn {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px;
cursor: pointer;
border-radius: 5px;
margin-top: 10px;
}
.add-to-cart-btn:hover {
background-color: #45a049;
}
#cart {
margin: 20px;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
#cart-items {
list-style: none;
padding: 0;
}
#cart-items li {
margin-bottom: 10px;
}
.checkout-btn {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px;
cursor: pointer;
border-radius: 5px;
margin-top: 10px;
}
.checkout-btn:hover {
background-color: #45a049;
}
/* Invoice Popup Styles */
#invoice-popup {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
display: none;
z-index: 1000;
}
#invoice-popup h2 {
text-align: center;
margin-bottom: 15px;
}
#invoice-popup table {
width: 100%;
margin-bottom: 20px;
}
#invoice-popup table th, #invoice-popup table td {
text-align: left;
padding: 8px;
}
#invoice-popup table th {
background-color: #f4f4f4;
}
#invoice-popup .close-btn {
background-color: #ff4d4d;
color: white;
border: none;
padding: 10px;
cursor: pointer;
border-radius: 5px;
display: block;
margin: 0 auto;
}
#invoice-popup .close-btn:hover {
background-color: #e60000;
}
#overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: none;
z-index: 999;
}
</style>
</head>
<body>
<header>
<h1>Shopping Cart with Invoice</h1>
</header>
<section id="product-list">
<div class="product">
<img src="./images/Phones.jpg" alt="Phone">
<h4>Non-fixable Mobile</h4>
<p>Price: $50</p>
<p>Discount: 10%</p>
<button class="add-to-cart-btn" data-name="Non-fixable Mobile" data-price="50" data-discount="10">Add to Cart</button>
</div>
</section>
<section id="cart">
<h2>Your Cart</h2>
<ul id="cart-items"></ul>
<button class="checkout-btn">Checkout</button>
</section>
<!-- Invoice Popup -->
<div id="overlay"></div>
<div id="