-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
50 lines (44 loc) · 1.49 KB
/
scripts.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
import dataConcerts from './data.js';
const btnMenu = document.getElementById('menubtn');
const menu = document.getElementById('menu');
const exitBtn = document.getElementById('exitbtn');
const menuElements = document.querySelectorAll('#mobile-menu a');
btnMenu.addEventListener('click', () => {
menu.style.display = 'flex';
btnMenu.style.display = 'none';
});
exitBtn.addEventListener('click', () => {
menu.style.display = 'none';
btnMenu.style.display = 'block';
});
for (let i = 0; i < menuElements.length; i += 1) {
menuElements[i].addEventListener('click', () => {
menu.style.display = 'none';
btnMenu.style.display = 'block';
});
}
const presenters = document.getElementById('presentations');
if (presenters) {
const printPresentations = () => {
let str = '';
for (let i = 0; i < dataConcerts.length; i += 1) {
const [a] = dataConcerts[i].imgShow;
str += `<div class="presenter">
<img class="presenter-img" src="${a}" alt="Band${i + 1}" />
<div class="presenter-info">
<h3>${dataConcerts[i].bandName}</h3>
<h4>${dataConcerts[i].bandDescription}</h4>
<div class="separator"></div>
<h5>${dataConcerts[i].bandDiscography}</h5>
</div>
</div>`;
}
return str;
};
presenters.innerHTML = `
<h2 class="presentations-title">Agrupaciones Musicales</h2>
<div class="title-separator"></div>
<div class="presentations-wraper">
${printPresentations()}
</div>`;
}