-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
48 lines (41 loc) · 1.79 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
import '../styles/globals.css'
document.addEventListener('DOMContentLoaded', function() {
// Smooth scrolling for navigation links
const navLinks = document.querySelectorAll('nav a[href^="#"]');
navLinks.forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
target.scrollIntoView({
behavior: 'smooth'
});
});
});
// Add contacts banner
console.log('Adding contacts banner...'); // Debug log
const footer = document.querySelector('footer') || document.body;
const contactsBanner = document.createElement('div');
contactsBanner.className = 'contacts-banner';
contactsBanner.innerHTML = `
<h3>Contact Our Business Solutions Team</h3>
<p>Email: [email protected]</p>
`;
footer.appendChild(contactsBanner);
console.log('Contacts banner added:', contactsBanner); // Debug log
// Form submission handling
const contactForm = document.getElementById('contact-form');
contactForm.addEventListener('submit', function(e) {
e.preventDefault();
const formData = new FormData(this);
const name = formData.get('name');
const email = formData.get('email');
const message = formData.get('message');
// Here you would typically send the form data to a server
// For this example, we'll just log it to the console
console.log('Form submitted:', { name, email, message });
// Clear the form
this.reset();
// Show a success message (you can replace this with a more user-friendly notification)
alert('Thank you for your message. We will get back to you soon!');
});
});