Skip to content

Commit

Permalink
Display des filtres à continuer
Browse files Browse the repository at this point in the history
  • Loading branch information
rezozero59 committed Aug 16, 2023
1 parent 38da376 commit d8d11d7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions FrontEnd/travaux.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,33 @@ fetchWorks().then((works) => {
(item) => item.category.name === categoryName
);

function displayWorks(worksToDisplay) {
// Supprimez les projets existants
while (sectionProjet.firstChild) {
sectionProjet.removeChild(sectionProjet.firstChild);
}

const sectionProjet = document.querySelector(".projets");

filteredWorks.forEach((projet) => {
const projetFigure = document.createElement("figure");

const projetImg = document.createElement("img");
projetImg.src = projet.imageUrl;

const projetCaption = document.createElement("figcaption");
projetCaption.innerText = projet.title;

projetFigure.appendChild(projetImg);
projetFigure.appendChild(projetCaption);
sectionProjet.appendChild(projetFigure);
});
}

console.log(filteredWorks);
}
});
});

// displayWorks(works);
// displayWorks(filteredWorks);

0 comments on commit d8d11d7

Please sign in to comment.