gallowelds.com/themes/gallo/layouts/partials/rental-catalog.html

191 lines
7.5 KiB
HTML
Raw Normal View History

<div
class="mt-8 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-4"
>
{{ range .Params.catalog }} {{ if ne .item "" }}
<div class="flex flex-col bg-white rounded-lg border p-4 relative">
<img
src="https://placehold.co/300x200/"
alt="Placeholder Image"
class="w-full h-48 rounded-md object-cover"
/>
<div class="px-1 pt-4">
<div class="flex flex-row gap-2 justify-between font-bold text-xl mb-2">
{{ .item }} {{ if ne .cat "" }}
<div>
<span
class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-full dark:bg-blue-900 dark:text-blue-300"
>{{ .cat }}</span
>
</div>
{{ end }}
</div>
<div class="text-gray-800 text-base">
{{ if ne .quant "" }}
<div class="flex flex-row justify-between">
<strong>Quantity:</strong>
<span>{{ .quant }}</span>
</div>
{{ end }} {{ if ne .dimensions "" }}
<div class="text-right flex flex-row justify-between">
<strong>Dimensions:</strong>
<span>{{ .dimensions }}</span>
</div>
{{ end }} {{ if ne .baseCost "" }}
<div class="flex flex-row justify-between">
<strong>Base Cost:</strong>
<span>{{ .baseCost }}</span>
</div>
{{ end }} {{ if ne .deliveryPickup "" }}
<div class="flex flex-row justify-between">
<strong>+ Delivery/Pickup:</strong>
<span>{{ .deliveryPickup }}</span>
</div>
{{ end }} {{ if ne .installBreakdown "" }}
<div class="flex flex-row justify-between">
<strong>+ Install/Breakdown:</strong>
<span>{{ .installBreakdown }}</span>
</div>
{{ end }} {{ if ne .purchaseCost "" }}
<div class="flex flex-row justify-between">
<strong>Purchase Cost:</strong>
<span>{{ .purchaseCost }}</span>
</div>
{{ end }}
</div>
</div>
<div class="h-full grid grid-cols-1 place-items-end pt-5">
<a class="w-full" href="#modal-{{ .item | urlize }}">
<button
type="button"
class="w-full px-3 py-2 text-xs font-medium text-center text-white bg-black rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none transition-all duration-200"
>
Expand
</button>
</a>
</div>
<div
id="modal-{{ .item | urlize }}"
class="fixed z-10 inset-0 overflow-y-auto hidden bg-gray-500 bg-opacity-75 transition-opacity"
aria-labelledby="modal-title"
role="dialog"
aria-modal="true"
>
<div
class="flex items-end justify-center min-h-screen p-4 text-center sm:block sm:p-0"
>
<div class="fixed inset-0" aria-hidden="true"></div>
<span
class="hidden sm:inline-block sm:align-middle sm:h-screen"
aria-hidden="true"
>&#8203;</span
>
<div
class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle self-center sm:max-w-lg w-full"
>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div
class="w-full mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-black sm:mx-0 sm:h-10 sm:w-10"
>
<svg
class="h-6 w-6 text-white"
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="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
</div>
<div class="w-full mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-xl mb-2" id="modal-title">
<strong>{{ .item }}</strong>
</h3>
<div class="px-1 pt-4 w-full">
<div class="text-gray-800 text-base">
{{ if ne .quant "" }}
<div class="flex flex-row justify-between">
<strong>Quantity:</strong>
<span>{{ .quant }}</span>
</div>
{{ end }} {{ if ne .dimensions "" }}
<div class="flex flex-row justify-between">
<strong>Dimensions:</strong>
<span>{{ .dimensions }}</span>
</div>
{{ end }} {{ if ne .baseCost "" }}
<div class="flex flex-row justify-between">
<strong>Base Cost:</strong>
<span>{{ .baseCost }}</span>
</div>
{{ end }} {{ if ne .deliveryPickup "" }}
<div class="flex flex-row justify-between">
<strong>Delivery/Pickup:</strong>
<span>{{ .deliveryPickup }}</span>
</div>
{{ end }} {{ if ne .installBreakdown "" }}
<div class="flex flex-row justify-between">
<strong>Install/Breakdown:</strong>
<span>{{ .installBreakdown }}</span>
</div>
{{ end }} {{ if ne .purchaseCost "" }}
<div class="flex flex-row justify-between">
<strong>Purchase Cost:</strong>
<span>{{ .purchaseCost }}</span>
</div>
{{ end }} {{ if ne .cat "" }}
<div class="flex flex-row justify-between">
<strong>Category:</strong>
<span>{{ .cat }}</span>
</div>
{{ end }}
</div>
</div>
</div>
</div>
</div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button
id="close-modal"
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-black text-base font-medium text-white hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black sm:ml-3 sm:w-auto sm:text-sm"
@click="open = false"
>
Close
</button>
</div>
</div>
</div>
</div>
</div>
{{ end }} {{ end }}
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const modalButtons = document.querySelectorAll(".grid-cols-1 a");
const closeButtons = document.querySelectorAll("#close-modal");
const modals = document.querySelectorAll(".fixed");
modalButtons.forEach((button) => {
button.addEventListener("click", function (e) {
e.preventDefault();
const modalId = this.getAttribute("href").substring(1);
const modal = document.getElementById(modalId);
modal.classList.remove("hidden");
});
});
closeButtons.forEach((button) => {
button.addEventListener("click", function (e) {
e.preventDefault();
modals.forEach((modal) => modal.classList.add("hidden"));
});
});
});
</script>