-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
98 lines (91 loc) · 3.21 KB
/
main.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
const mobileMenu = document.querySelector('.mobile-menu');
const navList = document.querySelector('.nav-list');
mobileMenu.addEventListener('click', () => {
mobileMenu.classList.toggle('active');
navList.classList.toggle('active');
});
document.querySelectorAll('.nav-link').forEach((nav) => nav.addEventListener('click', () => {
mobileMenu.classList.remove('active');
navList.classList.remove('active');
}));
// dynamic speaker section
const projectSection = document.querySelector('.speakers-list');
const myArray = [
{
image: 'images/user-male.png',
name: 'Simon Kimani',
work: 'Bekman Profesor of Enterprenurial'
+ 'Legal Studies at Harvard Law School.',
description: 'Wikipedia is provided'
+ 'free of charge in 290 languages every month to'
+ 'over 100 million people, nearly half of the'
+ 'world\'s population.',
},
{
image: 'images/user-female.png',
name: 'Moses Mwikali',
work: 'Diretor of Center Nabi and a board'
+ 'menber of CC Korea',
description: 'He led open'
+ 'source projects at the Mozilla Foundation and'
+ 'joined CC as CEO in 2014.',
},
{
image: 'images/user-male.png',
name: 'Lilian Miller',
work: 'Exercutive Director of Wikipedia Foundation',
description: 'Focusing on a'
+ 'collaborative approach in a networked environment,'
+ 'he created the concept of co-production based on sharing,'
+ 'such as open source software and Wikipedia.',
},
{
image: 'images/user-male.png',
name: 'Sam Wakanda',
work: 'CEO of laik technology in Egypt',
description: 'As the author'
+ 'of <Digital Art Art of Our Time>,'
+ 'he opened \'Art Center Nabi\', Korea\'s first digital'
+ 'art institution, in 2000, and is currently serving.',
},
{
image: 'images/user-female.png',
name: 'Tyson Tailer',
work: 'Founder and CEO of Utumishi supper market',
description: 'European integration'
+ 'and online youth participation in politics and'
+ 'democracy are major concerns, and a report has'
+ 'been published that will potentially affect the'
+ 'revision of the EU\'s copyright law in July',
},
{
image: 'images/user-male.png',
name: 'Stacy Atieno',
work: 'Manager at Unity bank',
description: 'Layla Tretikov is the general'
+ 'secretary of the Wikimedia Foundation,'
+ 'a non-profit organization that runs Wikipedia.',
},
];
const displayProjects = ({
image, name, work, description,
}) => {
const div = document.createElement('div');
div.className = 'speaker-list-items';
div.innerHTML = `
<div class="speaker-photo"><img src="${image}" alt="" class="speaker-image"> </div>
<div class="speaker-info">
<div class="speaker-name">${name} </div>
<div class="speaker-position"> ${work} </div>
<div class="peaker-positon-def">${description} </div>
</div>
</div>
`;
return (div);
};
const getProjects = () => {
myArray.forEach((myObjects, index) => {
projectSection.append(displayProjects(myObjects, index));
});
};
getProjects();