Files
resharespace-static/_includes/sidebar_inquiry.liquid
T

154 lines
11 KiB
Plaintext

<!-- Sidebar Inquiry Modal -->
<aside id="inquiry-modal" class="overscroll-none overflow-y-auto fixed inset-0 w-screen z-50 justify-center hidden bg-black bg-opacity-50" aria-labelledby="inquiry-modal-title" role="dialog" aria-modal="true">
<div class="relative w-full h-full max-w-lg ml-auto bg-white shadow-xl flex flex-col lg:max-w-xl">
<!-- Modal Header with Close Button -->
<div class="sticky top-0 bg-white z-10 px-4 sm:px-6 py-4 border-b border-gray-200">
<div class="flex items-center justify-between">
<h2 class="text-lg font-medium text-gray-900" id="inquiry-modal-title">
Inquire this Listing
</h2>
<button type="button" onclick="toggleNavbar('inquiry-modal'); if (typeof toggleOverlay === 'function') toggleOverlay('collapse-overlay');" class="bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<span class="sr-only">Close</span>
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
<!-- Modal Body -->
<div class="flex-1 overflow-y-auto p-4 sm:p-6">
<!-- Inquiry Form View -->
<div id="inquiry-form-view">
<!-- Modal Content -->
<div class="bg-white h-auto lg:h-full overflow-y-auto">
<h2 class="text-lg font-semibold text-gray-800 mb-1">Cozy coworking space in the heart of the south</h2>
<p class="text-xs text-gray-600 mb-2">Incub8 space, Centennial Road, Brgy. Batong Dalig, Kawit, Cavite</p>
<p class="text-xs text-gray-500 mb-3">5 hrs ago</p>
<!-- Image -->
<img src="assets/img/SAMPLE3.png" alt="Sample" class="h-48 sm:h-56 w-full object-cover rounded-base mb-4">
<!-- Action Buttons -->
<div class="flex justify-between items-center gap-2 mb-4 flex-wrap">
<div class="flex gap-2"> <!-- Group for left-aligned icons -->
<div class="w-10 h-10 bg-gray-100 rounded-full flex items-center justify-center hover:border-indigo-700 border-2 border-transparent cursor-pointer">
<img src="assets/svg/icon_call.svg" class="w-5 h-5" alt="Call">
</div>
<div onclick="showMapView()" class="w-10 h-10 bg-gray-100 rounded-full flex items-center justify-center hover:border-indigo-700 border-2 border-transparent cursor-pointer" title="View Map & Directions">
<img src="assets/svg/icon_directions.svg" class="w-5 h-5" alt="Pin">
</div>
<div class="w-10 h-10 bg-gray-100 rounded-full flex items-center justify-center hover:border-indigo-700 border-2 border-transparent cursor-pointer">
<img src="assets/svg/icon_link.svg" class="w-5 h-5" alt="Link">
</div>
</div>
<div class="flex gap-2"> <!-- Group for right-aligned icons -->
<div class="w-10 h-10 bg-gray-100 rounded-full flex items-center justify-center hover:border-indigo-700 border-2 border-transparent cursor-pointer">
<img src="assets/svg/icon_report.svg" class="w-5 h-5" alt="Report">
</div>
<div class="w-10 h-10 bg-gray-100 rounded-full flex items-center justify-center hover:border-indigo-700 border-2 border-transparent cursor-pointer">
<img src="assets/svg/icon_like.svg" class="w-5 h-5" alt="Like">
</div>
</div>
</div>
<!-- Form Fields -->
<form class="space-y-3">
<div>
<label for="inquiry-full-name" class="block text-xs font-medium text-gray-700 mb-1">Full Name</label>
<input type="text" id="inquiry-full-name" placeholder="Full Name" class="w-full px-3 py-2 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm" required>
<p class="text-xs text-red-500 mt-1 hidden">Invalid Name</p> <!-- Example error message, initially hidden -->
</div>
<div class="flex gap-3">
<div class="w-1/2">
<label for="inquiry-contact-num" class="block text-xs font-medium text-gray-700 mb-1">Contact #</label>
<input type="tel" id="inquiry-contact-num" placeholder="Contact #" class="w-full px-3 py-2 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm" required>
<p class="text-xs text-red-500 mt-1 hidden">Invalid Phone Number</p>
</div>
<div class="w-1/2">
<label for="inquiry-email" class="block text-xs font-medium text-gray-700 mb-1">Email Address</label>
<input type="email" id="inquiry-email" placeholder="Email Address" class="w-full px-3 py-2 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm" required>
<p class="text-xs text-red-500 mt-1 hidden">Invalid Email Address</p>
</div>
</div>
<div>
<label for="inquiry-message" class="block text-xs font-medium text-gray-700 mb-1">Optional Message</label>
<textarea id="inquiry-message" rows="3" placeholder="Optional Message" class="w-full px-3 py-2 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm"></textarea>
<p class="text-xs text-red-500 mt-1 hidden">Invalid Message</p>
</div>
<div class="pt-2">
<button type="submit" class="w-full bg-indigo-900 text-gray-100 font-semibold py-2 px-4 rounded-lg inline-flex items-center justify-center border-2 border-transparent hover:border-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
<img src="assets/svg/icon_spinner.svg" class="h-4 animate-spin mr-2 hidden" alt="Loading"> Send Inquiry
</button>
<p class="text-xs mt-2 text-gray-600 font-thin text-center">
By submitting, you agree to the <b>Terms and Conditions</b>
</p>
</div>
</form>
</div> <!-- Closes div class="bg-white h-auto lg:h-full overflow-y-auto" -->
</div> <!-- Closes inquiry-form-view -->
<!-- Map View -->
<div id="inquiry-map-view" class="hidden">
<div class="bg-white h-auto lg:h-full overflow-y-auto">
<!-- Back Button -->
<button type="button" onclick="showFormView()" class="mb-4 inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md bg-gray-100 text-indigo-900 font-semibold py-2 px-4 rounded-lg inline-flex items-center justify-between border-2 border-transparent hover:border-indigo-700">
<svg class="w-5 h-5 mr-2 -ml-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" />
</svg>
Back to Inquiry
</button>
<h2 class="text-lg font-semibold text-gray-800 mb-1">Location for Cozy coworking space</h2>
<p class="text-xs text-gray-600 mb-3">Incub8 space, Centennial Road, Brgy. Batong Dalig, Kawit, Cavite</p>
<!-- Map Placeholder -->
<div id="mapbox-map-container" class="h-64 sm:h-80 w-full bg-gray-200 rounded-base mb-4 border border-gray-300 flex items-center justify-center text-gray-500 p-4 text-center">
<!-- This div will be targeted by Mapbox JS for map rendering. -->
Map will load here. Ensure Mapbox GL JS is initialized and targets this container.
</div>
<!-- Directions Button -->
<a href="https://www.google.com/maps/dir/?api=1&destination=Incub8+space,+Centennial+Road,+Brgy.+Batong+Dalig,+Kawit,+Cavite" target="_blank" rel="noopener noreferrer" id="get-directions-link" class="w-full bg-indigo-900 text-gray-100 font-semibold py-2 px-4 rounded-lg inline-flex items-center justify-center border-2 border-transparent hover:border-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
Get Directions
</a>
<p class="text-xs mt-2 text-gray-600 font-thin text-center">
Opens Google Maps in a new tab.
</p>
</div>
</div>
<!-- End Map View -->
<script type="text/javascript">
function showMapView() {
document.getElementById('inquiry-form-view').classList.add('hidden');
document.getElementById('inquiry-map-view').classList.remove('hidden');
document.getElementById('inquiry-modal-title').textContent = 'Location & Directions';
// Placeholder: Dynamically set address for directions if needed
// const listingAddress = "Incub8 space, Centennial Road, Brgy. Batong Dalig, Kawit, Cavite"; // Or get from Liquid variable
// const directionsLink = document.getElementById('get-directions-link');
// if (directionsLink) {
// directionsLink.href = `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(listingAddress)}`;
// }
// Placeholder: Initialize Mapbox map here if it's not already initialized
// This is a conceptual placeholder for actual Mapbox initialization logic.
// e.g., if (typeof mapboxgl !== 'undefined' && !mapInstance) {
// mapInstance = new mapboxgl.Map({ container: 'mapbox-map-container', style: 'YOUR_MAPBOX_STYLE_URL', center: [lng, lat], zoom: 15 });
// new mapboxgl.Marker().setLngLat([lng, lat]).addTo(mapInstance);
// }
}
function showFormView() {
document.getElementById('inquiry-map-view').classList.add('hidden');
document.getElementById('inquiry-form-view').classList.remove('hidden');
document.getElementById('inquiry-modal-title').textContent = 'Inquire this Listing';
}
</script>
</div> <!-- Closing div for "flex-1 overflow-y-auto p-4 sm:p-6" -->
</div> <!-- Closing div for "relative w-full h-full max-w-lg ml-auto..." -->
</aside>
<!-- End Sidebar Inquiry Modal -->