Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added lannguyen/images/Banh khot.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/Banh xeo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/Beef & rice.avif
Binary file not shown.
Binary file added lannguyen/images/Beef salad.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/Canh chua.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/Che ba mau.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/Claims especial.avif
Binary file not shown.
Binary file added lannguyen/images/Crep.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/Egg rolls.avif
Binary file not shown.
Binary file added lannguyen/images/Fruit bow.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/Fruit cocktail.avif
Binary file not shown.
Binary file added lannguyen/images/Grilled Rice.avif
Binary file not shown.
Binary file added lannguyen/images/Hen wings.avif
Binary file not shown.
Binary file added lannguyen/images/Sunrise Bistro restaurant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/banh mi.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/cafe.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/khoai lang.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/pho bo.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/pho ga.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/salad bow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/samon.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/sinh to.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lannguyen/images/sping rolls.avif
Binary file not shown.
Binary file added lannguyen/images/vermicelli noodle salad.avif
Binary file not shown.
41 changes: 41 additions & 0 deletions lannguyen/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Interactive Restaurant Menu</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header class="hero">
<section class="hero">
<h1>Homemade Vietnamese Restaurant</h1>
<p><strong>Fresh • Authentic • Made with love</strong></p>
</section>

</header>

<section class="menu-controls">
<button class="menu-btn" data-category="breakfast">Breakfast</button>
<button class="menu-btn" data-category="lunch">Lunch</button>
<button class="menu-btn" data-category="brunch">Brunch</button>
<button class="menu-btn" data-category="dinner">Dinner</button>
<button class="menu-btn" data-category="happyHour">Happy Hour</button>
<button class="menu-btn" data-category="drinks">Drinks</button>
</section>



<main class="menu-section" >
<h2 id="menu-title">Menu</h2>
<div id="menu-display">
<p>Select a category to view menu items.</p>
</div>



</main>

<script src="script.js"></script>
</body>
</html>
255 changes: 255 additions & 0 deletions lannguyen/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,255 @@


const buttons = document.querySelectorAll(".menu-btn");
const menuTitle = document.querySelector("#menu-title");
const menuDisplay = document.querySelector("#menu-display");

const menuData = {
breakfast: [
{
name: "Beef noodle soup",
description: "Beef noodle soup with fresh herbs",
price: "$18",
image: "./images/pho bo.webp"

},
{
name: "Chicken noodle soup",
description: "Chicken noodle soup with fresh herbs",
price: "$15",
image: "./images/pho ga.webp"
},
{
name: "Fruit Bowl",
description: "Fresh seasonal fruit served chilled",
price: "$8",
image: "./images/Fruit bow.jpeg"

}
],


lunch: [
{
name: "Pork banh mi",
description: "Crispy baguette with pork & veggies",
price: "$12",
image: "./images/banh mi.webp"
},
{
name: "Egg rolls",
description: "Crispy rolls with dipping sauce",
price: "$11",
image: "./images/Egg rolls.avif"
},
{
name: "Hot & Sour Soup",
description: "Spicy soup with herbs",
price: "$17",
image: "./images/Canh chua.jpeg"
}
],



brunch: [
{
name: "Crispy rice paper wrap",
description: "Crispy rice paper wrapped around seasoned meat and vegetables",
price: "$14",
image: "./images/Banh xeo.jpg"
},
{
name: "Avocado crepse",
description: "Toasted bread topped with avocado and eggs",
price: "$10",
image: "./images/Crep.jpeg"
},
{
name: "Brunch Special",
description: "Sparkling brunch favorite",
price: "$9",
image: "./images/Banh khot.jpeg"
}
],
dinner: [
{
name: "Grilled Salmon",
description: "Salmon served with rice and vegetables",
price: "$28",
image: "./images/samon.jpg"
},

{
name: "Steak with vegetables",
description: "Sliced steak over mixed vegetables",
price: "$19",
image: "./images/Beef salad.jpeg"

},
{
name: "Veggie Bowl",
description: "Roasted vegetables over tufou with a savory sauce",
price: "$15",
image: "./images/vermicelli noodle salad.avif"

}
],
happyHour: [
{
name: "Spring rolls",
description: "Crispy rolls filled with vegetables and served with dipping sauce",
price: "$6",
image: "./images/sping rolls.avif"
},
{
name: "Sweet Potato Fries",
description: "Fries topped with sinemon and coconutflakes",
price: "$7",
image: "./images/khoai lang.jpg"
},
{
name: " Salad bowl",
description: "Mixed salad with marinara sauce",
price: "$6",
image: "./images/salad bow.jpg"
}
],
drinks: [
{
name: "Three color dessert",
description: "Three color dessert with beans, jelly, and coconut milk",
price: "$8",
image: "./images/Che ba mau.jpeg"
},
{
name: "Iced Coffee",
description: "Cold brew coffee over ice",
price: "$7",
image: "./images/cafe.webp"
},
{
name: "Berry Smoothie",
description: "Mixed berries blended with yogurt",
price: "$16",
image: "./images/sinh to.jpg"

}
]
};
function displayMenu(category) {
menuDisplay.innerHTML = "";

const categoryTitles = {
breakfast: "Breakfast Menu",
lunch: "Lunch Menu",
brunch: "Brunch Menu",
dinner: "Dinner Menu",
happyHour: "Happy Hour Menu",
drinks: "Drinks Menu"
};

menuTitle.textContent = categoryTitles[category];

menuData[category].forEach(item => {
const menuItem = document.createElement("div");
menuItem.classList.add("menu-item");

menuItem.innerHTML = `
<h3>${item.name}</h3>
<p>${item.description}</p>
<p class="price">${item.price}</p>
`;

menuDisplay.appendChild(menuItem);
});
}

displayMenu("breakfast");
buttons[0].classList.add("active");

buttons.forEach(button => {
button.addEventListener("click", function () {
buttons.forEach(btn => btn.classList.remove("active"));
button.classList.add("active");

const selectedCategory = button.dataset.category;
displayMenu(selectedCategory);
});
});



menuItem.innerHTML = `
<button onclick="addToCart('${item.name}')">Add</button>
<img src="${item.image}" alt="${item.name}" class="food-img">
<h3>${item.name}</h3>
<p>${item.description}</p>
<p class="price">${item.price}</p>
menuItem.innerHTML += `

`;
`;
console.log(buttons);
console.log(menuTitle);
console.log(menuDisplay);

let cart = [];

function addToCart(name) {
cart.push(name);
alert(name + " added to cart");
}

function displayMenu(category) {
menuDisplay.innerHTML = "";

const categoryTitles = {
breakfast: "Breakfast Menu",
lunch: "Lunch Menu",
brunch: "Brunch Menu",
dinner: "Dinner Menu",
happyHour: "Happy Hour Menu",
drinks: "Drinks Menu"
};

menuTitle.textContent = categoryTitles[category];

menuData[category].forEach(item => {
const menuItem = document.createElement("div");
menuItem.classList.add("menu-item");

menuItem.innerHTML = `
<img src="${item.image}" class="food-img">
<h3>${item.name}</h3>
<p>${item.description}</p>
<p class="price">${item.price}</p>
`;

menuDisplay.appendChild(menuItem);
});
}



displayMenu("breakfast");

buttons.forEach(button => {
button.addEventListener("click", function () {
const selectedCategory = button.dataset.category;
displayMenu(selectedCategory);
});
});

buttons.forEach(button => {
button.addEventListener("click", function () {
buttons.forEach(btn => btn.classList.remove("active"));
button.classList.add("active");

const selectedCategory = button.dataset.category;
displayMenu(selectedCategory);
});
});

buttons[0].classList.add("active");

Loading