-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmasterclasses.js
41 lines (33 loc) · 2.19 KB
/
masterclasses.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
document.addEventListener("DOMContentLoaded", function () {
const masterclassesContainer = document.getElementById('masterclassesInMasterclasses');
function displayMasterclasses(masterclasses, container) {
masterclasses.forEach(masterclass => {
const masterclassElement = document.createElement('div');
masterclassElement.className = 'masterclass-container wow fadeInUp';
masterclassElement.setAttribute('data-wow-delay', '0.1s');
masterclassElement.innerHTML = `
<div class="masterclass-image">
<img src="${masterclass.courseId? courses[masterclass.courseId].image: 'img/masterclass-default.jpg'}" alt="${masterclass.name}">
<div class="masterclass-title">${masterclass.fee == 0? 'Free': 'Ksh. '+masterclass.fee}</div>
</div>
<div class="masterclass-details">
<h5>${masterclass.name}</h5>
<p>${masterclass.description}</p>
<div class="info"><strong>Instructor:</strong> ${masterclass.instructor}</div>
<div class="price"><strong>Fee:</strong> Ksh. ${masterclass.fee}</div>
<div class="date"><strong>Date:</strong> ${masterclass.date}</div>
<div class="info"><strong>Time:</strong> ${masterclass.time}</div>
<div class="info"><strong>Duration:</strong> ${masterclass.duration}</div>
<div class="info"><strong>Venue:</strong> ${masterclass.venue}</div>
<div class="info"><strong>Target Audience:</strong> ${masterclass.targetAudience}</div>
<div class="info"><strong>Requirements:</strong> ${masterclass.requirements}</div>
<div class="info"><strong>Benefits:</strong> ${masterclass.benefits}</div>
<a href="masterclass-enroll.html?masterclass=${masterclass.id}" class="btn btn-primary mt-3">Join Masterclass</a>
</div>
`;
container.appendChild(masterclassElement);
});
}
// Call the function to display all masterclasses
displayMasterclasses(masterclasses, masterclassesContainer);
});