forked from FORGEAR/carrefour
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
32 lines (31 loc) · 1.39 KB
/
script.js
File metadata and controls
32 lines (31 loc) · 1.39 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
document.addEventListener("DOMContentLoaded", function () {
// Assuming you have JSON data in a file named 'data.json'
fetch('data.json')
.then(response => response.json())
.then(data => {
const cardContainer = document.getElementById('card-container');
data.forEach(item => {
const card = document.createElement('div');
card.classList.add('col-lg-3');
card.innerHTML = `
<div class="card mb-4">
<div class="face front-face">
<img src="${item.Img_URL}" alt="" class="profile">
<div class="pt-3 text-uppercase name">
${item.GitHub_Name}
</div>
</div>
<div class="face back-face">
<span class="fas fa-quote-left"></span>
<a class="btn btn-light" href="${item.GitHub_profile}" role="button">
View Profile
</a>
<span class="fas fa-quote-right"></span>
</div>
</div>
`;
cardContainer.appendChild(card);
});
})
.catch(error => console.error('Error fetching data:', error));
});