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 @@