-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
75 lines (52 loc) · 2.19 KB
/
script.js
File metadata and controls
75 lines (52 loc) · 2.19 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const date = document.getElementById('date')
const setCurrentYear = () => {
const currentYear = new Date().getFullYear()
date.textContent = currentYear
}
// hamburger menu
const hamburger = document.querySelector('.hamburger')
const navList = document.querySelector('.nav-list')
const socials = document.querySelector('.social-nav')
const navLinks = document.querySelectorAll('.nav-links')
const toggleMobileMenu = () => {
hamburger.classList.toggle('open')
navList.classList.toggle('open')
socials.classList.toggle('open')
document.body.classList.toggle('open')
}
navLinks.forEach((link) => link.addEventListener('click', toggleMobileMenu))
hamburger.addEventListener('click', toggleMobileMenu)
// initialize aos (library for scroll animation)
AOS.init()
setCurrentYear()
function resumeOpen(){
window.open("https://drive.google.com/file/d/18PaqyIZnAlLtWPgIfLiSl6eWJ1Xx5cv6/view?usp=share_link");
}
// ------------------------------ Not working --------------------
// document.getElementById('contact-form').addEventListener('submit', function(event) {
// event.preventDefault();
// // Get form values
// var name = document.getElementById('name').value;
// var email = document.getElementById('email').value;
// var message = document.getElementById('message').value;
// console.log(name, email, message);
// // Data object to be sent to Formspree
// var data = {
// name: name,
// email: email,
// message: message
// };
// // Send the data to Formspree
// var xhr = new XMLHttpRequest(); // Create new XMLHttpRequest object
// xhr.open('POST', 'https://formspree.io/f/xeqwybww'); // A Formspree endpoint URL
// xhr.setRequestHeader('Content-Type', 'application/json'); // Content-Type header
// xhr.onload = function() {
// if (xhr.status === 200) { // If server status was ok
// alert('Form submission successful!');
// document.getElementById('contact-form').reset(); // Clear the form
// } else { // If server status was not ok
// alert('Form submission failed. Please try again later.');
// }
// };
// xhr.send(JSON.stringify(data)); // Send the data as JSON
// });