-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
62 lines (53 loc) · 1.75 KB
/
script.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
function enterSite(){
$("#landing").css("transform","translate(-200vw)");
$("#dimmed-bg").css("visibility","visible");
$("#dimmed-bg").css("transform","translate(0)");
$("#above-fold").css("opacity","1");
$("#full-site").css("visibility","visible");
$("#full-site").css("overflow","visible");
$("#full-site").css("max-height","auto");
$("#register-side-bar").css("transform","translate(0)")
}
$("#visible-section").mouseenter(function (){
openForm();
});
$("#empty-section").mouseenter(function (){
closeForm();
});
$("#form-section").mouseleave(function (){
closeForm();
});
function openForm() {
$("#register-side-bar").css("transform","translate(-650px)");
$("#register-side-bar").css("transition-delay","0s");
$("#register-side-bar").css("z-index","100");
$("#call-num").css("opacity","0");
$("#reg").css("opacity","0");
}
function closeForm() {
$("#register-side-bar").css("transform","translate(0)");
$("#register-side-bar").css("z-index","0");
$("#call-num").css("opacity","1");
$("#reg").css("opacity","1");
}
(function manageTotalUsers(){
let totalUsers = String(getRandom(100000,200000));
totalUsers = addComma(totalUsers);
addToTotalUsers(totalUsers);
function addToTotalUsers(currentValue) {
let number = Number(currentValue.replace(",",""));
number++;
number = String(number);
number = addComma(number);
$("#total-users").html(number);
setTimeout(function(){
addToTotalUsers(number);
},getRandom(100,2000));
}
function getRandom(min,max) {
return Math.floor(Math.random()*(max-min) + min);
}
function addComma(num) {
return num.slice(0,3) + "," + num.slice(3,6);
}
})();