Orga Coffee Shop Website with WhatsApp Ordering
Here's a simple dynamic website for Orga Coffee with WhatsApp integration:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Orga Coffee</title>
<style>
:root {
--primary: #6F4E37;
--secondary: #B87333;
--light: #F5F5DC;
--dark: #2C1E10;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 0;
background-color: var(--light);
color: var(--dark);
}
header {
background-color: var(--primary);
color: white;
padding: 1rem;
text-align: center;
}
nav {
display: flex;
justify-content: center;
background-color: var(--secondary);
padding: 0.5rem;
}
nav a {
color: white;
text-decoration: none;
margin: 0 1rem;
padding: 0.5rem;
border-radius: 4px;
transition: background-color 0.3s;
}
nav a:hover {
background-color: var(--primary);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
.menu-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 2rem;
margin-top: 2rem;
}
.menu-item {
background-color: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
transition: transform 0.3s;
}
.menu-item:hover {
transform: translateY(-5px);
}
.menu-item img {
width: 100%;
height: 200px;
object-fit: cover;
}
.menu-item-info {
padding: 1rem;
}
.price {
font-weight: bold;
color: var(--secondary);
}
.order-btn {
display: block;
width: 100%;
padding: 0.8rem;
background-color: var(--primary);
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 1rem;
margin-top: 1rem;
}
.order-btn:hover {
background-color: var(--secondary);
}
footer {
background-color: var(--dark);
color: white;
text-align: center;
padding: 1rem;
margin-top: 2rem;
}
#cart {
position: fixed;
bottom: 2rem;
right: 2rem;
background-color: var(--primary);
color: white;
padding: 1rem;
border-radius: 50%;
width: 60px;
height: 60px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
#cart-count {
position: absolute;
top: 0;
right: 0;
background-color: var(--secondary);
color: white;
border-radius: 50%;
width: 20px;
height: 20px;
font-size: 0.8rem;
display: flex;
justify-content: center;
align-items: center;
}
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.7);
z-index: 1000;
}
.modal-content {
background-color: white;
margin: 10% auto;
padding: 2rem;
width: 80%;
max-width: 600px;
border-radius: 8px;
}
.close {
float: right;
font-size: 1.5rem;
cursor: pointer;
}
table {
width: 100%;
border-collapse: collapse;
margin: 1rem 0;
}
table th, table td {
padding: 0.5rem;
text-align: left;
border-bottom: 1px solid #ddd;
}
@media (max-width: 768px) {
.menu-grid {
grid-template-columns: 1fr;
}
nav {
flex-direction: column;
align-items: center;
}
nav a {
margin: 0.3rem 0;
}
}
</style>
</head>
<body>
<header>
<h1>Orga Coffee</h1>
<p>Organic. Sustainable. Delicious.</p>
</header>
<nav>
<a href="#" class="active">Home</a>
<a href="#menu">Menu</a>
<a href="#about">About Us</a>
<a href="#contact">Contact</a>
</nav>
<div class="container">
<section id="hero">
<h2>Welcome to Orga Coffee</h2>
<p>Experience the finest organic coffee beans, sustainably sourced and expertly brewed.</p>
</section>
<section id="menu">
<h2>Our Menu</h2>
<div class="menu-grid" id="menu-items">
<!-- Menu items will be loaded dynamically -->
</div>
</section>
</div>
<div id="cart">
<span id="cart-count">0</span>
<i>🛒</i>
</div>
<div id="cartModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Your Order</h2>
<table id="cart-items">
<thead>
<tr>
<th>Item</th>
<th>Quantity</th>
<th>Price</th>
<th>Total</th>
</tr>
</thead>
<tbody>
</tbody>
<tfoot>
<tr>
<td colspan="3"><strong>Total</strong></td>
<td id="cart-total">$0.00</td>
</tr>
</tfoot>
</table>
<button id="whatsapp-order" class="order-btn">Order via WhatsApp</button>
</div>
</div>
<footer>
<p>© 2025 Orga Coffee. All rights reserved.</p>
</footer>
<script>
// Sample menu data - in a real application, this would come from a database
const menuItems = [
{
id: 1,
name: "Organic Espresso",
description: "Our signature espresso made from organic arabica beans.",
price: 3.50,
image: "https://images.unsplash.com/photo-1514432324607-a09d9b4aefdd?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
},
{
id: 2,
name: "Cappuccino",
description: "Espresso with steamed milk and a layer of foamed milk.",
price: 4.50,
image: "https://images.unsplash.com/photo-1534778101976-62847782c213?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
},
{
id: 3,
name: "Cold Brew",
description: "Coffee brewed with cold water for 12+ hours. Smooth and refreshing.",
price: 4.00,
image: "https://images.unsplash.com/photo-1517701550927-30cf4ba1dba5?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
},
{
id: 4,
name: "Organic Matcha Latte",
description: "Premium organic matcha with steamed milk.",
price: 5.00,
image: "https://images.unsplash.com/photo-1536256263959-770b48d82b0a?ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60"
}
];
// Cart functionality
let cart = [];
// Display menu items
function displayMenuItems() {
const menuContainer = document.getElementById('menu-items');
menuContainer.innerHTML = '';
menuItems.forEach(item => {
const menuItemElement = document.createElement('div');
menuItemElement.className = 'menu-item';
menuItemElement.innerHTML = `
<img src="${item.image}" alt="${item.name}">
<div class="menu-item-info">
<h3>${item.name}</h3>
<p>${item.description}</p>
<p class="price">$${item.price.toFixed(2)}</p>
<button class="order-btn" onclick="addToCart(${item.id})">Add to Order</button>
</div>
`;
menuContainer.appendChild(menuItemElement);
});
}
// Add item to cart
function addToCart(itemId) {
const item = menuItems.find(item => item.id === itemId);
const existingItem = cart.find(cartItem => cartItem.id === itemId);
if (existingItem) {
existingItem.quantity += 1;
} else {
cart.push({
id: item.id,
name: item.name,
price: item.price,
quantity: 1
});
}
updateCartCount();
}
// Update cart count
function updateCartCount() {
const cartCount = document.getElementById('cart-count');
const count = cart.reduce((total, item) => total + item.quantity, 0);
cartCount.textContent = count;
}
// Update cart modal
function updateCartModal() {
const cartItems = document.querySelector('#cart-items tbody');
cartItems.innerHTML = '';
let total = 0;
cart.forEach(item => {
const itemTotal = item.price * item.quantity;
total += itemTotal;
const row = document.createElement('tr');
row.innerHTML = `
<td>${item.name}</td>
<td>${item.quantity}</td>
<td>$${item.price.toFixed(2)}</td>
<td>$${itemTotal.toFixed(2)}</td>
`;
cartItems.appendChild(row);
});
document.getElementById('cart-total').textContent = `$${total.toFixed(2)}`;
}
// Send order to WhatsApp
function sendWhatsAppOrder() {
// Replace with your actual WhatsApp business number
const phoneNumber = "1234567890";
let message = "Hello, I'd like to place an order:\n\n";
cart.forEach(item => {
message += `${item.quantity}x ${item.name} - $${(item.price * item.quantity).toFixed(2)}\n`;
});
const total = cart.reduce((sum, item) => sum + (item.price * item.quantity), 0);
message += `\nTotal: $${total.toFixed(2)}`;
const encodedMessage = encodeURIComponent(message);
window.open(`https://wa.me/${phoneNumber}?text=${encodedMessage}`, '_blank');
}
// Modal functionality
const modal = document.getElementById('cartModal');
const cartButton = document.getElementById('cart');
const closeButton = document.querySelector('.close');
const whatsappOrderButton = document.getElementById('whatsapp-order');
cartButton.onclick = function() {
updateCartModal();
modal.style.display = "block";
}
closeButton.onclick = function() {
modal.style.display = "none";
}
window.onclick = function(event) {
if (event.target == modal) {
modal.style.display = "none";
}
}
whatsappOrderButton.onclick = sendWhatsAppOrder;
// Initialize the page
displayMenuItems();
</script>
</body>
</html>
Free Ways to Publish Your Website
-
GitHub Pages - Perfect for static websites or websites with client-side JavaScript:
- Create a GitHub account
- Upload your website files to a repository
- Enable GitHub Pages in the repository settings
-
Netlify - Excellent for static sites with form handling:
- Sign up for a free account
- Connect to your GitHub repository or drag and drop your site files
- Includes free SSL and custom domain support
-
Vercel - Great for dynamic websites and React/Next.js applications:
- Create a free account
- Connect to your repository
- Automatic deployments when you push changes
-
Render - Offers free static site hosting with SSL:
- Create an account
- Connect to your repository
- Free for static sites with reasonable bandwidth limits
-
Firebase Hosting - Google's platform for web apps:
- Create a Firebase account
- Install Firebase CLI tools
- Deploy with a simple command
-
Cloudflare Pages - Fast static site hosting:
- Sign up for Cloudflare
- Connect your Git repository
- Includes free builds and hosting
For your WhatsApp integration to work effectively, make sure to:
- Replace the placeholder phone number with your actual business WhatsApp number
- Consider setting up a WhatsApp Business account for better customer management
- Test the ordering system thoroughly before launching
Would you like me to explain or break down any part of this code?