-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
60 lines (51 loc) · 1.96 KB
/
Copy pathscript.js
File metadata and controls
60 lines (51 loc) · 1.96 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
document.addEventListener("DOMContentLoaded", function() {
// Women Popup Elements
const womenPopup = document.getElementById("women-popup");
const womenLink = document.getElementById("women-link");
const closeWomen = document.querySelector(".close-women");
// Men Popup Elements
const menPopup = document.getElementById("men-popup");
const menLink = document.getElementById("men-link");
const closeMen = document.querySelector(".close-men");
// Show Women Popup
womenLink.addEventListener("click", function(event) {
event.preventDefault();
womenPopup.style.display = "flex";
});
// Close Women Popup
closeWomen.addEventListener("click", function() {
womenPopup.style.display = "none";
});
// Show Men Popup
menLink.addEventListener("click", function(event) {
event.preventDefault();
menPopup.style.display = "flex";
});
// Close Men Popup
closeMen.addEventListener("click", function() {
menPopup.style.display = "none";
});
// Close Popups when clicking outside
window.addEventListener("click", function(event) {
if (event.target === womenPopup) {
womenPopup.style.display = "none";
}
if (event.target === menPopup) {
menPopup.style.display = "none";
}
});
});
document.addEventListener("DOMContentLoaded", function() {
let slideIndex = 0;
const slides = document.querySelectorAll(".carousel-images img");
const totalSlides = slides.length;
const carouselContainer = document.querySelector(".carousel-images");
function showNextSlide() {
slideIndex++;
if (slideIndex >= totalSlides) {
slideIndex = 0; // Reset to first slide
}
carouselContainer.style.transform = `translateX(-${slideIndex * 100}vw)`;
}
setInterval(showNextSlide, 3000); // Change image every 3 seconds
});