-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
65 lines (57 loc) · 2.14 KB
/
Copy pathscript.js
File metadata and controls
65 lines (57 loc) · 2.14 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
var acc = document.querySelectorAll(".accordion");
acc.forEach(function(el) {
el.addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.display === "block") {
panel.style.display = "none";
} else {
panel.style.display = "block";
}
});
});
document.getElementById("showForm").addEventListener("click", function(event) {
event.preventDefault();
document.getElementById("contactForm").style.display = "block";
});
document.querySelector("form").addEventListener("submit", function(event) {
event.preventDefault();
document.getElementById("contactForm").style.display = "none";
document.getElementById("thankYouMessage").style.display = "block";
});
document.querySelectorAll('.accordion').forEach((button) => {
button.addEventListener('click', () => {
const panel = button.nextElementSibling;
panel.classList.toggle('active');
});
});
document.querySelectorAll('.nav-box').forEach((box) => {
box.addEventListener('mouseenter', () => {
box.style.width = '150px';
box.style.height = '150px';
box.style.backgroundColor = '#f30404';
box.style.fontSize = '20px';
});
box.addEventListener('mouseleave', () => {
box.style.width = '100px';
box.style.height = '100px';
box.style.backgroundColor = '#050404';
box.style.fontSize = '16px';
});
});
document.addEventListener("DOMContentLoaded", function() {
const testimonialSlides = document.querySelectorAll(".testimonial-slide");
let slideIndex = 0;
function showSlides() {
for (let i = 0; i < testimonialSlides.length; i++) {
testimonialSlides[i].classList.remove("active");
}
slideIndex++;
if (slideIndex > testimonialSlides.length) {
slideIndex = 1;
}
testimonialSlides[slideIndex - 1].classList.add("active");
setTimeout(showSlides, 3000); // Change slide every 3 seconds (adjust as needed)
}
showSlides();
});