-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
50 lines (29 loc) · 1.15 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
document.addEventListener('DOMContentLoaded', function() {
const downloadBtn = document.getElementById('downloadResumeBtn');
downloadBtn.addEventListener('click', function() {
const resumePath = "C:\Users\Administrator\Desktop\PORTFOLIO\MyResume.pdf";
const anchor = document.createElement('a');
anchor.href = resumePath;
anchor.download = 'MyResume.pdf';
anchor.click();
});
});
document.getElementById('contactForm').addEventListener('submit', function(e) {
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
if (!name || !email) {
e.preventDefault();
alert('Please fill in all fields');
}
});
document.addEventListener('scroll', function() {
const button = document.getElementById('backToTop');
if (window.scrollY > 300) {
button.style.display = 'block';
} else {
button.style.display = 'none';
}
});
document.getElementById('backToTop').addEventListener('click', function() {
window.scrollTo({ top: 0, behavior: 'smooth' });
});