Files
casa-daenzo-web/dist/_astro/hoisted.DhmFiA3z.js
T

2 lines
661 B
JavaScript

import"./hoisted.jAcVTPu2.js";document.addEventListener("DOMContentLoaded",()=>{const o=document.querySelectorAll(".filter-btn"),r=document.querySelectorAll(".apartment-item");o.forEach(e=>{e.addEventListener("click",()=>{const s=e.getAttribute("data-category");o.forEach(t=>{t.classList.remove("bg-[#C85A32]","text-white","active"),t.classList.add("bg-white","text-stone-700","border","border-stone-200")}),e.classList.remove("bg-white","text-stone-700","border","border-stone-200"),e.classList.add("bg-[#C85A32]","text-white","active"),r.forEach(t=>{const a=t.getAttribute("data-type");s==="all"||a===s?t.style.display="block":t.style.display="none"})})})});