Spaces:
Running
Running
File size: 999 Bytes
8ad38af |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
const projectsArray = document.getElementById('projects-gallery');
function addProjectCard(projectObject) {
const projectCard = document.createElement('article');
projectCard.className = "content-card";
projectCard.id = `project-${projectName}`;
projectCard.appendChild(Object.assign(document.createElement('h3'), {textContent: projectObject["title-short"], className: "card-title"}));
projectCard.appendChild(Object.assign(document.createElement('p'), {textContent: projectObject.abstract, className: "card-abstract"}));
const badges = Object.assign(document.createElement('div'), {className: "badges"});
for (tag of projectObject.tags) {
badges.appendChild(Object.assign(document.createElement('span'), {className: `badge ${tag}`, textContent: tag}));
}
projectCard.appendChild(badges);
projectsArray.appendChild(projectCard);
}
for (projectName of projects) {
fetchAndParseYAML(`resources/projects/${projectName}.yaml`, addProjectCard);
}
|