Meta Description" name="description" />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>QuickShop App</title>
<!-- Simple CSS to make it look like a Mobile App -->
<style>
:root { --main: #2563eb; --bg: #f8fafc; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); margin: 0; padding-bottom: 80px; }
.app-header { background: var(--main); color: white; padding: 15px; text-align: center; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
/* Product Grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.card { background: white; border-radius: 12px; padding: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.card img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; }
.card h3 { font-size: 14px; margin: 8px 0; }
.mrp { text-decoration: line-through; color: #94a3b8; font-size: 12px; }
.price { color: #1e293b; font-weight: bold; font-size: 16px; }
.buy-btn { background: #dcfce7; color: #166534; border: none; width: 100%; padding: 8px; border-radius: 6px; font-weight: 600; margin-top: 5px; cursor: pointer; }
/* Checkout Drawer */
#checkout { position: fixed; bottom: -100%; left: 0; width: 100%; background: white; transition: 0.3s; z-index: 20; border-radius: 20px 20px 0 0; padding: 20px; box-sizing: border-box; box-shadow: 0 -5px 20px rgba(0,0,0,0.1); }
#checkout.active { bottom: 0; }
.input-group { margin-bottom: 12px; }
input, textarea { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; }
.loc-btn { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 5px 10px; border-radius: 5px; font-size: 12px; margin-top: 5px; cursor: pointer; }
/* Fixed Footer */
.footer { position: fixed; bottom: 0; width: 100%; background: white; padding: 15px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eee; }
.order-now { background: var(--main); color: white; border: none; padding: 12px 25px; border-radius: 8px; font-weight: bold; }
</style>
</head>
<body>
<div class="app-header">
<strong>My Local Store</strong>
</div>
<div class="grid" id="products">
<!-- Item 1 -->
<div class="card">
<img src="https://images.unsplash.com/photo-1523275335684-37898b6baf30?w=200" alt="Watch">
<h3>Smart Watch</h3>
<span class="mrp">MRP: ₹2,999</span><br>
<span class="price">₹1,499</span>
<button class="buy-btn" onclick="addToCart('Smart Watch', 1499)">+ Add</button>
</div>
<!-- Item 2 -->
<div class="card">
<img src="https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=200" alt="Headphones">
<h3>Headphones</h3>
<span class="mrp">MRP: ₹1,500</span><br>
<span class="price">₹899</span>
<button class="buy-btn" onclick="addToCart('Headphones', 899)">+ Add</button>
</div>
</div>
<div class="footer">
<div>Items: <span id="count">0</span> | <strong>₹<span id="total">0</span></strong></div>
<button class="order-now" onclick="toggleCheckout()">Checkout</button>
</div>
<!-- Checkout Section -->
<div id="checkout">
<div style="display:flex; justify-content: space-between;">
<h2>Delivery Info</h2>
<button onclick="toggleCheckout()" style="border:none; background:none; font-size:20px;">✕</button>
</div>
<div class="input-group">
<input type="text" id="custName" placeholder="Your Name">
</div>
<div class="input-group">
<textarea id="custAddr" rows="3" placeholder="Detailed Address"></textarea>
<button class="loc-btn" onclick="getLocation()">📍 Get Current Location</button>
</div>
<div class="input-group">
<select id="payMethod" style="width:100%; padding:12px; border-radius:8px;">
<option value="Cash">Cash on Delivery</option>
<option value="Online">Online Payment (UPI)</option>
</select>
</div>
<button class="order-now" style="width:100%" onclick="placeOrder()">Confirm Order</button>
</div>
<script>
let cart = [];
let total = 0;
function addToCart(name, price) {
cart.push({name, price});
total += price;
document.getElementById('count').innerText = cart.length;
document.getElementById('total').innerText = total;
}
function toggleCheckout() {
document.getElementById('checkout').classList.toggle('active');
}
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition((pos) => {
document.getElementById('custAddr').value = `Lat: ${pos.coords.latitude}, Lon: ${pos.coords.longitude} (Fetching address...)`;
});
}
}
function placeOrder() {
const name = document.getElementById('custName').value;
const pay = document.getElementById('payMethod').value;
if(!name) return alert("Please enter your name");
alert(`Order Placed Successfully!\nTotal: ₹${total}\nPayment: ${pay}\nWe will deliver to you soon!`);
cart = []; total = 0;
document.getElementById('count').innerText = '0';
document.getElementById('total').innerText = '0';
toggleCheckout();
}
</script>
</body>
</html>
3
2
20KB
20KB
85.0ms
188.0ms
181.0ms