feat: add CSS styles and JavaScript functionality for projects and scenarios, including filtering and layout enhancements
This commit is contained in:
19
static/js/projects.js
Normal file
19
static/js/projects.js
Normal file
@@ -0,0 +1,19 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const table = document.querySelector("[data-project-table]");
|
||||
if (!table) {
|
||||
return;
|
||||
}
|
||||
|
||||
const rows = Array.from(table.querySelectorAll("tbody tr"));
|
||||
const filterInput = document.querySelector("[data-project-filter]");
|
||||
|
||||
if (filterInput) {
|
||||
filterInput.addEventListener("input", () => {
|
||||
const query = filterInput.value.trim().toLowerCase();
|
||||
rows.forEach((row) => {
|
||||
const match = row.textContent.toLowerCase().includes(query);
|
||||
row.style.display = match ? "" : "none";
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user