-
Notifications
You must be signed in to change notification settings - Fork 0
/
galery.js
49 lines (49 loc) · 1.75 KB
/
galery.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
"use strict";
var countDownDate = new Date("Apr 29, 2022 00:00:00").getTime();
var x = setInterval(function () {
var now = new Date().getTime();
var distance = countDownDate - now;
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
let countdown = document.getElementById("countdown");
if (countdown != null) {
countdown.innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s ";
}
if (distance < 0) {
clearInterval(x);
if (countdown != null) {
countdown.innerHTML = "Šťastné výročie parkouru!!!";
}
}
}, 1000);
var slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
var i;
var slides = document.getElementsByClassName("invisible-slides");
if (document.title === "Galéria parkouru") {
var dots = document.getElementsByClassName("slideshow-dot");
if (n > slides.length) {
slideIndex = 1;
}
if (n < 1) {
slideIndex = slides.length;
}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" slideshow-dot_active", "");
}
slides[slideIndex - 1].style.display = "block";
dots[slideIndex - 1].className += " slideshow-dot_active";
}
}