From 50f754c6ec80dd7481ec257951ca720f38ab68a0 Mon Sep 17 00:00:00 2001 From: Evie Frye Date: Mon, 14 Oct 2024 01:21:21 +0530 Subject: [PATCH 1/2] Worked on review.html --- index.html | 2 +- review.html | 466 ++++++++++++++++++++++++++++++++++++++++++++++++++++ style.css | 4 +- 3 files changed, 470 insertions(+), 2 deletions(-) create mode 100644 review.html diff --git a/index.html b/index.html index ce088e8..7f6634e 100644 --- a/index.html +++ b/index.html @@ -259,7 +259,7 @@

ArcticDelights

Home About Menu -Review +Review Blogs Contact Us My Orders diff --git a/review.html b/review.html new file mode 100644 index 0000000..a233e3b --- /dev/null +++ b/review.html @@ -0,0 +1,466 @@ + + + + + + + + + Arctic Delights + + + + + + + + + + + + + + + + +
+ + +
+
+

🍦 Arctic Reviews 🍦

+
+

Submit Your Review

+
+
+ + +
+ +
+ + +
+ + +
+ + +
+ +
+ + +
+ + +
+
+
+ + + + + + + \ No newline at end of file diff --git a/style.css b/style.css index 13e0a1f..7580a0b 100644 --- a/style.css +++ b/style.css @@ -2142,4 +2142,6 @@ form h3{ } #backToTop:hover { background-color: #0056b3; /* Darken on hover */ -} \ No newline at end of file +} + +/* Review Page styles */ \ No newline at end of file From 1ceca55a6b0f5fd8183677e4cfb3174a0424cb1a Mon Sep 17 00:00:00 2001 From: Evie Frye Date: Mon, 14 Oct 2024 01:28:24 +0530 Subject: [PATCH 2/2] Store the reviews in localstorage --- review.html | 318 +++++++++++++++++++++++++++++----------------------- 1 file changed, 178 insertions(+), 140 deletions(-) diff --git a/review.html b/review.html index a233e3b..e37b4dc 100644 --- a/review.html +++ b/review.html @@ -20,12 +20,13 @@ @@ -400,6 +424,11 @@

David

customerReviews.classList.add('show'); }); + document.addEventListener('DOMContentLoaded', function () { + const storedReviews = JSON.parse(localStorage.getItem('reviews')) || []; + storedReviews.forEach(review => addReviewToPage(review)); + }); + document.getElementById('reviewForm').addEventListener('submit', function (event) { event.preventDefault(); // Prevent form submission @@ -419,10 +448,19 @@

David

// Add the review to the list addReviewToPage(review); + // Save the review to local storage + saveReviewToLocalStorage(review); + // Clear form after submission document.getElementById('reviewForm').reset(); }); + function saveReviewToLocalStorage(review) { + let reviews = JSON.parse(localStorage.getItem('reviews')) || []; + reviews.push(review); + localStorage.setItem('reviews', JSON.stringify(reviews)); + } + function addReviewToPage(review) { const reviewsList = document.getElementById('reviews-list');