-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
126 lines (112 loc) · 3.68 KB
/
index.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import navbar from "./exportnav.js"
document.querySelector(".nav").innerHTML = navbar();
// variable to store index
var slideIndex = 0;
// calling the function
Slides();
// creating the function which contains code to slide the images
function Slides() {
var i;
var slides = document.getElementsByClassName("Slide");
var dots = document.getElementsByClassName("circle");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
setTimeout(Slides, 2000); // Change image every 2 seconds
}
//for second slideshow
// variable to store index
var slide1Index = 0;
// calling the function
Slides1();
// creating the function which contains code to slide the images
function Slides1() {
var i;
var slides1 = document.getElementsByClassName("slide");
var dots1 = document.getElementsByClassName("circle1");
for (i = 0; i < slides1.length; i++) {
slides1[i].style.display = "none";
}
slide1Index++;
if (slide1Index > slides1.length) {slide1Index = 1}
for (i = 0; i < dots1.length; i++) {
dots1[i].className = dots1[i].className.replace(" active", "");
}
slides1[slide1Index-1].style.display = "block";
dots1[slide1Index-1].className += " active";
setTimeout(Slides1, 4000); // Change image every 4 seconds
}
// variable to store index
var slide2Index = 0;
// calling the function
Slides2();
// creating the function which contains code to slide the images
function Slides2() {
var i;
var slides2 = document.getElementsByClassName("slide1");
var dots2 = document.getElementsByClassName("circle2");
for (i = 0; i < slides2.length; i++) {
slides2[i].style.display = "none";
}
slide2Index++;
if (slide2Index > slides2.length) {slide2Index = 1}
for (i = 0; i < dots2.length; i++) {
dots2[i].className = dots2[i].className.replace(" active", "");
}
slides2[slide2Index-1].style.display = "block";
dots2[slide2Index-1].className += " active";
setTimeout(Slides2, 4000); // Change image every 4 seconds
}
// variable to store index
var slide3Index = 0;
// calling the function
Slides3();
// creating the function which contains code to slide the images
function Slides3() {
var i;
var slides3 = document.getElementsByClassName("slide2");
var dots3 = document.getElementsByClassName("circle3");
for (i = 0; i < slides3.length; i++) {
slides3[i].style.display = "none";
}
slide3Index++;
if (slide3Index > slides3.length) {slide3Index = 1}
for (i = 0; i < dots3.length; i++) {
dots3[i].className = dots3[i].className.replace(" active", "");
}
slides3[slide3Index-1].style.display = "block";
dots3[slide3Index-1].className += " active";
setTimeout(Slides3, 4000); // Change image every 4 seconds
}
import {footer} from "./footer.js"
document.querySelector(".footer").innerHTML = footer();
// vaibhav's data
let clas= document.getElementById("dill").addEventListener("click",myFunction)
let count=0
function myFunction(){
count++
console.log("triggers")
if(count===1){
document.getElementById("down").style.display="flex"
}
else if(count===2){
document.getElementById("down").style.display="none"
count=0
}
}
let cart=JSON.parse(localStorage.getItem("basket"))
let h4=document.createElement("h4")
h4.innerText=`Cart Items ${0}`
// h4.addEventListener("click",openCart)
// function openCart(){
// window.location.href="basket.html"
// }
let base=document.getElementById("ket")
base.append(h4)