-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
61 lines (51 loc) · 1.85 KB
/
Copy pathscript.js
File metadata and controls
61 lines (51 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
async function carregarProjetos() {
try {
const projects = await import('./projects.js');
const projetos = projects.default;
const container = document.getElementById('projetos-container');
container.innerHTML = ''; // Limpa o container
projetos.forEach(projeto => {
console.log(projeto);
const card = criarCardProjeto(projeto);
container.appendChild(card);
});
} catch (error) {
console.error('Erro ao carregar projetos:', error);
}
}
// Criar o HTML do card de projeto
function criarCardProjeto(projeto) {
const card = document.createElement('div');
card.className = 'projeto-card';
// Criar título
const titulo = document.createElement('h3');
titulo.className = 'projeto-titulo';
titulo.textContent = projeto.titulo;
// Criar descrição
const descricao = document.createElement('p');
descricao.className = 'projeto-descricao';
descricao.textContent = projeto.descricao;
// Criar container de tecnologias
const tecnologiasDiv = document.createElement('div');
tecnologiasDiv.className = 'projeto-tecnologias';
projeto.tecnologias.forEach(tech => {
const tag = document.createElement('span');
tag.className = 'tech-tag';
tag.textContent = tech;
tecnologiasDiv.appendChild(tag);
});
// Criar link
const link = document.createElement('a');
link.href = projeto.link;
link.target = '_blank';
link.className = 'projeto-link';
link.innerHTML = '<i class="fa-brands fa-github"></i> Ver no GitHub';
// Montar o card
card.appendChild(titulo);
card.appendChild(descricao);
card.appendChild(tecnologiasDiv);
card.appendChild(link);
return card;
}
// Carregar projetos quando a página carregar
carregarProjetos();