-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
151 lines (132 loc) · 5.51 KB
/
index.js
File metadata and controls
151 lines (132 loc) · 5.51 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// main mobile menu container
const mobileMenuContainer = document.createElement('nav');
mobileMenuContainer.classList.add('mobile_menu');
// cancel Icon Div..
const cancelIconDiv = document.createElement('div');
cancelIconDiv.classList.add('cancel_icon_div');
// Cancel Icon
const cancelIcon = document.createElement('img');
cancelIcon.classList.add('cancelIcon');
cancelIcon.src = 'images/cancel.png';
cancelIconDiv.appendChild(cancelIcon);
// Menu container...
const menuUl = document.createElement('ul');
menuUl.classList.add('menu_ul');
// creating menu list for mobile menu...
const menu = ['Home', 'About', 'Program', 'Join', 'Sponsor', 'News', 'GSCampign'];
menu.forEach((element) => {
const menuLiA = document.createElement('a');
menuLiA.classList.add('tdNone', 'colorWhite');
if (element === 'Home') {
menuLiA.href = 'index.html';
} else if (element === 'About') {
menuLiA.href = 'about.html';
}
const menuLi = document.createElement('li');
menuLi.classList.add('menu_li', 'lsNone');
menuLi.textContent = element;
menuLiA.appendChild(menuLi);
menuUl.appendChild(menuLiA);
});
mobileMenuContainer.appendChild(cancelIconDiv);
mobileMenuContainer.appendChild(menuUl);
const removeChild = () => {
document.body.removeChild(mobileMenuContainer);
};
document.querySelector('#navImg').addEventListener('click', () => {
document.body.appendChild(mobileMenuContainer);
document.querySelector('.cancelIcon').addEventListener('click', removeChild);
});
// Creating the data for feature sections
const speakerData = [
{
name: 'Yoachi Benkler',
image: 'speaker1.png',
authorDetail: 'Berkman Professor of Scientific computation Studies at Harvard School',
authorDescription: 'Benkler studies commons-based peer production, and published his seminal book, The Wealth of Networks in 2006',
},
{
name: 'SohYeong Noh',
image: 'speaker2.png',
authorDetail: 'Director of Art Centre Nabi and a board member of CC Korea',
authorDescription: 'As the main venue for new media art production in Korea, Nabi promotes cross-disciplinary collaboration and understanding among science technology, humanities, and the arts.',
},
{
name: 'Kilnam Chon',
image: 'speaker3.png',
authorDetail: 'Director of Art Centre Nabi and a board member of CC Korea',
authorDescription: 'Kilnam Chon helped bring the internet to Asia and is an outspoken advocate for the open web and digital com-mons. In 2012. he was inducted into the inaugural class of the Internet Society’s (ISOC) Internet Hall of Fame',
},
{
name: 'SohYeong Noh',
image: 'speaker2.png',
authorDetail: 'Director of Art Centre Nabi and a board member of CC Korea',
authorDescription: 'As the main venue for new media art production in Korea, Nabi promotes cross-disciplinary collaboration and understanding among science technology, humanities, and the arts.',
},
{
name: 'Julia Leda',
image: 'speaker1.png',
authorDetail: 'President of Young Pirates of Europe',
authorDescription: 'European ingetration, political democracy and participation of youth through online as her major condern, Reda’s report outlining potential changes to EU copyright law was approved by the Parliament in July',
},
{
name: 'Lila tretikov',
image: 'speaker2.png',
authorDetail: 'Executive Director of the Wikimedia Foundation',
authorDescription: 'Lila Tretikov is the Executive of the Wikimedia Foundation, the nonprofit organization that operates Wikipedia. Wikipedia is freely available in 290 languag-es and used by nearly half a billion people around the world every month.',
},
];
// Appending Feature to the feature section
const appendFeature = () => {
const featureSection = document.querySelector('.feature_speaker');
const featureUl = document.createElement('ul');
let count = 1;
speakerData.forEach((element) => {
featureUl.classList.add('features', 'margin0', 'padding0');
const featureLi = document.createElement('li');
featureLi.classList.add('feature');
if (count > 2) {
featureLi.classList.add('dNone', 'more_li');
}
featureLi.innerHTML = `
<div class="left_block">
<div class="feature_img"><img src="images/${element.image}" alt=""></div>
</div>
<div class="right_block">
<div class="author_name">
<h4 class="mrb5">${element.name}</h4>
</div>
<div class="author_detail">
<p class="mrt0"> ${element.authorDetail}
</p>
</div>
<div class="feature_description">
<p> ${element.authorDescription}</p>
</div>
</div>`;
featureUl.appendChild(featureLi);
count += 1;
});
featureSection.appendChild(featureUl);
};
window.addEventListener('load', appendFeature);
// Handling more button clicked..
const more = document.querySelector('.more');
const less = document.querySelector('.less');
more.addEventListener('click', () => {
const moreLi = document.querySelectorAll('.more_li');
moreLi.forEach((element) => {
element.classList.toggle('dFlex');
});
more.classList.add('dNone');
document.querySelector('.less').classList.add('dFlex');
});
// Handling less button clicked..
less.addEventListener('click', () => {
const moreLi = document.querySelectorAll('.more_li');
moreLi.forEach((element) => {
element.classList.toggle('dFlex');
});
more.classList.remove('dNone');
document.querySelector('.less').classList.remove('dFlex');
});