-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
60 lines (47 loc) · 1.71 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
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(() => { openForm(); })
$('#empty-section').mouseenter(() => { closeForm() })
$('#form-section').mouseleave(() => { closeForm() })
function openForm() {
$('#register-side-bar').css('transform', 'translate(-538px)')
$('#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 num = Number(currentValue.replace(",", ""))
num++;
num = String(num)
num = addComma(num)
$('#total-users').html(num)
setTimeout(function() {
addToTotalUsers(num)
}, getRandom(100, 2000))
}
function getRandom(max, min) {
return Math.floor(Math.random() * (max - min) + min)
}
function addComma(num) {
return num.slice(0, 3) + ',' + num.slice(3, 6)
}
})()