diff --git a/filter.js b/filter.js index a219b8d..27a8626 100644 --- a/filter.js +++ b/filter.js @@ -1,41 +1,54 @@ +let allProjects = []; + document.addEventListener('DOMContentLoaded', () => { document.getElementById('tech-fields').addEventListener('change', updateTechStack); document.getElementById('tech-stack').addEventListener('change', filterProjects); - axios.get('projects.json') .then(response => { - const projects = response.data; + allProjects = response.data; const projectsGrid = document.getElementById('projects-grid'); - projectsGrid.innerHTML = ''; - - projects.forEach(project => { - const projectCard = document.createElement('div'); - projectCard.classList.add('col-md-4', 'col-sm-6', 'col-12', 'mb-4', 'project'); - projectCard.setAttribute('data-tech-field', project.techField); - projectCard.setAttribute('data-tech-stack', project.techStack); - projectCard.innerHTML = ` -