diff --git a/index.html b/index.html index cd7a80c8..0f48ca3c 100644 --- a/index.html +++ b/index.html @@ -268,10 +268,9 @@

Fun & Friendly Atmosphere

- -
+

Top Reviews

-
+
@@ -391,12 +390,8 @@

Top Reviews

course."
-
-
@@ -552,7 +547,7 @@

Newsletter

- + diff --git a/package.json b/package.json deleted file mode 100644 index f4bf0f4f..00000000 --- a/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "ice-cream-parlour-website", - "version": "1.0.0", - "description": "![Ice Cream Website Screenshot](/images/readme.png)", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} diff --git a/script/reviews.js b/script/reviews.js deleted file mode 100644 index 49acb1bd..00000000 --- a/script/reviews.js +++ /dev/null @@ -1,39 +0,0 @@ -const reviewsPerPage = 2; // Number of reviews per page -const reviewsContainer = document.getElementById('reviewsContainer'); -const paginationContainer = document.getElementById('pagination'); -const reviews = Array.from(document.querySelectorAll('.review-box')); - -function displayReviews(page) { - // Hide all reviews first - reviews.forEach(review => review.style.display = 'none'); - - // Calculate the start and end index of the reviews for the current page - const start = (page - 1) * reviewsPerPage; - const end = start + reviewsPerPage; - - // Show the reviews for the current page - reviews.slice(start, end).forEach(review => review.style.display = 'block'); - - // Update the pagination buttons - updatePaginationButtons(page); -} - -function updatePaginationButtons(currentPage) { - // Calculate the total number of pages - const totalPages = Math.ceil(reviews.length / reviewsPerPage); - - // Clear the pagination container - paginationContainer.innerHTML = ''; - - // Generate pagination buttons - for (let i = 1; i <= totalPages; i++) { - const button = document.createElement('button'); - button.innerText = i; - button.classList.toggle('active', i === currentPage); - button.addEventListener('click', () => displayReviews(i)); - paginationContainer.appendChild(button); - } -} - -// Initial display of the first page -displayReviews(1);