From dafc960de6411160c7573582663f0f3242b28801 Mon Sep 17 00:00:00 2001 From: abdulrahman Date: Wed, 30 Oct 2024 14:46:00 +0300 Subject: [PATCH] -price range --- src/shop.html | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/shop.html b/src/shop.html index 4189526..bed1d53 100644 --- a/src/shop.html +++ b/src/shop.html @@ -1148,7 +1148,27 @@
أقوى سبراي للجسم طار event.stopPropagation(); // Prevent click from bubbling up dropdownsortBy.classList.toggle('hidden'); }); - // Pagination Setup + // pice range + function range() { + return { + minprice: 1000, + maxprice: 7000, + min: 100, + max: 10000, + minthumb: 0, + maxthumb: 0, + + mintrigger() { + this.minprice = Math.min(this.minprice, this.maxprice - 500); + this.minthumb = ((this.minprice - this.min) / (this.max - this.min)) * 100; + }, + + maxtrigger() { + this.maxprice = Math.max(this.maxprice, this.minprice + 500); + this.maxthumb = 100 - (((this.maxprice - this.min) / (this.max - this.min)) * 100); + }, + } + } // Pagination Setup let currentPage = 1; const totalPages = 10;