-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
29 lines (22 loc) · 779 Bytes
/
Copy pathscript.js
File metadata and controls
29 lines (22 loc) · 779 Bytes
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
const revealElements = document.querySelectorAll('.reveal');
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, { threshold: 0.2 });
revealElements.forEach(el => observer.observe(el));
const form = document.querySelector('form');
if (form) {
form.addEventListener('submit', function (event) {
event.preventDefault();
const nameInput = document.querySelector('#NAME');
if (nameInput.value.length < 2) {
alert("Name must be at least 2 characters.");
return;
}
alert("INFORMATION SUBMITTED SUCCESSFULLY! WE WILL CONTACT YOU SOON..!");
console.log("Thanks, " + nameInput.value + "! We'll be in touch.");
});
}