-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
34 lines (23 loc) · 1.04 KB
/
script.js
File metadata and controls
34 lines (23 loc) · 1.04 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
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
function sendEmail(event) {
event.preventDefault();
const name = document.getElementById('uniqueName').value;
const email = document.getElementById('uniqueEmail').value;
const message = document.getElementById('uniqueMessage').value;
const subject = `Contact Us Form Submission from ${name}`;
const body = `Name: ${name}\nEmail: ${email}\n\nMessage:\n${message}`;
window.location.href = `mailto:mahmudulabin@gmail.com?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
}
function toggleMenu() {
const navLinks = document.querySelector('.nav-links');
const menuToggle = document.querySelector('.menu-toggle');
navLinks.classList.toggle('active'); // Toggle the navigation menu
menuToggle.classList.toggle('active'); // Rotate the hamburger icon
}