-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
60 lines (53 loc) · 2.32 KB
/
Copy pathscript.js
File metadata and controls
60 lines (53 loc) · 2.32 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
document.addEventListener('DOMContentLoaded', function() {
// Back to top button functionality
const backToTopButton = document.getElementById('backToTop');
if (backToTopButton) {
window.addEventListener('scroll', function() {
if (window.scrollY > 300) {
backToTopButton.style.display = 'flex';
} else {
backToTopButton.style.display = 'none';
}
});
backToTopButton.addEventListener('click', function(e) {
e.preventDefault();
window.scrollTo({ top: 0, behavior: 'smooth' });
});
}
// Resume button functionality
const viewResumeButton = document.getElementById('viewResume');
const resumeModal = document.getElementById('resumeModal');
const closeModal = document.querySelector('.close-modal');
const resumeFrame = document.getElementById('resumeFrame');
// Resume PDF URL - replace with your actual resume URL
const resumeUrl = "path/to/your/resume.pdf";
if (viewResumeButton && resumeModal) {
// Open modal when View Resume button is clicked
viewResumeButton.addEventListener('click', function() {
resumeFrame.src = resumeUrl;
resumeModal.style.display = 'block';
document.body.style.overflow = 'hidden'; // Prevent scrolling while modal is open
});
// Close modal when X is clicked
if (closeModal) {
closeModal.addEventListener('click', function() {
resumeModal.style.display = 'none';
document.body.style.overflow = 'auto'; // Re-enable scrolling
});
}
// Close modal when clicking outside of it
window.addEventListener('click', function(event) {
if (event.target === resumeModal) {
resumeModal.style.display = 'none';
document.body.style.overflow = 'auto'; // Re-enable scrolling
}
});
// Close modal with Escape key
document.addEventListener('keydown', function(event) {
if (event.key === 'Escape' && resumeModal.style.display === 'block') {
resumeModal.style.display = 'none';
document.body.style.overflow = 'auto'; // Re-enable scrolling
}
});
}
});