-
Notifications
You must be signed in to change notification settings - Fork 34
/
index.js
86 lines (57 loc) · 2.12 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
$(document).ready(function() {
$("#links").hide();
$("#menu-btn").click(changeNav);
function changeNav() {
$("#links").toggle(200);
$("#menu-btn").toggleClass("turn");
}
});
$(document).ready(function() {
let number = parseInt($('.pull').text(), 10) || 0;
let interval = setInterval(function() {
$('.pull').text(number++);
if (number > 100000) {
clearInterval(interval);
}
}, 300);
});
$(document).ready(function() {
let number2 = parseInt($('.comp').text(), 10) || 0;
let interval2 = setInterval(function() {
$('.comp').text(number2++);
if (number2 > 100000) {
clearInterval(interval2);
}
}, 200);
});
//Countdown
(function () {
const second = 1000,
minute = second * 60,
hour = minute * 60,
day = hour * 24,
deadline = "Oct 31, 2020 23:59:59";
let countDown = new Date(deadline).getTime(),
x = setInterval(function() {
let now = new Date().getTime(),
distance = countDown - now;
document.getElementById("days").innerText = Math.floor(distance / (day)),
document.getElementById("hours").innerText = Math.floor((distance % (day)) / (hour)),
document.getElementById("minutes").innerText = Math.floor((distance % (hour)) / (minute)),
document.getElementById("seconds").innerText = Math.floor((distance % (minute)) / second);
//do something later when date is reached
if (distance < 0) {
let countdown = document.getElementById("countdown"),
finishmessage = document.getElementById("finishmessage");
countdown.style.display = "none";
finishmessage.style.display = "block";
clearInterval(x);
}
//seconds
}, 0)
}());
// To make the Statistics section scrollable on Clicking in Navbar
$("a").click(function(){
var pageId = $(this).attr("data-page");
$("html, body").animate({ scrollTop: $("#"+pageId).offset().top }, 1000);
});