-
Notifications
You must be signed in to change notification settings - Fork 5
/
script.js
134 lines (115 loc) · 3.81 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
// Changing the style of scroll bar
// window.onscroll = function() {myFunction()};
// function myFunction() {
// var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
// var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
// var scrolled = (winScroll / height) * 100;
// document.getElementById("myBar").style.width = scrolled + "%";
// }
// $('.close').on('click', function () {
// $('.form-box').hide();
// });
function scrollAppear() {
var introText = document.querySelector('.side-text');
var sideImage = document.querySelector('.sideImage');
var introPosition = introText.getBoundingClientRect().top;
var imagePosition = sideImage.getBoundingClientRect().top;
var screenPosition = window.innerHeight / 1.2;
if(introPosition < screenPosition) {
introText.classList.add('side-text-appear');
}
if(imagePosition < screenPosition) {
sideImage.classList.add('sideImage-appear');
}
}
window.addEventListener('scroll', scrollAppear);
// For switching between navigation menus in mobile mode
var i = 2;
function switchTAB() {
var x = document.getElementById("list-switch");
if(i%2 == 0) {
document.getElementById("list-switch").style= "display: grid; height: 50vh; margin-left: 5%;";
document.getElementById("search-switch").style= "display: block; margin-left: 5%;";
}else {
document.getElementById("list-switch").style= "display: none;";
document.getElementById("search-switch").style= "display: none;";
}
i++;
}
// For LOGIN
var x = document.getElementById("login");
var y = document.getElementById("register");
var z = document.getElementById("btn");
var a = document.getElementById("log");
var b = document.getElementById("reg");
function register() {
x.style.left = "-400px";
y.style.left = "50px";
z.style.left = "110px";
b.style.color = "#fff";
a.style.color = "#000";
}
function login() {
x.style.left = "50px";
y.style.left = "450px";
z.style.left = "0px";
a.style.color = "#fff";
b.style.color = "#000";
}
// CheckBox Function
function goFurther(){
if (document.getElementById("chkAgree").checked == true) {
document.getElementById('btnSubmit').style = 'background: linear-gradient(to right, #FA4B37, #DF2771);';
}
else{
document.getElementById('btnSubmit').style = 'background: lightgray;';
}
}
function searchdisplay() {
document.getElementById('searchpanel').style.display="block";
}
function display(n) {
var img1 = document.getElementById('img1');
var img2 = document.getElementById('img2');
var img3 = document.getElementById('img3');
var img4 = document.getElementById('img4');
var s1 = document.getElementById('s1');
var s2 = document.getElementById('s2');
var s3 = document.getElementById('s3');
var s4 = document.getElementById('s4');
img1.style = 'display: none;';
img2.style = 'display: none;';
img3.style = 'display: none;';
img4.style = 'display: none;';
s1.style = 'background: #DF2771; color: #FFF;';
s2.style = 'background: #DF2771; color: #FFF;';
s3.style = 'background: #DF2771; color: #FFF;';
s4.style = 'background: #DF2771; color: #FFF;';
if(n==1) {
img1.style = 'display: block;';
s1.style = 'background: #E5E8EF; color: #DF2771;';
}
if(n==2) {
img2.style = 'display: block;';
s2.style = 'background: #E5E8EF; color: #DF2771;';
}
if(n==3) {
img3.style = 'display: block;';
s3.style = 'background: #E5E8EF; color: #DF2771;';
}
if(n==4) {
img4.style = 'display: block;';
s4.style = 'background: #E5E8EF; color: #DF2771;';
}
}
function sideMenu(side) {
var menu = document.getElementById('side-menu');
if(side==0) {
menu.style.visibility = "visible";
menu.style = 'transition: .8s; transform: translateX(0vh); position:fixed;';
}
else {
menu.style = 'transform: translateX(-100%);';
}
side++;
}