diff --git a/assets/js/project-wall.js b/assets/js/project-wall.js new file mode 100644 index 0000000..9dfda2e --- /dev/null +++ b/assets/js/project-wall.js @@ -0,0 +1,24 @@ +function updateProjectWall(category) { + + // Check if all projects should be shown + var showAll = category == "all"; + + // Get the wrapper element + var wallWrapper = document.getElementById("project-grid"); + + wallWrapper.querySelectorAll(".home-project").forEach((project) => { + + // Determine if the project should be shown + let types = project.dataset.types.split(","); + if (showAll || types.includes(category)){ + project.classList.remove("hidden"); + } else { + project.classList.add("hidden"); + } + + }); + + // Refresh the wall + orderProjectGrid(); + +} \ No newline at end of file diff --git a/assets/js/projects.gen.json b/assets/js/projects.gen.json new file mode 100644 index 0000000..f3836fd --- /dev/null +++ b/assets/js/projects.gen.json @@ -0,0 +1,3 @@ +--- +--- +{{site.data.projects | jsonify}} \ No newline at end of file diff --git a/index.html b/index.html index 973c593..df5b802 100644 --- a/index.html +++ b/index.html @@ -129,11 +129,27 @@ uses:
+