One thought on “Hello world!

Leave a Reply

Your email address will not be published. Required fields are marked *

document.addEventListener("DOMContentLoaded", function () { /*========================= SEARCH =========================*/ const search = document.getElementById("txSearch"); if (search) { search.addEventListener("keyup", function () { let value = this.value.toLowerCase(); document.querySelectorAll(".tx-table tbody tr").forEach(function (row) { row.style.display = row.innerText.toLowerCase().includes(value) ? "" : "none"; }); }); } /*========================= CATEGORY FILTER =========================*/ document.querySelectorAll(".tx-box ul li").forEach(function (item) { item.addEventListener("click", function () { document.querySelectorAll(".tx-box ul li") .forEach(el => el.classList.remove("active")); this.classList.add("active"); }); }); /*========================= GRID / TABLE =========================*/ const buttons = document.querySelectorAll(".tx-view"); buttons.forEach(function(btn){ btn.addEventListener("click",function(){ buttons.forEach(b=>b.classList.remove("active")); this.classList.add("active"); if(this === buttons[1]){ document.querySelector(".tx-table-wrap") .classList.add("tx-grid"); }else{ document.querySelector(".tx-table-wrap") .classList.remove("tx-grid"); } }); }); /*========================= MOBILE FILTER =========================*/ const filterBtn=document.querySelector(".tx-filter-btn"); if(filterBtn){ filterBtn.addEventListener("click",function(){ document.querySelector(".tx-sidebar") .classList.toggle("show"); }); } });