diff --git a/website/cart.css b/website/Cart/cart.css similarity index 98% rename from website/cart.css rename to website/Cart/cart.css index 4343a97..2468b23 100644 --- a/website/cart.css +++ b/website/Cart/cart.css @@ -1,6 +1,6 @@ /* Winkelmandje sectie */ .cart { - width: 20%; + width: 15%; background-color: #fff; /* Change background color to white */ padding: 20px; height: 100vh; diff --git a/website/cart.js b/website/Cart/cart.js similarity index 60% rename from website/cart.js rename to website/Cart/cart.js index f936961..f4384ca 100644 --- a/website/cart.js +++ b/website/Cart/cart.js @@ -1,20 +1,17 @@ - - // Array to hold items added to the shopping cart const cart = []; +let cartCount = 0; // Initialize cart count - - -// Functie om een item aan het winkelwagentje toe te voegen +// Function to add an item to the shopping cart function addToCart(item) { cart.unshift(item); // Add item to the beginning of the cart array updateCart(); + cartCount++; // Increment cart count + updateCartCountDisplay(); // Update the cart count display closeModal(); } - - -// Functie om het winkelwagentje bij te werken +// Function to update the shopping cart display function updateCart() { const cartItemsContainer = document.getElementById("cart-items"); cartItemsContainer.innerHTML = ''; @@ -41,19 +38,32 @@ function updateCart() { } } - -// Functie om een item uit het winkelwagentje te verwijderen +// Function to remove an item from the shopping cart function removeFromCart(index) { cart.splice(index, 1); updateCart(); + cartCount--; // Decrement cart count + updateCartCountDisplay(); // Update the cart count display } -// Initial call to updateCart to ensure the button is hidden on page load -updateCart(); +// Function to update the cart count display +function updateCartCountDisplay() { + const cartCountElement = document.getElementById("cart-count"); // Get the element to display the count + if (cartCountElement) { // Check if the element exists + cartCountElement.textContent = cartCount; // Update the text content with the cart count + } +} -// Functie om het modaal venster te sluiten + +// Initial calls +updateCart(); +updateCartCountDisplay(); // Initialize the cart count on page load + + +// Function to close the modal window function closeModal() { document.getElementById('modal').style.display = 'none'; +<<<<<<< HEAD:website/cart.js } let cartCount = 0; @@ -62,3 +72,6 @@ function addToCart() { cartCount++; document.querySelector('.cart-count').textContent = cartCount; } +======= +} +>>>>>>> 1f418f9c8547c52f6394b681eb5ce02ee196b69a:website/Cart/cart.js diff --git a/website/menu.html b/website/Html categorieën/Broodjes.html similarity index 100% rename from website/menu.html rename to website/Html categorieën/Broodjes.html diff --git a/website/Html categorieën/Deals.html b/website/Html categorieën/Deals.html new file mode 100644 index 0000000..e69de29 diff --git a/website/Html categorieën/Deserts.html b/website/Html categorieën/Deserts.html new file mode 100644 index 0000000..e69de29 diff --git a/website/Html categorieën/Koude dranken.html b/website/Html categorieën/Koude dranken.html new file mode 100644 index 0000000..e69de29 diff --git a/website/Html categorieën/Salades.html b/website/Html categorieën/Salades.html new file mode 100644 index 0000000..e69de29 diff --git a/website/Html categorieën/Snacks.html b/website/Html categorieën/Snacks.html new file mode 100644 index 0000000..e69de29 diff --git a/website/Html categorieën/Soepen.html b/website/Html categorieën/Soepen.html new file mode 100644 index 0000000..e69de29 diff --git a/website/Html categorieën/Warme dranken.html b/website/Html categorieën/Warme dranken.html new file mode 100644 index 0000000..e69de29 diff --git a/website/index.html b/website/index.html index a6d946a..f3b9190 100644 --- a/website/index.html +++ b/website/index.html @@ -5,7 +5,8 @@ Het hoofdmenu van de Mees - + + @@ -23,6 +24,7 @@ + @@ -52,23 +54,19 @@ + +
+ + 0 +
+ - + - - -
- - 0 -
- - - - diff --git a/website/script.js b/website/script.js index 4bbb5d5..6d5b472 100644 --- a/website/script.js +++ b/website/script.js @@ -5,6 +5,7 @@ function showCategory(category) { let items = []; + // Afhankelijk van de gekozen categorie, voeg je de juiste producten toe if (category === 'Broodjes') { items = [ @@ -71,8 +72,12 @@ function showCategory(category) { { title: "Krokante Kip Salade", imageSrc: "media/krokante-kip.jpg", price: 3.00 }, { title: "Aardappel Salade", imageSrc: "media/aardappel.jpg", price: 2.50 }, ]; + } else if (category === 'Sausjes') { + items = [ + { title: "Ketchup", imageSrc: "https://www.ahealthylife.nl/wp-content/uploads/2021/06/Ketchup_voedingswaarde.jpg", price: 0.25 }, + { title: "Mayonaise", imageSrc: "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTC4FVmHO_hK3mw43z0fuHv1OFUr-hhsfGe1A&s", price: 0.25 } + ]; } - // Voeg de items toe aan de weergave items.forEach(item => { const productBox = document.createElement('div'); @@ -126,7 +131,8 @@ function getDescription(title) { return "Soep van de dag! (Allergieën? Meld het bij ons!)"; } else if (title === "Salades") { return "Een heerlijke salade met verse groenten en een dressing naar keuze."; + } else if (title === "Sausjes") { + return "Kies de saus naar je keuze!"; } return ""; } - diff --git a/website/welcome.html b/website/welcome.html index 7c87691..b720b0e 100644 --- a/website/welcome.html +++ b/website/welcome.html @@ -3,7 +3,7 @@ - De Welkompagina van de Mees + De welkompagina van de Mees @@ -12,11 +12,11 @@
-

Assesment 2

-

Van Johnny Kindermann

+

Mees

+

Naar menu

- +