forked from AshminJayson/MACE-Technical-Conference-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
417 lines (324 loc) · 16.2 KB
/
script.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
"use strict"
// Pre Loader
window.onload = () => {
let preloader = document.querySelector('#preloader-div')
preloader.classList.add('fade')
document.querySelector('body').style.overflowY = "scroll"
setTimeout(() => {
preloader.style.display = "none"
}, 1000);
}
// Responsive Navbar
const primaryNavigation = document.querySelector('.primary-navigation')
const navToggle= document.querySelector('#nav-toggle')
navToggle.addEventListener('click', () => {
const visibility = primaryNavigation.getAttribute('data-visible')
if (visibility === 'false') {
primaryNavigation.setAttribute('data-visible', 'true')
navToggle.setAttribute('aria-expanded', 'true')
}
else {
primaryNavigation.setAttribute('data-visible', 'false')
navToggle.setAttribute('aria-expanded', 'false')
}
})
const navLinks = document.querySelectorAll('.nav-link')
navLinks.forEach((navLink) => {
navLink.addEventListener('click', () => {
primaryNavigation.setAttribute('data-visible', 'false')
navToggle.setAttribute('aria-expanded', 'false')
})
})
// Sticky Navbar
window.onscroll = function() {scrollfn()}
var currentStick = document.querySelector('#hero').scrollHeight;
// Navbar button reponse
const navLinksAnchor = document.querySelectorAll('.nav-link a')
navLinksAnchor.forEach((navLink) => {
navLink.addEventListener('click', (e) => {
navLinksAnchor.forEach((anchor) => {
anchor.parentNode.classList.remove("active")
})
e.currentTarget.parentNode.className += " active"
})
})
// Navbar updation on scroll
let sections = document.querySelectorAll('section')
// console.log(sections)
window.onscroll = () => {
if (window.scrollY >= currentStick) {
primaryNavigation.classList.add("sticky")
primaryNavigation.style.backgroundColor = "#0bceff"
} else {
primaryNavigation.classList.remove("sticky")
primaryNavigation.style.backgroundColor = ""
}
let current = ""
sections.forEach((section) => {
const sectionTop = section.offsetTop;
if (scrollY >= sectionTop) {
current = section.getAttribute("id")
}
})
navLinksAnchor.forEach((anchor) => {
let link = anchor.parentNode
link.classList.remove("active")
if (link.classList.contains(current)) {
link.classList.add("active");
}
})
}
let heroButton = document.querySelector('#hero-button')
let path = "./assets/Paper Submission.pdf"
if (heroButton != null) {
heroButton.addEventListener(('click'), () => {
location.href = './callforpapers.html'
})
}
// let sections = document.querySelectorAll('section')
// Countdown Timer
const eventDate = new Date("Jun 17, 2023 08:00:00").getTime()
const countDown = setInterval(() => {
const currentDate = new Date().getTime()
const timeToEvent = eventDate - currentDate
const days = Math.floor(timeToEvent / (1000 * 60 * 60 * 24));
const hours = Math.floor((timeToEvent % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((timeToEvent % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((timeToEvent % (1000 * 60)) / 1000);
var daysContainer = document.querySelector('#days-value')
if (daysContainer != null) {
document.querySelector('#days-value').innerHTML = days
document.querySelector('#hours-value').innerHTML = hours
document.querySelector('#mins-value').innerHTML = minutes
document.querySelector('#secs-value').innerHTML = seconds
}
}, 1000);
// document.querySelector('#hero-button').addEventListener('click', () => {
// console.log('hello')
// })
// Hero Content Carousel
const n_cards = 3;
let currentIndex = 0;
let carousel = document.querySelector('#hero-content-carousel');
let cards = carousel.querySelectorAll('.hero-content')
let carouselDotsSection = document.querySelector("#hero-carousel-dots")
let carouselDots = carouselDotsSection.querySelectorAll('span')
// console.log(carouselDots)
carouselDots.forEach(dot => dot.addEventListener('click', (e) => {
activate(e.target.dataset.index);
}))
// Autocarousel
setInterval(() => {
let newIndex = currentIndex + 1
if (newIndex >= cards.length) {
newIndex = 0;
}
activate(newIndex)
currentIndex = newIndex;
}, 6000);
function activate(newIndex) {
carouselDots[currentIndex].classList.remove('active');
cards[currentIndex].classList.remove('active');
currentIndex = newIndex;
carouselDots[currentIndex].classList.add('active');
cards[currentIndex].classList.add('active');
}
// About section
let aboutContent = `<strong>International colloquium on Advances in Engineering and Technology (IC@MACE2023)</strong> is scheduled to be conducted on <italic>16<sup>th</sup> and 17<sup>th</sup> of June 2023 at Mar Athanasius College of Engineering Kothamangalam</italic>. The biennial conference is jointly organized by various departments of MACE in association with the ASME- MACE chapter. IC@MACE 2023 will be a wonderful platform for people working across various disciplines to express, share and enhance their ideas on innovative advancements in Engineering and Technology. The conference envisages a unique opportunity for researchers from around the world to interact and listen to stalwarts in various research domains.
Papers are invited to IC@MACE 2023 on topics lying within the scope of the conference. The conference will have multiple tracks in various Engineering and Management disciplines. We are expecting quality research findings coming under these tracks and will also accept inter-disciplinary research papers. Selected papers from each track will be published in Scopus Indexed International Journals.
`
let aboutSection = document.querySelector('#about-content')
if (aboutSection != null) {
aboutSection.innerHTML = aboutContent
}
// Schedule section
const buttons = document.querySelectorAll("[data-carousel-button]")
buttons.forEach(button => {
button.addEventListener("click", () => {
const offset = button.dataset.carouselButton === "next" ? 1 : -1
const slides = button
.closest("[data-carousel]")
.querySelector("[data-slides]")
const activeSlide = slides.querySelector("[data-active]")
let newIndex = [...slides.children].indexOf(activeSlide) + offset
if (newIndex < 0) newIndex = slides.children.length - 1
if (newIndex >= slides.children.length) newIndex = 0
slides.children[newIndex].dataset.active = true
delete activeSlide.dataset.active
})
})
// Tracks Section
let tracksContainer = document.querySelector('#tracks-container')
let tracks = [
{
"category": "Mechanical Engineering",
"trackName" : "Thermal Sciences and Design Engineering",
"imgUrl" : './assets/images/tracks/20191507-communicationte-48_1571835439233-jpg.jpg',
"info":"Thermal engineering is a specialized sub-discipline of mechanical engineering that deals with the movement of heat energy and transfer."
},
{
"category": "Mechanical Engineering",
"trackName" : "Materials Industrial and Manufacturing Engineering",
"imgUrl" :'./assets/images/tracks/d7fad-01-manufacturing-process-manufacturing-technology.jpg',
"info":"Materials and manufacturing engineering is highly interdisciplinary and focuses on the application of materials as well as process and production technologies in high-tech products."
},
{
"category": "Science",
"trackName" : "Nano Science",
"imgUrl" : './assets/images/tracks/wp2963735.jpg',
"info":"Nanoscience is the use of matter on an atomic, molecular, and supramolecular scale for scientific purposes."
},
{
"category": "Science",
"trackName" : "Basic Sciences",
"imgUrl" : './assets/images/tracks/66be7922881ea8c3bcb1bd40ba12a797.jpg',
"info":"Basic sciences are scientific disciplines of mathematics, physics, chemistry, and biology."
},
{
"category": "Electronics and Communications Engineering",
"trackName" : "VLSI and Embedded Systems",
"imgUrl" : './assets/images/tracks/ece.png',
"info":"Embedded systems design focuses on writing code that is implemented on a flexible piece of hardware, while VLSI focuses on translating programming instructions into a structure for an integrated circuit."
},
{
"category": "Electronics and Communications Engineering",
"trackName" : "Communication and Computer networks",
"imgUrl" : './assets/images/tracks/wp10616862.jpg',
"info":"Data communications refers to the transmission of this digital data between two or more computers and a computer network or data network is a telecommunications network that allows computers to exchange data."
},
{
"category": "Electronics and Communications Engineering",
"trackName" : "Signal Processing ",
"imgUrl" : './assets/images/tracks/SP.jpg',
"info":"Signal processing (DSP) is the use of computers or more specialized signal processors, to perform a wide variety of signal processing operations. "
},
{
"category": "Electronics and Communications Engineering",
"trackName" : "Robotics and Automation",
"imgUrl" : './assets/images/tracks/robotic-process-automation.jpg',
"info":"Industrial automation and robotics are the use of computers, control systems and information technology to handle industrial processes and machinery, replacing manual labour and improving efficiency, speed, quality and performance."
},
{
"category": "Electrical and Electronics Engineering",
"trackName" : "Power electronics, power systems and drives",
"imgUrl" : './assets/images/tracks/good-power-electronics-project-ideas.webp',
"info":"Electrical machines need drive systems to be correctly controlled, if they need to be operated at variable speed. This can be achieved by modulating the energy flow to/from them. Power electronic devices help them for this process."
},
{
"category": "Electrical and Electronics Engineering",
"trackName" : "Control and Instrumentation",
"imgUrl" : './assets/images/tracks/IC_Alausat-scaled.jpg',
"info":"Instrumentation and Control is branch of engineering that deals with measurement & control."
},
{
"category": "Electrical and Electronics Engineering",
"trackName" : "Green and sustainable Engineering",
"imgUrl" : './assets/images/tracks/sustainabilitygreenworld.jpg',
"info":"Design, commercialization, and use of processes and products in a way that reduces pollution, promotes sustainability, and minimizes risk to human health and the environment without sacrificing economic viability and efficiency."
},
{
"category": "Civil Engineering",
"trackName" : "Material and structural mechanics",
"imgUrl" : './assets/images/tracks/research-structure.jpg',
"info":"Field of applied mechanics in which you compute deformations, stresses, and strains in solid materials. Often, the purpose is to determine the strength of a structure, such as a bridge, in order to prevent damage or accidents."
},
{
"category": "Civil Engineering",
"trackName" : "Soil and water sciences",
"imgUrl" : './assets/images/tracks/sea-soil-water-sciences.jpg',
"info":"Soil and water sciences are interdisciplinary fields that focus on the study of soil, water, and their interactions in various ecosystems. They are important in understanding the natural processes that occur in the soil-water system, and how human activities impact these processes."
},
{
"category": "Computer Science and Engineering",
"trackName" : "AI and ML",
"imgUrl" : './assets/images/tracks/machine-learning.jpg',
"info":"Artificial Intelligence (AI) and Machine Learning (ML) are subsets of computer science that focus on creating algorithms and models that allow computers to perform tasks that typically require human intelligence, such as recognizing patterns, making predictions, and learning from experience."
},
{
"category": "Computer Science and Engineering",
"trackName" : "Social Network Analysis and Algorithms",
"imgUrl" : './assets/images/tracks/2013-09-15-16-45-17-1.jpg',
"info":"Social Network Analysis (SNA) is a field of study that focuses on the structure, dynamics, and behavior of social networks. It involves the collection, representation, and analysis of data about relationships and interactions among individuals or organizations in a social network. "
},
{
"category": "Computer Science and Engineering",
"trackName" : "Systems and infrastructure for the web",
"imgUrl" : './assets/images/tracks/SI.jfif',
"info":"The web is a complex system that relies on various components working together to provide users with a seamless experience. These components include hardware, software, and network infrastructure, as well as protocols and standards that define the way information is transmitted and processed over the internet."
},
{
"category": "Computer Science and Engineering",
"trackName" : "Data Analytics",
"imgUrl" : './assets/images/tracks/shutterstock_606583169.jpg',
"info":"Data analytics refers to the process of inspecting, cleaning, transforming, and modeling data with the goal of discovering useful information, suggesting conclusions, and supporting decision making."
},
]
// Track Renderer
let count = 1
tracks.forEach((track) => {
if (tracksContainer == null) {
return
}
let trackContainer = document.createElement("div")
trackContainer.classList.add("track-container")
trackContainer.classList.add("hidden")
trackContainer.setAttribute('data-visible', 'false')
if (count == 1) {
trackContainer.setAttribute('data-visible', 'true')
}
let trackHeadingContainer = document.createElement("div")
trackHeadingContainer.classList.add("track-heading-container")
let trackNumberContainer = document.createElement("div")
trackNumberContainer.classList.add("track-number-container")
trackNumberContainer.innerHTML = count
let trackHeading = document.createElement("p")
trackHeading.classList.add("track-heading")
trackHeading.innerHTML=track['trackName']
trackHeadingContainer.appendChild(trackNumberContainer)
trackHeadingContainer.appendChild(trackHeading)
let trackInfo = document.createElement("div")
trackInfo.classList.add("track-info")
trackInfo.style.backgroundImage = `url( ${track['imgUrl']})`
// console.log(trackInfo.style)
let trackInfoOverlay = document.createElement("div")
trackInfoOverlay.classList.add("track-info-overlay")
let trackInfoText = document.createElement("p")
trackInfoText.innerHTML = track['info']
trackInfoOverlay.appendChild(trackInfoText)
trackInfo.appendChild(trackInfoOverlay)
trackContainer.appendChild(trackHeadingContainer)
trackContainer.appendChild(trackInfo)
tracksContainer.appendChild(trackContainer)
count++
})
// Track Handler
const trackHeadingContainer = document.querySelectorAll('.track-heading-container')
trackHeadingContainer.forEach((track) => {
track.addEventListener('click', (e) => {
// console.log(e.target)
let trackContainer = e.target.parentNode;
if (e.target.className == 'track-heading') {
trackContainer = e.target.parentNode.parentNode
}
const currTrack = document.querySelector('[data-visible="true"]')
currTrack.setAttribute('data-visible', 'false')
// console.log(trackContainer)
trackContainer.setAttribute('data-visible', 'true')
// console.log(e.target.getBoundingClientRect())
})
})
// Intersection Observer
const hiddenElements = document.querySelectorAll('.hidden')
// console.log(hiddenElements)
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.remove('hidden')
}
})
}, {
threshold: .7
})
hiddenElements.forEach(ele => {
observer.observe(ele)
})