-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
40 lines (31 loc) · 1.27 KB
/
app.js
File metadata and controls
40 lines (31 loc) · 1.27 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
// ANIMATED MENU BUTTON
// holds a reference to the html elelment with id mobile menu
const menu = document.querySelector('#mobile-menu')
// holds a reference to the html element with class navbar menu
const menuLinks = document.querySelector('.navbar__menu')
// Used to create a responsive menu that changes when clicked
// deactivates thenavbar when mobile menu is opened
// deactivates mobile menu when the X is clicked
// Activates one, deactivates the other
menu.addEventListener('click', function() {
menu.classList.toggle('is-active');
menuLinks.classList.toggle('active');
});
// Fetch Navigation Text
fetch('Text Files/navigation.txt')
.then(response => response.text())
.then(data => {
document.getElementById('navigation').textContent = data;
})
// Fetch CV Text
fetch('Text Files/CV.txt')
.then(response => response.text())
.then(data => {
document.getElementById('CV').textContent = data;
})
// Fetch Publications Text
fetch('Text Files/Publications.txt')
.then(response => response.text())
.then(data => {
document.getElementById('Publications').textContent = data;
})