-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
47 lines (42 loc) · 1.26 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
function init() {
const resumeEle = document.getElementById('resume');
resumeEle.onclick = () => {
window.open('./files/joseph_agnelli_resume.pdf', '_blank').focus();
};
const linkedinEle = document.getElementById('linkedin');
linkedinEle.onclick = () => {
window
.open('https://www.linkedin.com/in/joseph-agnelli-b8ba61119/', '_blank')
.focus();
};
const showResumeEle = document.getElementById('showResume');
let resumeHidden = true;
function toggleResume() {
const resume = document.getElementById('resume');
if (resumeHidden) {
showResumeEle.innerHTML = 'Hide Resume';
resume.style.display = 'block';
} else {
showResumeEle.innerHTML = 'Show Resume';
resume.style.display = 'none';
}
resumeHidden = !resumeHidden;
}
window.addEventListener('resize', () => {
if (resumeHidden && window.innerWidth > 799) {
resume.style.display = 'block';
} else if (window.innerWidth < 800) {
// when shrinking the screen sets the visibility to wherever it was before expanding
if (resumeHidden) {
showResumeEle.innerHTML = 'Show Resume';
resume.style.display = 'none';
} else {
showResumeEle.innerHTML = 'Hide Resume';
resume.style.display = 'block';
}
}
});
showResumeEle.onclick = () => {
toggleResume();
};
}