269 lines
12 KiB
PHP
269 lines
12 KiB
PHP
<?php session_start(); ?><!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>The Cozy Corner Cafe</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--primary-color: #6b7b62;
|
|
--secondary-color: #8e9b83;
|
|
--background-color: #8e9b83;
|
|
--surface-color: #a2b199;
|
|
--text-color: #424c3b;
|
|
--heading-font: 'Inter', sans-serif;
|
|
--body-font: 'Inter', sans-serif;
|
|
}
|
|
|
|
body {
|
|
font-family: var(--body-font);
|
|
color: var(--text-color);
|
|
background-color: var(--background-color);
|
|
}
|
|
|
|
h1, h2, h3, h4, h5, h6 {
|
|
font-family: var(--heading-font);
|
|
}
|
|
|
|
.navbar {
|
|
background-color: var(--background-color);
|
|
font-weight: bold;
|
|
}
|
|
|
|
.hero {
|
|
background: linear-gradient(rgba(66, 76, 59, 0.7), rgba(66, 76, 59, 0.7)), url('https://m.media-amazon.com/images/I/41LmVVgTulL.jpg') no-repeat center center;
|
|
background-size: cover;
|
|
padding: 6rem 0;
|
|
color: #f2eae2;
|
|
}
|
|
|
|
.hero h1, .hero .lead {
|
|
text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
|
|
}
|
|
|
|
.btn-primary {
|
|
background-color: var(--primary-color);
|
|
border-color: var(--primary-color);
|
|
border-radius: 0.5rem;
|
|
padding: 0.75rem 1.5rem;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background-color: #5a6a54;
|
|
border-color: #5a6a54;
|
|
}
|
|
|
|
#menu .card {
|
|
border: none;
|
|
border-radius: 0.5rem;
|
|
background-color: var(--surface-color);
|
|
}
|
|
|
|
#menu .card .card-img-top {
|
|
height: 250px;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.form-control, .quantity-input {
|
|
background-color: #d4d4ce;
|
|
border-color: var(--primary-color);
|
|
}
|
|
|
|
#contact input.form-control, #contact textarea.form-control {
|
|
background-color: #d4d4ce;
|
|
border-color: var(--primary-color);
|
|
}
|
|
|
|
footer {
|
|
background-color: var(--text-color);
|
|
color: var(--secondary-color);
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<nav class="navbar navbar-expand-lg navbar-light fixed-top shadow-sm">
|
|
<div class="container">
|
|
<a class="navbar-brand" href="#">The Cozy Corner</a>
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarNav">
|
|
<ul class="navbar-nav ms-auto">
|
|
<li class="nav-item"><a class="nav-link" href="#home">Home</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="#menu">Menu</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="#about">About</a></li>
|
|
<li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="cart.php">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-cart" viewBox="0 0 16 16">
|
|
<path d="M0 1.5A.5.5 0 0 1 .5 1H2a.5.5 0 0 1 .485.379L2.89 3H14.5a.5.5 0 0 1 .491.592l-1.5 8A.5.5 0 0 1 13 12H4a.5.5 0 0 1-.491-.408L2.01 3.607 1.61 2H.5a.5.5 0 0 1-.5-.5zM3.102 4l1.313 7h8.17l1.313-7H3.102zM5 12a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm7 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm-7 1a1 1 0 1 1 0 2 1 1 0 0 1 0-2zm7 0a1 1 0 1 1 0 2 1 1 0 0 1 0-2z"/>
|
|
</svg>
|
|
<span class="badge bg-primary rounded-pill" id="cart-count">0</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main>
|
|
<section id="home" class="hero text-center">
|
|
<div class="container">
|
|
<h1 class="display-3">Welcome to The Cozy Corner Cafe</h1>
|
|
<p class="lead">Where every cup is a warm hug.</p>
|
|
<a href="#menu" class="btn btn-primary btn-lg">View Our Menu</a>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="menu" class="py-5">
|
|
<div class="container">
|
|
<h2 class="text-center mb-5">Our Menu</h2>
|
|
<div class="row">
|
|
<!-- Menu Item 1 -->
|
|
<div class="col-lg-4 col-md-6 mb-4">
|
|
<div class="card h-100">
|
|
<img src="https://www.beserk.com.au/cdn/shop/files/gothic-gifts-striped-bat-wing-teacup-5.jpg?v=1721173226&width=600" class="card-img-top" alt="Classic Espresso">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Classic Espresso</h5>
|
|
<p class="card-text">A rich and aromatic shot of pure coffee bliss.</p>
|
|
<p class="card-text fw-bold">$3.00</p>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<input type="number" class="form-control" value="1" min="1" style="width: 60px;" id="quantity-espresso">
|
|
<button class="btn btn-primary" onclick="addToCart('Classic Espresso', 3.00, 'quantity-espresso')">Buy</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Menu Item 2 -->
|
|
<div class="col-lg-4 col-md-6 mb-4">
|
|
<div class="card h-100">
|
|
<img src="https://www.loveramics.co.uk/cdn/shop/products/C088-22BBK_0d522fb4-f764-4804-aa03-289a2aa451e2_1200x800.jpg?v=1645085617" class="card-img-top" alt="Creamy Latte">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Creamy Latte</h5>
|
|
<p class="card-text">Espresso with steamed milk, topped with a light layer of foam.</p>
|
|
<p class="card-text fw-bold">$4.50</p>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<input type="number" class="form-control" value="1" min="1" style="width: 60px;" id="quantity-latte">
|
|
<button class="btn btn-primary" onclick="addToCart('Creamy Latte', 4.50, 'quantity-latte')">Buy</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Menu Item 3 -->
|
|
<div class="col-lg-4 col-md-6 mb-4">
|
|
<div class="card h-100">
|
|
<img src="https://i.ytimg.com/vi/Ldgm3YD-tMQ/maxresdefault.jpg" class="card-img-top" alt="Chocolate Croissant">
|
|
<div class="card-body">
|
|
<h5 class="card-title">Chocolate Croissant</h5>
|
|
<p class="card-text">Flaky, buttery pastry with a rich dark chocolate filling.</p>
|
|
<p class="card-text fw-bold">$3.50</p>
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<input type="number" class="form-control" value="1" min="1" style="width: 60px;" id="quantity-croissant">
|
|
<button class="btn btn-primary" onclick="addToCart('Chocolate Croissant', 3.50, 'quantity-croissant')">Buy</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="about" class="py-5" style="background-color: var(--surface-color);">
|
|
<div class="container">
|
|
<h2 class="text-center mb-4">About Us</h2>
|
|
<p class="lead text-center mx-auto" style="max-width: 800px;">Founded in 2023, The Cozy Corner Cafe is a place for friends to gather, for students to study, and for everyone to enjoy a moment of peace with a delicious cup of coffee. We believe in quality, community, and the simple joy of a great brew.</p>
|
|
</div>
|
|
</section>
|
|
|
|
<section id="contact" class="py-5">
|
|
<div class="container">
|
|
<h2 class="text-center mb-4">Contact Us</h2>
|
|
<?php if (isset($_SESSION['message'])): ?>
|
|
<div class="alert alert-<?php echo $_SESSION['status'] == 'success' ? 'success' : 'danger'; ?> alert-dismissible fade show" role="alert">
|
|
<?php echo $_SESSION['message']; ?>
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
|
</div>
|
|
<?php
|
|
unset($_SESSION['message']);
|
|
unset($_SESSION['status']);
|
|
?>
|
|
<?php endif; ?>
|
|
<form action="contact_handler.php" method="POST" class="mx-auto" style="max-width: 600px;">
|
|
<div class="mb-3">
|
|
<label for="name" class="form-label">Name</label>
|
|
<input type="text" class="form-control" id="name" name="name" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="email" class="form-label">Email</label>
|
|
<input type="email" class="form-control" id="email" name="email" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="message" class="form-label">Message</label>
|
|
<textarea class="form-control" id="message" name="message" rows="4" required></textarea>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Send Message</button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
<footer class="py-4 text-center">
|
|
<div class="container">
|
|
<p>© 2025 The Cozy Corner Cafe. All Rights Reserved.</p>
|
|
</div>
|
|
</footer>
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
<script>
|
|
// Smooth scrolling for anchor links
|
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
|
anchor.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
document.querySelector(this.getAttribute('href')).scrollIntoView({
|
|
behavior: 'smooth'
|
|
});
|
|
});
|
|
});
|
|
|
|
function addToCart(name, price, quantityId) {
|
|
const quantityInput = document.getElementById(quantityId);
|
|
const quantity = parseInt(quantityInput.value, 10);
|
|
|
|
if (quantity < 1) {
|
|
alert("Quantity must be at least 1.");
|
|
return;
|
|
}
|
|
|
|
let cart = JSON.parse(localStorage.getItem('cart')) || {};
|
|
if (cart[name]) {
|
|
cart[name].quantity += quantity;
|
|
} else {
|
|
cart[name] = {
|
|
price: price,
|
|
quantity: quantity
|
|
};
|
|
}
|
|
localStorage.setItem('cart', JSON.stringify(cart));
|
|
updateCartCount();
|
|
}
|
|
|
|
function updateCartCount() {
|
|
let cart = JSON.parse(localStorage.getItem('cart')) || {};
|
|
let count = Object.values(cart).reduce((sum, item) => sum + item.quantity, 0);
|
|
document.getElementById('cart-count').innerText = count;
|
|
}
|
|
|
|
// Update cart count on page load
|
|
document.addEventListener('DOMContentLoaded', updateCartCount);
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|