forked from eliakimceleste/Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
107 lines (83 loc) · 3.47 KB
/
index.js
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Members data displaying
document.addEventListener('DOMContentLoaded', function() {
fetch('members.json')
.then(response => response.json())
.then(data => {
const teamContainer = document.getElementById('team-container');
data.forEach(member => {
const card = document.createElement('div');
card.className = 'team-card';
const img = document.createElement('img');
img.src = member.image;
img.alt = member.name;
const name = document.createElement('h3');
name.textContent = member.name;
const title = document.createElement('h4');
title.textContent = member.title;
const description = document.createElement('p');
description.textContent = member.description;
const socialLinks = document.createElement('div');
socialLinks.className = 'social-links';
if (member.social.linkedin) {
const linkedin = document.createElement('a');
linkedin.href = member.social.linkedin;
linkedin.target = '_blank';
const linkedinImg = document.createElement('img');
linkedinImg.src = 'ressources/images/LinkedIn_logo_initials.png';
linkedinImg.alt = 'LinkedIn';
linkedin.appendChild(linkedinImg);
socialLinks.appendChild(linkedin);
}
if (member.social.instagram) {
const instagram = document.createElement('a');
instagram.href = member.social.instagram;
instagram.target = '_blank';
const instagramImg = document.createElement('img');
instagramImg.src = 'ressources/images/Instagram_icon.png.webp';
instagramImg.alt = 'Instagram';
instagram.appendChild(instagramImg);
socialLinks.appendChild(instagram);
}
if (member.social.github) {
const github = document.createElement('a');
github.href = member.social.github;
github.target = '_blank';
const githubImg = document.createElement('img');
githubImg.src = 'ressources/images/Github.png';
githubImg.alt = 'GitHub';
github.appendChild(githubImg);
socialLinks.appendChild(github);
}
card.appendChild(img);
card.appendChild(name);
card.appendChild(title);
card.appendChild(description);
card.appendChild(socialLinks);
teamContainer.appendChild(card);
});
})
.catch(error => console.error('Error fetching team data:', error));
});
// Form submission for sponsor page
document.addEventListener('DOMContentLoaded', function() {
emailjs.init("YOUR_USER_ID"); // Remplacez "YOUR_USER_ID" par votre ID utilisateur EmailJS
const contactForm = document.getElementById('contact-form');
contactForm.addEventListener('submit', function(event) {
event.preventDefault();
const formData = {
firstName: contactForm.firstName.value,
lastName: contactForm.lastName.value,
subject: contactForm.subject.value,
email: contactForm.email.value,
message: contactForm.message.value
};
emailjs.send("YOUR_SERVICE_ID", "YOUR_TEMPLATE_ID", formData)
.then(function(response) {
document.getElementById('status').textContent = "Message envoyé avec succès!";
contactForm.reset();
}, function(error) {
document.getElementById('status').textContent = "Erreur lors de l'envoi du message.";
console.error("Error:", error);
});
});
});