feat: Implement step-by-step post form in sidebar modal

This commit is contained in:
Kerby Martino (aider) committed 2025-05-11 02:48:06 +08:00
1 parent ea9036ec79
commit df14724009
1 file changed
+429 -407
+429 -407
View File
@@ -1,422 +1,444 @@
<!--sidebar post section--> <!--sidebar post section-->
<aside class="overscroll-none overflow-x-hidden overflow-y-auto fixed inset-0 w-screen z-50 justify-center hidden" <aside id="post-modal" class="overscroll-none overflow-y-auto fixed inset-0 w-screen z-50 justify-center hidden bg-black bg-opacity-50" aria-labelledby="modal-title" role="dialog" aria-modal="true">
id="post-modal"> <div class="relative w-full h-full max-w-lg ml-auto bg-white shadow-xl flex flex-col lg:max-w-xl">
<div class="relative w-auto mt-12.2 mb-11 mx-auto max-w-lg sm:mt-18 md:mt-50 lg:mt-16 lg:mb-0 lg:bg-white lg:w-full lg:max-w-lg lg:fixed lg:flex lg:justify-end lg:right-0 lg:top-0 lg:bottom-0 xxl:block xxl:absolute xxl:inset-0 xxl:bg-transparent xxl:mt-36"> <!-- Modal Header with Close Button -->
<!--location modal--> <div class="sticky top-0 bg-white z-10 px-4 sm:px-6 py-4 border-b border-gray-200">
<div class="z-10 absolute w-11/12 mx-4 lg:mx-6 my-5 pt-14 pb-10 px-5 h-auto bg-indigo-900 rounded-lg hidden" <div class="flex items-center justify-between">
id="example-collapse-location"> <h2 class="text-lg font-medium text-gray-900" id="modal-title">
<a href="#"><img alt="" class="absolute top-0 right-0 m-3" onclick="toggleDropdown('example-collapse-location')" Post a New Listing
src="assets/svg/icon_close.svg"></a> </h2>
<div class="relative"> <button type="button" onclick="toggleNavbar('post-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">
<div class="w-full px-3 py-2 mx-auto bg-white rounded-lg"> <span class="sr-only">Close</span>
<button class="w-full px-3 text-lg text-left text-indigo-900 focus:outline-none rounded-lg" <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">
onclick="toggleDropdown('example-collapse-dropdown11')" <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
type="button">Select Location
</button>
</div>
<div class="z-10 origin-top absolute -mt-12 w-full py-3 px-3 bg-white rounded-lg hidden shadow-lg"
id="example-collapse-dropdown11">
<input class="w-full h-12 px-3 text-md focus:outline-none border border-gray-800 rounded-lg"
onclick="toggleDropdown('example-collapse-dropdown11')" placeholder="Type something here"
type="text">
<div class="sm:h-64 md:h-56 lg:h-auto overflow-auto break-all">
<div class="px-3">
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Incub8,
Space, Kawit, Cavite</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Incub8,
Space, Kawit, Cavite</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Incub8,
Space, Kawit, Cavite</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Incub8,
Space, Kawit, Cavite</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Incub8,
Space, Kawit, Cavite</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Incub8,
Space, Kawit, Cavite</a>
</div>
</div>
</div>
<div class="mt-5 h-60 w-full object-cover " id="map4"></div>
<button class="w-full mt-5 py-2 text-lg text-white font-semibold bg-indigo-700 border-none uppercase">
submit
</button> </button>
</div> </div>
</div> </div>
<!--end location modal--> <!-- Modal Body with Form -->
<!--content--> <div id="post-form-steps-modal" class="flex-1 overflow-y-auto p-4 sm:p-6">
<div class="xxl:mb-11 border-0 rounded-lg relative flex flex-col w-full outline-none focus:outline-none"> <!-- Step Indicators (Compact) -->
<div class="relative"> <div class="flex justify-between mb-6">
<div class="hidden"> <div id="step-indicator-1-modal" class="step-indicator-modal active-step-modal text-center flex-1">
<div class="flex absolute h-10 ml-4 mt-5 px-4 py-2 text-md md:mt-3 md:text-md lg:text-md lg:h-10 lg:mt-5 xl:h-10 xl:mt-5 xl:text-md xxl:mt-4 bg-indigo-700 text-white font-light md:tracking-normal font-sans"> <div class="w-8 h-8 mx-auto rounded-full bg-indigo-700 text-white flex items-center justify-center text-xs">1</div>
P 1,299 / month <p class="text-xs mt-1">Description</p>
<div class="tooltip">
<img alt=""
class=" flex absolute top-0 right-0 h-10 px-3 p-2 pt-2 -mr-10 bg-white text-xs"
src="assets/svg/icon_call.svg">
<div class="relative tooltip-text flex absolute top-0 right-0 px-3 py-3 bg-white rounded-md -mr-24 mt-14">
<svg class="absolute text-white -mt-3 h-6 w-9/12 top-0" viewBox="0 0 255 255" x="0px"
xml:space="preserve" y="0px"><polygon class="fill-current" points="0,127.5 255,127 127.5,0"/></svg>
<img alt="" src="assets/svg/icon_phone.svg">
<p class="ml-1 text-gray-600">0912345678</p>
</div>
</div>
</div>
<div class="flex absolute h-10 w-auto mt-5 md:mt-3 lg:mt-5 xxl:mt-4 right-0 top-0">
<div class="pr-4 pl-3 mx-2 flex bg-indigo-900 cursor-pointer">
<img alt="" class="flex" src="assets/svg/icon_back.svg">
</div>
<div class="pl-4 pr-3 ml-2 mr-4 md:mr-1 flex bg-indigo-900 cursor-pointer">
<img alt="" class="flex" src="assets/svg/icon_next.svg">
</div>
<div class="px-4 py-1 flex hidden md:py-3 md:block text-gray-500 cursor-pointer">
<img alt="" class="flex" onclick="toggleNavbar('post-modal')"
src="assets/svg/icon_close.svg">
</div>
</div>
<div class="flex absolute h-10 w-auto mt-5 md:mt-3 lg:mt-5 xxl:mt-4 right-0 top-0">
<div class="px-4 py-1 flex hidden md:py-3 md:block text-gray-500 cursor-pointer">
<img alt="" class="flex" onclick="toggleNavbar('post-modal');toggleOverlay('collapse-overlay')"
src="assets/svg/icon_close.svg">
</div>
</div>
<div class="absolute py-4 px-3 md:pb-4 md:pt-4 md:px-2 xxl:px-3 right-0 bottom-0 bg-indigo-900 cursor-pointer">
<img alt="" class=""
onclick="toggleNavbar('collapse-tool-tip10')"
src="assets/svg/icon_ellipsis.svg">
</div>
<!--ellipsis tool tip-->
<div class="z-10 absolute right-0 bottom-0 bg-indigo-900 hidden rounded-lg -mb-18 font-sans"
id="collapse-tool-tip10">
<a class="flex px-4 py-2" href="">
<p class="flex text-sm xl:text-md text-gray-700 hover:text-gray-400 hover:font-semibold">
<svg class="h-5 w-4 mr-2" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd"
d="M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z"
fill-rule="evenodd"/>
</svg>
Directions
</p>
</a>
<a class="flex px-4 py-2" href="">
<p class="flex text-sm xl:text-md text-gray-700 hover:text-gray-400 hover:font-semibold">
<svg class="h-5 w-4 mr-2" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd"
d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z"
fill-rule="evenodd"/>
</svg>
Copy link
</p>
</a>
<a class="flex px-4 py-2" href="">
<p class="flex text-sm xl:text-md text-gray-700 hover:text-gray-400 hover:font-semibold">
<svg class="h-5 w-4 mr-2" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path clip-rule="evenodd"
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"
fill-rule="evenodd"/>
</svg>
Report this
</p>
</a>
</div>
<!--end ellipsis tool tip-->
<img alt=""
class="h-65 lg:h-auto xl:h-58 xxl:h-62 w-full object-cover sm:rounded-t-lg lg:rounded-none xxl:rounded-t-lg "
src="assets/img/SAMPLE3.png ">
</div> </div>
<!--availability upload photo--> <div id="step-indicator-2-modal" class="step-indicator-modal text-center text-gray-500 flex-1">
<div class="px-4 py-3 h-48 md:h-65 xl:h-58 xxl:h-62 w-full bg-white sm:rounded-t-lg"> <div class="w-8 h-8 mx-auto rounded-full bg-gray-300 flex items-center justify-center text-xs">2</div>
<div class="flex justify-center h-full w-full items-center border-dashed border-2 border-indigo-750 opacity-75"> <p class="text-xs mt-1">Location</p>
<a class="flex flex-col text-gray-200 opacity-75" href=""><img alt=""
src="assets/svg/camera_upload.svg">
<p class="mt-2 text-indigo-800 tracking-widest opacity-75">Upload Photo</p>
</a>
</div>
</div> </div>
<!--remove icon--> <div id="step-indicator-3-modal" class="step-indicator-modal text-center text-gray-500 flex-1">
<div class="absolute right-0 bottom-0 bg-indigo-900"> <div class="w-8 h-8 mx-auto rounded-full bg-gray-300 flex items-center justify-center text-xs">3</div>
<a href=""><img alt="" class="h-6 w-6 m-2" <p class="text-xs mt-1">Price & Availability</p>
onclick="toggleNavbar('collapse-tool-tip10')"
src="assets/svg/icon_remove.svg"></a>
</div> </div>
<!--remove icon--> <div id="step-indicator-4-modal" class="step-indicator-modal text-center text-gray-500 flex-1">
<!--end availability upload photo--> <div class="w-8 h-8 mx-auto rounded-full bg-gray-300 flex items-center justify-center text-xs">4</div>
<p class="text-xs mt-1">Contact</p>
<!--availability upload progress bar-->
<div class="absolute bottom-0 h-3 w-full bg-indigo-900 ">
<div class="h-3 w-3/12 bg-green-300"></div>
</div>
<!--end availability upload progress bar-->
<div class=" lg:h-auto w-full object-cover md:rounded-t-lg lg:rounded-none xxl:rounded-t-lg relative hidden"
id="example-collapse-map">
<div class="z-10 absolute py-3 px-3 right-0 bottom-0 bg-indigo-900">
<img alt="" class=""
onclick="toggleSidebar('example-collapse-sidebar');toggleOverlay('example-collapse-overlay')"
src="assets/svg/icon_close.svg">
</div>
</div>
</div>
<div class="w-full overflow-y-auto lg:overflow-y-auto sm:rounded-b-lg overscroll-none"
id="tabs-id">
<div class="flex flex-col bg-gray-100">
<!--sidebar tab-->
<ul class="flex flex-wrap">
<li class="w-1/3">
<a class="w-full h-10 text-center inline-block border-l border-t rounded-t py-2 px-4 cursor-pointer"
onclick="changeAtiveTab(event,'tab-description')">Description</a>
</li>
<li class=" w-1/3">
<a class="w-full h-10 text-center bg-white inline-block py-2 px-4 cursor-pointer"
onclick="changeAtiveTab(event,'tab-availability')">Availability</a>
</li>
<li class="w-1/3">
<a class="w-full h-10 text-sm md:text-base text-center bg-white inline-block py-2 px-4 overflow-y-auto cursor-pointer"
onclick="changeAtiveTab(event,'tab-contact')">Contact Info</a>
</li>
</ul>
<!--end sidebar tab-->
<div class="tab-content tab-space">
<!-- post space description section-->
<div class="mt-8 px-3 md:mt-3 lg:mt-4 lg:px-7 xxl:mt-6 block" id="tab-description">
<div class="w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<input class="w-full px-3 py-2 rounded-md focus:outline-none" placeholder="Title"
type="text">
</div>
<div class="relative w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<button class="relative w-full py-2 pl-3 text-left text-gray-500 bg-white rounded-lg focus:outline-none appearance-none"
onclick="toggleDropdown('example-collapse-dropdown10')">
Categories
<img alt="" class=" absolute top-0 right-0 m-4" src="assets/svg/icon_dropdown.svg">
</button>
<div class="z-10 -mt-2 origin-top-right absolute w-full hidden"
id="example-collapse-dropdown10">
<div class="bg-white rounded-lg py-3 -mt-10">
<div class="px-2 w-full">
<input class="w-full h-12 px-2 focus:outline-none border border-gray-400 rounded-lg"
placeholder="type something here" type="text">
</div>
<div class="sm:h-64 md:h-56 lg:h-auto overflow-y-scroll lg:overflow-auto shadow-md">
<div class="px-3">
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Option
1</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Option
1</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Option
1</a>
</div>
</div>
</div>
</div>
</div>
<div class="relative w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<button class="relative w-full py-2 pl-3 text-left text-gray-500 bg-white rounded-lg focus:outline-none appearance-none"
onclick="toggleDropdown('example-collapse-location')">
Location
<img alt="" class=" absolute top-0 right-0 m-4" src="assets/svg/icon_dropdown.svg">
</button>
</div>
<div class="relative flex mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<div class="relative flex w-full">
<button class="relative w-full mr-2 md:mr-1 lg:mr-2 xxl:mr-1 py-2 pl-3 text-left text-gray-500 bg-white rounded-lg focus:outline-none appearance-none"
onclick="toggleDropdown('example-collapse-dropdown13')">
Price
<img alt="" class=" absolute top-0 right-0 m-4" src="assets/svg/icon_dropdown.svg">
</button>
<div class="z-10 sm:h-64 md:h-auto origin-top-right absolute w-full shadow-md hidden"
id="example-collapse-dropdown13">
<div class="bg-white rounded-lg py-3 sm:h-64 md:h-56 lg:h-auto overflow-y-scroll lg:overflow-auto">
<div class="pt-1 px-3">
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">
Option 1</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">
Option 1</a>
</div>
</div>
</div>
</div>
<div class="relative flex w-full">
<button class="relative w-full py-2 pl-3 text-left text-gray-500 bg-white rounded-lg focus:outline-none appearance-none"
onclick="toggleDropdown('example-collapse-dropdown14')">
Hourly
<img alt="" class=" absolute top-0 right-0 m-4" src="assets/svg/icon_dropdown.svg">
</button>
<div class="z-10 h-56 sm:h-64 md:h-auto origin-top-right absolute w-full shadow-md overflow-y-auto hidden"
id="example-collapse-dropdown14">
<div class="bg-white rounded-lg py-3 sm:h-64 md:h-56 overflow-y-scroll lg:overflow-auto">
<p class="pl-3 font-extrabold">Availability</p>
<div class="pt-1 px-3">
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Open
Now</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">Open
Always</a>
</div>
<p class="pl-3 font-extrabold">By Hour</p>
<div class="px-3">
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">1
Hour from now
</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">2
Hour from now
</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">3
Hour from now</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">4
Hour from now</a>
<a class="block px-5 py-2 my-2 text-md leading-5 hover:bg-green-300 hover:text-white focus:outline-none focus:bg-gray-100 focus:text-gray-900"
href="#">5
Hour from now</a>
</div>
</div>
</div>
</div>
</div>
<div class="w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<textarea class="w-full px-3 py-1 xxl:py-3 text-gray-500 rounded-md focus:outline-none"
rows="4">Description</textarea>
</div>
<div class="w-full mt-4 md:mt-5 xxl:mt-2 mb-3">
<button class="relative flex justify-center items-center py-2 w-full text-md lg:text-lg xxl:text-md font-bold bg-green-300 rounded-none border-none focus:outline-none">
<img alt="" class="animate-spin absolute left-0 ml-4 h-4"
src="assets/svg/icon_spinner.svg">SUBMIT
</button>
<p class="mt-1 text-xs xl:text-sm text-gray-600 font-thin tracking-tight">By
Submitting
your agree to the
<b>Terms and Conditions</b></p>
</div>
</div>
<!-- end post space description section-->
<!-- post space Availability section-->
<div class="mt-3 px-3 md:px-7 md:mt-3 lg:mt-4 lg:px-7 xxl:mt-6 hidden"
id="tab-availability">
<div class="flex w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<button class="py-2 px-3 w-full h-10 bg-white text-sm text-center rounded-l-lg focus:outline-none uppercase">
sun
</button>
<button class="py-2 px-3 w-full h-10 bg-white text-sm text-center focus:outline-none uppercase">
mon
</button>
<button class="py-2 px-3 w-full h-10 bg-white text-sm text-center focus:outline-none uppercase">
tue
</button>
<button class="py-2 px-3 w-full h-10 bg-indigo-900 text-white text-sm text-center focus:outline-none uppercase">
wed
</button>
<button class="py-2 px-3 w-full h-10 bg-white text-sm text-center focus:outline-none uppercase">
thu
</button>
<button class="py-2 px-3 w-full h-10 bg-white text-sm text-center focus:outline-none uppercase">
fri
</button>
<button class="py-2 px-3 w-full h-10 bg-white text-sm text-center rounded-r-lg focus:outline-none uppercase">
sat
</button>
</div>
<div class="flex mt-4 md:mt-3 lg:mt-6 xxl:mt-6">
<button class="relative w-full mr-2 mb-2 md:mr-1 lg:mr-2 xxl:mr-1 py-2 pl-3 bg-white rounded-lg focus:outline-none appearance-none"
onclick="toggleDropdown('example-collapse-dropdown1')">
12:00 AM
</button>
<button class="relative w-full py-2 pl-3 text-white bg-indigo-900 rounded-t-lg focus:outline-none appearance-none"
onclick="toggleDropdown('example-collapse-dropdown1')">
12:00 AM
</button>
</div>
<div class="grid grid-cols-3 gap-x-2 w-full px-8 py-4 rounded-lg rounded-tr-none bg-indigo-900">
<ul class="flex-col w-full text-center">
<li class="w-full pb-3 text-white border-b-2 border-white">10</li>
<li class="w-full pt-3 pb-3 text-white border-b-2 border-white">11</li>
<li class="w-full pt-3 pb-3 text-white">12</li>
</ul>
<ul class="flex-col w-full text-center">
<li class="w-full pb-3 text-white border-b-2 border-white">14</li>
<li class="w-full pt-3 pb-3 text-white border-b-2 border-white">15</li>
<li class="w-full pt-3 pb-3 text-white">16</li>
</ul>
<ul class="flex-col w-full text-center">
<li class="w-full pb-3 text-white border-b-2 border-white">PM</li>
<li class="w-full pt-3 pb-3 text-white border-b-2 border-white">AM</li>
<li class="w-full pt-3 pb-3 text-white">PM</li>
</ul>
<div class="mt-1 w-full col-span-3">
<button class="py-2 w-full text-white text-xl tracking-widest font-bold bg-indigo-700 uppercase">
set
</button>
</div>
</div>
<div class="w-full mt-4 md:mt-14 lg:mt-10 xxl:mt-2 mb-3">
<button class="relative flex justify-center items-center py-2 w-full text-md lg:text-lg xxl:text-md font-bold bg-green-300 rounded-none border-none focus:outline-none">
<img alt="" class="animate-spin absolute left-0 ml-4 h-4"
src="assets/svg/icon_spinner.svg">SUBMIT
</button>
<p class="mt-1 text-xs xl:text-sm text-gray-600 font-thin tracking-tight">By
Submitting
your agree to the
<b>Terms and Conditions</b></p>
</div>
</div>
<!-- end post space Availability section-->
<!-- post space contact info section-->
<div class="mt-8 px-3 md:mt-3 lg:mt-8 lg:px-7 xxl:mt-6 hidden" id="tab-contact">
<div class="w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<input class="w-full px-3 py-2 rounded-md focus:outline-none" placeholder="Name of Coworking Space"
type="text">
</div>
<div class="flex mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<input class="mr-2 md:mr-1 lg:mr-2 xxl:mr-1 w-full px-3 py-2 rounded-md focus:outline-none"
placeholder="First Name" type="text">
<input class="w-full px-3 py-2 rounded-md focus:outline-none" placeholder="Last Name"
type="text">
</div>
<div class="w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<input class="w-full px-3 py-2 rounded-md focus:outline-none" placeholder="Contact Number"
type="text">
</div>
<div class="w-full mt-2 md:mt-1 lg:mt-2 xxl:mt-1">
<textarea class="w-full px-3 py-1 xxl:py-3 text-gray-500 rounded-md focus:outline-none"
rows="4">Email Address</textarea>
</div>
<div class="w-full mt-4 md:mt-5 xxl:mt-2 mb-3">
<button class="relative flex justify-center items-center py-2 w-full text-md lg:text-lg xxl:text-md font-bold bg-green-300 rounded-none border-none focus:outline-none uppercase">
<img alt="" class="animate-spin absolute left-0 ml-4 h-4"
src="assets/svg/icon_spinner.svg">Send Inquiry
</button>
<p class="mt-1 text-xs xl:text-sm text-gray-600 font-thin tracking-tight">By
Submitting
your agree to the
<b>Terms and Conditions</b></p>
</div>
</div>
<!-- end post space contact info section-->
</div>
</div> </div>
</div> </div>
<form id="new-listing-form-modal">
<!-- Step 1: Description -->
<div id="step-1-modal" class="form-step-modal active-step-modal">
<h2 class="text-lg font-semibold text-indigo-700 mb-4">Step 1: Listing Description</h2>
<div class="space-y-4">
<div>
<label for="photo-modal" class="block text-xs font-medium text-gray-700 mb-1">Listing Photo</label>
<input type="file" id="photo-modal" name="photo" class="w-full text-xs text-gray-500 file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:font-semibold file:bg-indigo-50 file:text-indigo-700 hover:file:bg-indigo-100 border border-gray-300 rounded-sm cursor-pointer focus:outline-none focus:border-indigo-600" accept="image/*">
<p class="text-xs text-gray-500 mt-1">Upload one image (JPG, PNG).</p>
</div>
<div>
<label for="title-modal" class="block text-xs font-medium text-gray-700 mb-1">Title</label>
<input type="text" id="title-modal" name="title" placeholder="e.g., Modern Coworking Hub" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
<div>
<label for="description-modal" class="block text-xs font-medium text-gray-700 mb-1">Description</label>
<textarea id="description-modal" name="description" rows="3" placeholder="Describe your space..." class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm"></textarea>
</div>
<div>
<label for="space-type-modal" class="block text-xs font-medium text-gray-700 mb-1">Space Type</label>
<select id="space-type-modal" name="space-type" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm bg-white">
<option value="">Select a space type</option>
<option value="coworking">Coworking</option>
<option value="room">Private Room</option>
<option value="conference">Conference Room</option>
<option value="event-space">Event Space</option>
<option value="virtual-office">Virtual Office</option>
</select>
</div>
</div>
<div class="mt-6 flex justify-end">
<button type="button" class="next-step-btn-modal bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2 px-4 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-colors text-sm">
Next <span aria-hidden="true">&rarr;</span>
</button>
</div>
</div>
<!-- Step 2: Location -->
<div id="step-2-modal" class="form-step-modal hidden">
<h2 class="text-lg font-semibold text-indigo-700 mb-4">Step 2: Location</h2>
<div class="space-y-4">
<div class="relative">
<label for="location-search-modal" class="block text-xs font-medium text-gray-700 mb-1">Select Location</label>
<input type="text" id="location-search-modal" name="location-search" placeholder="Search city or area..." class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm" autocomplete="off">
<div id="location-dropdown-modal" class="absolute z-20 mt-1 w-full rounded-md bg-white shadow-lg hidden ring-1 ring-black ring-opacity-5 max-h-48 overflow-y-auto py-1">
<a href="#" data-value="Manila, Philippines" class="location-item-modal block px-4 py-2 text-xs text-gray-700 hover:bg-indigo-50 hover:text-indigo-600">Manila, Philippines</a>
<a href="#" data-value="Makati, Philippines" class="location-item-modal block px-4 py-2 text-xs text-gray-700 hover:bg-indigo-50 hover:text-indigo-600">Makati, Philippines</a>
<a href="#" data-value="Quezon City, Philippines" class="location-item-modal block px-4 py-2 text-xs text-gray-700 hover:bg-indigo-50 hover:text-indigo-600">Quezon City, Philippines</a>
<a href="#" data-value="Cebu City, Philippines" class="location-item-modal block px-4 py-2 text-xs text-gray-700 hover:bg-indigo-50 hover:text-indigo-600">Cebu City, Philippines</a>
<a href="#" data-value="Taguig, Philippines" class="location-item-modal block px-4 py-2 text-xs text-gray-700 hover:bg-indigo-50 hover:text-indigo-600">Taguig, Philippines</a>
<p class="no-results-modal px-4 py-2 text-xs text-gray-500 hidden">No locations found.</p>
</div>
<input type="hidden" id="selected-location-modal" name="selected-location">
</div>
<div>
<label for="address-line-1-modal" class="block text-xs font-medium text-gray-700 mb-1">Address Line 1</label>
<input type="text" id="address-line-1-modal" name="address-line-1" placeholder="e.g., 123 Main St" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
<div>
<label for="address-line-2-modal" class="block text-xs font-medium text-gray-700 mb-1">Address Line 2 (Optional)</label>
<input type="text" id="address-line-2-modal" name="address-line-2" placeholder="e.g., Brgy. Batong Dalig" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
</div>
<div class="mt-6 flex justify-between">
<button type="button" class="prev-step-btn-modal bg-gray-200 hover:bg-gray-300 text-gray-700 font-semibold py-2 px-4 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50 transition-colors text-sm">
<span aria-hidden="true">&larr;</span> Previous
</button>
<button type="button" class="next-step-btn-modal bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2 px-4 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-colors text-sm">
Next <span aria-hidden="true">&rarr;</span>
</button>
</div>
</div>
<!-- Step 3: Price & Availability -->
<div id="step-3-modal" class="form-step-modal hidden">
<h2 class="text-lg font-semibold text-indigo-700 mb-4">Step 3: Price & Availability</h2>
<div class="space-y-4">
<div>
<label for="price-modal" class="block text-xs font-medium text-gray-700 mb-1">Price (PHP per day)</label>
<div class="relative mt-1 rounded-md shadow-sm">
<div class="pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2">
<span class="text-gray-500 text-sm">₱</span>
</div>
<input type="number" id="price-modal" name="price" placeholder="e.g., 1200" class="w-full pl-6 pr-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm" min="0">
</div>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800 mb-2">Availability Date Range</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-3">
<div>
<label for="availability-start-date-modal" class="block text-xs font-medium text-gray-700 mb-1">Start Date</label>
<input type="date" id="availability-start-date-modal" name="availability-start-date" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
<div>
<label for="availability-end-date-modal" class="block text-xs font-medium text-gray-700 mb-1">End Date</label>
<input type="date" id="availability-end-date-modal" name="availability-end-date" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
</div>
</div>
<div>
<h3 class="text-sm font-medium text-gray-800 mb-2">Weekly Availability & Hours</h3>
{% assign days_list_modal = "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" | split: "," %}
<div class="mb-3">
<div class="flex flex-wrap border-b border-gray-200">
{% for day_label_modal in days_list_modal %}
<button type="button"
class="day-tab-button-modal -mb-px py-1.5 px-3 border-b-2 border-transparent text-xs font-medium text-gray-500 hover:text-gray-700 hover:border-gray-300 focus:outline-none"
data-day-target="{{ day_label_modal | downcase }}">
{{ day_label_modal | slice: 0, 3 }} <!-- Abbreviated day name -->
</button>
{% endfor %}
</div>
</div>
{% for day_label_modal in days_list_modal %}
<div id="availability-content-{{ day_label_modal | downcase }}-modal" class="day-availability-content-modal hidden">
<div class="bg-gray-50 p-3 rounded-md shadow-sm space-y-3">
<label for="available-{{ day_label_modal | downcase }}-modal" class="flex items-center justify-between w-full cursor-pointer">
<span class="text-xs font-medium text-gray-900">Available on {{ day_label_modal }}</span>
<input type="checkbox"
id="available-{{ day_label_modal | downcase }}-modal"
name="available_days[]"
value="{{ day_label_modal }}"
class="sr-only peer day-specific-availability-toggle-modal"
data-day="{{ day_label_modal | downcase }}"
onchange="toggleDayTimeSelectionModal('{{ day_label_modal | downcase }}')">
<div class="relative w-9 h-5 bg-gray-200 peer-focus:outline-none peer-focus:ring-1 peer-focus:ring-offset-1 peer-focus:ring-indigo-500 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[1.5px] after:left-[1.5px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-indigo-600"></div>
</label>
<div id="time-selection-{{ day_label_modal | downcase }}-modal" class="day-specific-time-inputs-modal mt-3 grid grid-cols-1 sm:grid-cols-2 gap-x-3 gap-y-2 hidden">
<div>
<label for="start-time-{{ day_label_modal | downcase }}-modal" class="block text-xs font-medium text-gray-700 mb-0.5">Open</label>
<input type="time" id="start-time-{{ day_label_modal | downcase }}-modal" name="start_time_{{ day_label_modal | downcase }}" class="w-full px-2 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 text-xs bg-white">
</div>
<div>
<label for="end-time-{{ day_label_modal | downcase }}-modal" class="block text-xs font-medium text-gray-700 mb-0.5">Close</label>
<input type="time" id="end-time-{{ day_label_modal | downcase }}-modal" name="end_time_{{ day_label_modal | downcase }}" class="w-full px-2 py-1 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 text-xs bg-white">
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
<div class="mt-6 flex justify-between">
<button type="button" class="prev-step-btn-modal bg-gray-200 hover:bg-gray-300 text-gray-700 font-semibold py-2 px-4 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50 transition-colors text-sm">
<span aria-hidden="true">&larr;</span> Previous
</button>
<button type="button" class="next-step-btn-modal bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-2 px-4 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50 transition-colors text-sm">
Next <span aria-hidden="true">&rarr;</span>
</button>
</div>
</div>
<!-- Step 4: Contact Information -->
<div id="step-4-modal" class="form-step-modal hidden">
<h2 class="text-lg font-semibold text-indigo-700 mb-4">Step 4: Contact Information</h2>
<div class="space-y-4">
<div>
<label for="space-name-modal" class="block text-xs font-medium text-gray-700 mb-1">Coworking Space Name</label>
<input type="text" id="space-name-modal" name="space_name" placeholder="e.g., The Productive Corner" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-3">
<div>
<label for="contact-first-name-modal" class="block text-xs font-medium text-gray-700 mb-1">Contact Person - First Name</label>
<input type="text" id="contact-first-name-modal" name="contact_first_name" placeholder="John" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
<div>
<label for="contact-last-name-modal" class="block text-xs font-medium text-gray-700 mb-1">Contact Person - Last Name</label>
<input type="text" id="contact-last-name-modal" name="contact_last_name" placeholder="Doe" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
</div>
<div>
<label for="contact-number-modal" class="block text-xs font-medium text-gray-700 mb-1">Contact Number</label>
<input type="tel" id="contact-number-modal" name="contact_number" placeholder="e.g., 09171234567" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
<div>
<label for="contact-email-modal" class="block text-xs font-medium text-gray-700 mb-1">Email Address</label>
<input type="email" id="contact-email-modal" name="contact_email" placeholder="you@example.com" class="w-full px-3 py-1.5 border border-gray-300 rounded-sm focus:outline-none focus:border-indigo-600 text-sm">
</div>
</div>
<div class="mt-6 flex justify-between items-center">
<button type="button" class="prev-step-btn-modal bg-gray-200 hover:bg-gray-300 text-gray-700 font-semibold py-2 px-4 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-opacity-50 transition-colors text-sm">
<span aria-hidden="true">&larr;</span> Previous
</button>
<button type="submit" class="bg-green-500 hover:bg-green-600 text-white font-bold py-2 px-4 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-green-400 focus:ring-opacity-50 transition-colors text-base">
Submit Listing
</button>
</div>
</div>
</form>
</div> </div>
</div> </div>
</aside> </aside>
<style>
.form-step-modal {
/* hidden by default, JS will manage visibility */
}
.active-step-modal {
display: block !important;
}
.step-indicator-modal.active-step-modal p {
color: #4f46e5; /* indigo-600 */
font-weight: 600; /* semibold */
}
.step-indicator-modal .bg-indigo-700 { /* Active indicator circle */ }
.step-indicator-modal .bg-gray-300 { /* Inactive indicator circle */ }
</style>
<script>
document.addEventListener('DOMContentLoaded', function () {
const modalFormElement = document.getElementById('new-listing-form-modal');
if (!modalFormElement) return; // Don't run if the modal form isn't on the page
const stepsModal = modalFormElement.querySelectorAll('.form-step-modal');
const stepIndicatorsModal = document.querySelectorAll('#post-form-steps-modal .step-indicator-modal');
let currentStepModal = 0;
function showStepModal(stepIndex) {
stepsModal.forEach((step, index) => {
step.classList.toggle('active-step-modal', index === stepIndex);
step.classList.toggle('hidden', index !== stepIndex);
});
updateStepIndicatorsModal(stepIndex);
// Scroll to top of modal content area if needed
const modalBody = document.querySelector('#post-modal .overflow-y-auto');
if(modalBody) modalBody.scrollTop = 0;
}
function updateStepIndicatorsModal(activeIndex) {
stepIndicatorsModal.forEach((indicator, index) => {
const circle = indicator.querySelector('div:first-child');
const text = indicator.querySelector('p');
if (index === activeIndex) {
circle.classList.remove('bg-gray-300');
circle.classList.add('bg-indigo-700', 'text-white');
text.classList.remove('text-gray-500');
text.classList.add('text-indigo-600', 'font-semibold');
} else if (index < activeIndex) {
circle.classList.remove('bg-gray-300');
circle.classList.add('bg-indigo-700', 'text-white');
text.classList.remove('text-gray-500', 'text-indigo-600', 'font-semibold');
text.classList.add('text-gray-700');
} else {
circle.classList.remove('bg-indigo-700', 'text-white');
circle.classList.add('bg-gray-300');
text.classList.remove('text-indigo-600', 'font-semibold');
text.classList.add('text-gray-500');
}
});
}
modalFormElement.querySelectorAll('.next-step-btn-modal').forEach(button => {
button.addEventListener('click', () => {
if (currentStepModal < stepsModal.length - 1) {
currentStepModal++;
showStepModal(currentStepModal);
}
});
});
modalFormElement.querySelectorAll('.prev-step-btn-modal').forEach(button => {
button.addEventListener('click', () => {
if (currentStepModal > 0) {
currentStepModal--;
showStepModal(currentStepModal);
}
});
});
const locationInputModal = document.getElementById('location-search-modal');
const locationDropdownModal = document.getElementById('location-dropdown-modal');
const selectedLocationInputModal = document.getElementById('selected-location-modal');
if (locationInputModal && locationDropdownModal) {
const noResultsPModal = locationDropdownModal.querySelector('.no-results-modal');
const allLocationItemsModal = Array.from(locationDropdownModal.querySelectorAll('a.location-item-modal'));
locationInputModal.addEventListener('keyup', function() {
const filter = locationInputModal.value.toLowerCase();
let hasVisibleItems = false;
allLocationItemsModal.forEach(item => {
const text = item.textContent.toLowerCase();
if (text.includes(filter)) {
item.style.display = '';
hasVisibleItems = true;
} else {
item.style.display = 'none';
}
});
if (noResultsPModal) noResultsPModal.classList.toggle('hidden', hasVisibleItems);
locationDropdownModal.classList.toggle('hidden', !filter && !locationInputModal.matches(':focus'));
if (filter && locationInputModal.matches(':focus')) {
locationDropdownModal.classList.remove('hidden');
}
});
allLocationItemsModal.forEach(item => {
item.addEventListener('click', function(event) {
event.preventDefault();
locationInputModal.value = this.dataset.value;
if(selectedLocationInputModal) selectedLocationInputModal.value = this.dataset.value;
locationDropdownModal.classList.add('hidden');
});
});
locationInputModal.addEventListener('focus', () => {
if(locationInputModal.value || allLocationItemsModal.some(item => item.style.display !== 'none')) {
locationDropdownModal.classList.remove('hidden');
}
});
// Close dropdown if clicked outside
document.addEventListener('click', function(event) {
if (!locationInputModal.contains(event.target) && !locationDropdownModal.contains(event.target)) {
locationDropdownModal.classList.add('hidden');
}
});
}
window.toggleDayTimeSelectionModal = function(day) {
const checkbox = document.getElementById(`available-${day}-modal`);
const timeSelectionDiv = document.getElementById(`time-selection-${day}-modal`);
if (checkbox && timeSelectionDiv) {
if (checkbox.checked) {
timeSelectionDiv.classList.remove('hidden');
} else {
timeSelectionDiv.classList.add('hidden');
const startTimeInput = document.getElementById(`start-time-${day}-modal`);
const endTimeInput = document.getElementById(`end-time-${day}-modal`);
if(startTimeInput) startTimeInput.value = '';
if(endTimeInput) endTimeInput.value = '';
}
}
}
const dayTabButtonsModal = modalFormElement.querySelectorAll('.day-tab-button-modal');
const dayAvailabilityContentsModal = modalFormElement.querySelectorAll('.day-availability-content-modal');
function setActiveDayTabModal(targetDay) {
dayTabButtonsModal.forEach(button => {
const isTarget = button.dataset.dayTarget === targetDay;
button.classList.toggle('border-indigo-500', isTarget);
button.classList.toggle('text-indigo-600', isTarget);
button.classList.toggle('font-semibold', isTarget);
button.classList.toggle('text-gray-500', !isTarget);
button.classList.toggle('hover:border-gray-300', !isTarget);
button.classList.toggle('border-transparent', !isTarget);
});
dayAvailabilityContentsModal.forEach(content => {
content.classList.toggle('hidden', content.id !== `availability-content-${targetDay}-modal`);
});
const activeCheckbox = modalFormElement.querySelector(`#availability-content-${targetDay}-modal .day-specific-availability-toggle-modal`);
if (activeCheckbox) {
toggleDayTimeSelectionModal(targetDay);
}
}
dayTabButtonsModal.forEach(button => {
button.addEventListener('click', function () {
setActiveDayTabModal(this.dataset.dayTarget);
});
});
if (dayTabButtonsModal.length > 0) {
let initiallySelectedDayModal = dayTabButtonsModal[0].dataset.dayTarget;
for (let i = 0; i < dayAvailabilityContentsModal.length; i++) {
const content = dayAvailabilityContentsModal[i];
const checkbox = content.querySelector('.day-specific-availability-toggle-modal');
if (checkbox && checkbox.checked) {
initiallySelectedDayModal = checkbox.dataset.day;
break;
}
}
setActiveDayTabModal(initiallySelectedDayModal);
}
modalFormElement.addEventListener('submit', function(event) {
event.preventDefault();
const titleInput = document.getElementById('title-modal');
if (titleInput && titleInput.value.trim() === '') {
alert('Please enter a title for your listing.');
// showStepModal(0); // Switch to the step with the error
titleInput.focus();
return;
}
alert('Listing Submitted via Modal! (This is a demo and data is not saved.)');
// this.reset();
// showStepModal(0);
// toggleNavbar('post-modal'); // Close modal on submit
// if (typeof toggleOverlay === 'function') toggleOverlay('collapse-overlay');
});
showStepModal(currentStepModal); // Initialize the first step visibility
});
</script>
<!--end sidebar post section--> <!--end sidebar post section-->