feat: Enhance post list filters with wider dropdowns and new layouts

This commit is contained in:
Kerby Martino (aider) authored and Kerby Martino committed 2025-05-10 20:39:07 +08:00
1 parent 119d5f54cd
commit f70c6ca267
1 file changed
+40 -20
+40 -20
View File
@@ -11,15 +11,30 @@
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg> <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>
</button> </button>
<!-- Dropdown content for Geolocation (initially hidden, toggle with JS) --> <!-- Dropdown content for Geolocation (initially hidden, toggle with JS) -->
<div id="location-filter-dropdown" class="absolute z-10 mt-1 w-full rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5"> <div id="location-filter-dropdown" class="absolute z-10 mt-1 rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5" style="min-width: 300px;">
<div class="py-2 px-3"> <div class="py-3">
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-sm">Nearby</button> <div class="px-3 pb-2">
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-sm">Anywhere</button> <input type="text" placeholder="Type something here..." class="w-full px-3 py-2 border border-gray-300 rounded-base text-sm focus:outline-none focus:ring-1 focus:ring-indigo-700 focus:border-indigo-700">
<input type="text" placeholder="Search city..." class="mt-2 w-full px-3 py-2 border border-gray-300 rounded-base text-sm focus:outline-none focus:ring-1 focus:ring-indigo-700 focus:border-indigo-700"> </div>
<div class="max-h-60 overflow-y-auto">
<p class="pl-3 pt-2 font-semibold text-gray-700 text-sm">Geolocation</p>
<div class="pt-1 px-3">
<a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Nearby</a>
<a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Anywhere</a>
</div>
<p class="pl-3 pt-2 font-semibold text-gray-700 text-sm">City</p>
<div class="px-3 pt-1">
<input type="text" placeholder="Search city..." class="w-full px-3 py-2 border border-gray-300 rounded-base text-sm focus:outline-none focus:ring-1 focus:ring-indigo-700 focus:border-indigo-700">
<!-- Placeholder for city list (would be populated by JS) --> <!-- Placeholder for city list (would be populated by JS) -->
<a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Manila</a>
<a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Makati</a>
<a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Quezon City</a>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<!-- Availability Filter --> <!-- Availability Filter -->
<div class="relative"> <div class="relative">
@@ -28,17 +43,22 @@
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg> <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>
</button> </button>
<!-- Dropdown content for Availability (initially hidden, toggle with JS) --> <!-- Dropdown content for Availability (initially hidden, toggle with JS) -->
<div id="availability-filter-dropdown" class="absolute z-10 mt-1 w-full rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5"> <div id="availability-filter-dropdown" class="absolute z-10 mt-1 rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5" style="min-width: 300px;">
<div class="py-2 px-3"> <div class="py-3">
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-sm">Open Now</button> <div class="max-h-60 overflow-y-auto">
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-sm">Open Always</button> <p class="pl-3 pt-1 font-semibold text-gray-700 text-sm">Availability</p>
<div class="mt-2"> <div class="pt-1 px-3">
<label for="availability-future" class="block text-sm font-medium text-gray-700 mb-1">In the future:</label> <a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Open Now</a>
<a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Open Always</a>
</div>
<p class="pl-3 pt-2 font-semibold text-gray-700 text-sm">Future Availability</p>
<div class="px-3 pt-1">
<input type="text" id="availability-future" placeholder="e.g., 1 hour from now" class="w-full px-3 py-2 border border-gray-300 rounded-base text-sm focus:outline-none focus:ring-1 focus:ring-indigo-700 focus:border-indigo-700"> <input type="text" id="availability-future" placeholder="e.g., 1 hour from now" class="w-full px-3 py-2 border border-gray-300 rounded-base text-sm focus:outline-none focus:ring-1 focus:ring-indigo-700 focus:border-indigo-700">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- Rates Filter --> <!-- Rates Filter -->
<div class="relative"> <div class="relative">
@@ -47,13 +67,13 @@
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg> <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>
</button> </button>
<!-- Dropdown content for Rates (initially hidden, toggle with JS) --> <!-- Dropdown content for Rates (initially hidden, toggle with JS) -->
<div id="rates-filter-dropdown" class="absolute z-10 mt-1 w-full rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5"> <div id="rates-filter-dropdown" class="absolute z-10 mt-1 rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5" style="min-width: 220px;">
<div class="py-1"> <div class="py-1 px-2">
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Hourly</button> <a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Hourly</a>
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Daily</button> <a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Daily</a>
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Weekly</button> <a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Weekly</a>
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Monthly</button> <a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Monthly</a>
<button class="block w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">Annually</button> <a href="#" class="block px-4 py-2 my-1 text-sm text-gray-700 hover:bg-green-300 hover:text-white rounded-sm focus:outline-none focus:bg-gray-100 focus:text-gray-900">Annually</a>
</div> </div>
</div> </div>
</div> </div>
@@ -65,7 +85,7 @@
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg> <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>
</button> </button>
<!-- Dropdown content for Type of Spaces (initially hidden, toggle with JS) --> <!-- Dropdown content for Type of Spaces (initially hidden, toggle with JS) -->
<div id="spacetype-filter-dropdown" class="absolute z-10 mt-1 w-full rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5"> <div id="spacetype-filter-dropdown" class="absolute z-10 mt-1 rounded-base bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5" style="min-width: 260px;">
<div class="py-1 px-2"> <div class="py-1 px-2">
<label class="flex items-center px-2 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-sm cursor-pointer"> <label class="flex items-center px-2 py-2 text-sm text-gray-700 hover:bg-gray-100 rounded-sm cursor-pointer">
<input type="checkbox" class="h-4 w-4 text-indigo-700 border-gray-300 rounded focus:ring-indigo-700"> <input type="checkbox" class="h-4 w-4 text-indigo-700 border-gray-300 rounded focus:ring-indigo-700">
@@ -98,7 +118,7 @@
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg> <svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"/></svg>
</button> </button>
<!-- Dropdown content for Pricing Range (initially hidden, toggle with JS) --> <!-- Dropdown content for Pricing Range (initially hidden, toggle with JS) -->
<div id="pricerange-filter-dropdown" class="absolute z-10 mt-1 w-full rounded-base bg-white shadow-lg hidden p-4 ring-1 ring-black ring-opacity-5" style="min-width: 250px;"> <div id="pricerange-filter-dropdown" class="absolute z-10 mt-1 rounded-base bg-white shadow-lg hidden p-4 ring-1 ring-black ring-opacity-5" style="min-width: 300px;">
<div id="slider-distance" slider> <div id="slider-distance" slider>
<div> <div>
<div class="border border-gray-500" inverse-left style="width:10%;"></div> <div class="border border-gray-500" inverse-left style="width:10%;"></div>