forked from hound77/jwoc-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
100 lines (88 loc) · 2.36 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
var mentee= setInterval(menteecount, 0.5);
var mentor= setInterval(mentorcount, 35);
var project= setInterval(projectcount, 35);
var college= setInterval(collegecount, 15);
let countMentee= 1;
let countMentor= 1;
let countProject= 1;
let countCollege= 1;
function menteecount(){
countMentee++;
document.querySelector(".menteeClass").innerHTML=countMentee;
if(countMentee==650){
clearInterval(mentee)
}
}
function mentorcount(){
countMentor++;
document.querySelector(".mentorClass").innerHTML=countMentor;
if(countMentor==24){
clearInterval(mentor)
}
}
function projectcount(){
countProject++;
document.querySelector(".projectClass").innerHTML=countProject;
if(countProject==24){
clearInterval(project)
}
}
function collegecount(){
countCollege++;
document.querySelector(".collegeClass").innerHTML=countCollege;
if(countCollege==75){
clearInterval(college)
}
}
let slideIndex=1;
showSlides(slideIndex);
function nextSlide() {
showSlides(slideIndex += 1);
}
function prevSlide() {
showSlides(slideIndex -= 1);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
let i;
let slides = document.getElementsByClassName("carousel-item");
let dots = document.getElementsByClassName("dot");
if (n > slides.length) {
slideIndex = 1
}
if (n < 1) {
slideIndex = slides.length
}
for (let slide of slides) {
slide.style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" activeDot", "");
}
slides[slideIndex - 1].style.display = "block";
dots[slideIndex-1].className += " activeDot";
}
var slideIndexAuto = 0;
showSlidesAuto();
function showSlidesAuto() {
var i;
var slides = document.getElementsByClassName("carousel-item");
var dots = document.getElementsByClassName("dot");
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
slideIndexAuto++;
if (slideIndexAuto > slides.length) {slideIndexAuto = 1}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" activeDot", "");
}
slides[slideIndexAuto-1].style.display = "block";
dots[slideIndexAuto-1].className += " activeDot";
setTimeout(showSlidesAuto, 5000);
}
window.addEventListener("scroll", function() {
var header = document.querySelector("header");
header.classList.toggle("sticky",window.scrollY > 0);
});