-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
64 lines (53 loc) · 1.63 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const hamburguer = document.querySelector(".hamburguer");
const navMenu = document.querySelector(".nav-menu");
const navLink = document.querySelectorAll(".nav-link");
const backgroundImg = document.querySelector(".background-img");
const h1 = document.querySelector(".text h1");
const p = document.querySelector(".text p");
const span = document.querySelector(".text h1 span");
const buttonHome = document.querySelector(".text button");
hamburguer.addEventListener("click", handleMobileMenu);
function handleMobileMenu() {
hamburguer.classList.toggle("active");
navMenu.classList.toggle("active");
}
navLink.forEach((element) => {
element.addEventListener("click", closeMenu);
});
function closeMenu() {
hamburguer.classList.remove("active");
navMenu.classList.remove("active");
}
// Section Head
function img(anything) {
backgroundImg.src = anything;
h1.style.color = "white";
span.style.color = "#9D89FA";
p.style.backgroundColor = "rgba(255, 255, 255, 0.7)";
buttonHome.style.backgroundColor = "rgba(255, 255, 255, 0.8)";
navLink.forEach((element) => {
element.style.color = "#9D89FA";
});
// navLink.forEach((element) => {
// element.style.color = "white";
// });
}
function change(change) {
const line = document.querySelector(".image");
line.style.background = change;
}
/*----------------Carrosel-----------------------*/
const swiper = new Swiper(".swiper", {
cssMode: true,
loop: true,
// If we need pagination
// pagination: {
// el: ".swiper-pagination",
// },
// Navigation arrows
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
Keyboard: true,
});