-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
147 lines (127 loc) · 8.49 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
window.onload = function() {
(function go() {
window.onscroll = function() {
let scrolled = window.pageYOffset || document.documentElement.scrollTop;
let screenPoint = [],
pageWidth = document.documentElement.clientWidth;
if(pageWidth >= 1900) {
screenPoint[0] = 1400;
screenPoint[1] = 1600;
screenPoint[2] = 1900;
screenPoint[3] = 2100;
screenPoint[4] = 2400;
screenPoint[5] = 2600;
screenPoint[6] = 2900;
} else if (pageWidth >= 1024 && pageWidth < 1920) {
screenPoint[0] = 1300;
screenPoint[1] = 1500;
screenPoint[2] = 1700;
screenPoint[3] = 1900;
screenPoint[4] = 2200;
screenPoint[5] = 2400;
screenPoint[6] = 2700;
} else if (pageWidth >= 320 && pageWidth < 1024) {
screenPoint[0] = 700;
screenPoint[1] = 900;
screenPoint[2] = 1100;
screenPoint[3] = 1300;
screenPoint[4] = 1600;
screenPoint[5] = 1800;
screenPoint[6] = 2100;
}
if (scrolled > screenPoint[0]) {
document.getElementsByClassName('way-vertical start')[0].style = "background-position: 0 -100%;";
document.getElementsByClassName('processing')[0].style = "transform: rotate(-300deg);";
}
if (scrolled > screenPoint[1] && scrolled < screenPoint[1] + 600) {
if(!document.querySelector('.good-history').offsetWidth && !document.querySelector('.good-history').offsetHeight &&
!document.querySelector('.bad-history').offsetWidth && !document.querySelector('.bad-history').offsetHeight) {
document.getElementsByClassName('dark')[0].style = "display: block;";
document.getElementsByClassName('good-button')[0].style = "animation: 0.45s history-choise;";
document.getElementsByClassName('bad-button')[0].style = "animation: 0.45s 0.4s history-choise;";
}
} else {
document.getElementsByClassName('dark')[0].style = "display: none;";
}
document.getElementById("good-history").onclick = function() {
document.getElementsByClassName('dark')[0].style = "display: none;";
}
document.getElementById("bad-history").onclick = function() {
document.getElementsByClassName('dark')[0].style = "display: none;";
}
if (scrolled > screenPoint[2]) {
document.getElementsByClassName('way-vertical start')[1].style = "background-position: 0 -100%;";
document.getElementsByClassName('check-check-img')[0].style = "transform: scale(1);";
document.getElementsByClassName('way-vertical first')[2].style = "background-position: 0 -100%;";
document.getElementsByClassName('quarter-circle-top-left')[0].style = "background-position: 100% 0;";
document.getElementsByClassName('way-horizontal left')[3].style = "background-position: 100% 0;";
document.getElementsByClassName('check-bad-check-img')[0].style = "transform: scale(1);";
} else {
document.getElementsByClassName('way-vertical start')[1].style = "transition-delay: 0.2s;background-position: 0 0;";
document.getElementsByClassName('check-check-img')[0].style = "transition-delay: 0s;transform: scale(0);";
document.getElementsByClassName('check-bad-check-img')[0].style = "transition-delay: 0s;transform: scale(0);";
document.getElementsByClassName('way-horizontal left')[3].style = "transition-delay: 0.2s;background-position: 0 0;";
document.getElementsByClassName('quarter-circle-top-left')[0].style = "transition-delay: 0.4s;background-position: 0 0;";
document.getElementsByClassName('way-vertical first')[2].style = "transition-delay: 0.6s;background-position: 0 0;";
}
if (scrolled > screenPoint[3]) {
document.getElementsByClassName('way-horizontal right first')[0].style = "background-position: -100% 0";
document.getElementsByClassName('quarter-circle-bottom-left first')[0].style = "background-position: 0 0";
document.getElementsByClassName('way-vertical first')[1].style = "background-position: 0 -100%";
document.getElementsByClassName('check-min-img')[0].style = "transform: scale(1);";
} else {
document.getElementsByClassName('check-min-img')[0].style = "transition-delay: 0s;transform: scale(0);";
document.getElementsByClassName('way-vertical first')[1].style = "transition-delay: 0.2s;background-position: 0 0;";
document.getElementsByClassName('quarter-circle-bottom-left first')[0].style = "transition-delay: 0.4s; background-position: 100% 0;";
document.getElementsByClassName('way-horizontal right first')[0].style = "transition-delay: 0.6s;background-position: 0 0;";
}
if (scrolled > screenPoint[4]) {
document.getElementsByClassName('way-horizontal left second')[0].style = "background-position: 100% 0";
document.getElementsByClassName('quarter-circle-bottom-right first')[0].style = "background-position: 100% 0";
document.getElementsByClassName('way-vertical second')[1].style = "background-position: 0 -100%";
document.getElementsByClassName('check-bank-img')[0].style = "transform: scale(1);";
document.getElementsByClassName('check-search-bank-img')[1].style = "transform: scale(1);";
document.getElementsByClassName('way-vertical first')[3].style = "background-position: 0 -100%";
document.getElementsByClassName('way-vertical first')[4].style = "background-position: 0 -100%";
document.getElementsByClassName('check-case-img')[0].style = "transform: scale(1);";
} else {
document.getElementsByClassName('check-bank-img')[0].style = "transition-delay: 0s;transform: scale(0);";
document.getElementsByClassName('way-vertical second')[1].style = "transition-delay: 0.2s;background-position: 0 0;";
document.getElementsByClassName('quarter-circle-bottom-right first')[0].style = "transition-delay: 0.4s;background-position: 0 0;";
document.getElementsByClassName('way-horizontal left second')[0].style = "transition-delay: 0.6s;background-position: 0 0;";
document.getElementsByClassName('check-case-img')[0].style = "transition-delay: 0s;transform: scale(0);";
document.getElementsByClassName('check-search-bank-img')[1].style = "transition-delay: 0s;transform: scale(0);";
document.getElementsByClassName('way-vertical first')[3].style = "transition-delay: 0.2s;background-position: 0 0";
document.getElementsByClassName('way-vertical first')[4].style = "transition-delay: 0.2s;background-position: 0 0";
}
if (scrolled > screenPoint[5]) {
document.getElementsByClassName('way-horizontal right third')[0].style = "background-position: -100% 0";
document.getElementsByClassName('quarter-circle-bottom-left second')[0].style = "background-position: 0 0";
document.getElementsByClassName('way-vertical third')[0].style = "background-position: 0 -100%";
document.getElementsByClassName('check-search-bank-img')[0].style = "transform: scale(1);";
document.getElementsByClassName('way-vertical second')[2].style = "background-position: 0 -100%";
document.getElementsByClassName('way-vertical second')[3].style = "background-position: 0 -100%";
} else {
document.getElementsByClassName('check-search-bank-img')[0].style = "transition-delay: 0s;transform: scale(0);";
document.getElementsByClassName('way-vertical third')[0].style = "transition-delay: 0.2s;background-position: 0 0;";
document.getElementsByClassName('quarter-circle-bottom-left second')[0].style = "transition-delay: 0.4s;background-position: 100% 0;";
document.getElementsByClassName('way-horizontal right third')[0].style = "transition-delay: 0.6s;background-position: 0 0;";
document.getElementsByClassName('way-vertical second')[2].style = "background-position: 0 0";
document.getElementsByClassName('way-vertical second')[3].style = "background-position: 0 0";
}
if (scrolled > screenPoint[6]) {
document.getElementsByClassName('way-horizontal fourth')[0].style = "background-position: 100% 0";
document.getElementsByClassName('quarter-circle-bottom-right third')[0].style = "background-position: 100% 0";
document.getElementsByClassName('way-vertical fourth')[0].style = "background-position: 0 -100%";
} else {
document.getElementsByClassName('way-vertical fourth')[0].style = "transition-delay: 0s;background-position: 0 0;";
document.getElementsByClassName('quarter-circle-bottom-right third')[0].style = "background-position: 0 0;";
document.getElementsByClassName('way-horizontal fourth')[0].style = "transition-delay: 0.4s;background-position: 0 0;";
}
}
})();
$('.video').click(function() {
let video = '<iframe src="'+ $(this).attr('data-video') +'"></iframe>';
$(this).parent().html(video);
});
}