Dwelling/homepage/static/assets/js/mindflow.js

12 lines
365 B
JavaScript
Raw Normal View History

const articles = document.getElementsByTagName("article");
document.getElementById("filter").classList.remove("hidden");
function filter(e) {
for (const a of articles)
a.classList.toggle("hidden",
!(e.target.name === "all" || a.id.startsWith(e.target.name)));
}
for (const b of document.getElementsByTagName("button"))
b.addEventListener("click", filter);