-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.js
161 lines (141 loc) · 5.33 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// 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 + "%";
// }
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");
var w = document.getElementById("other");
function register() {
x.style.left = "-400px";
y.style.left = "50px";
z.style.left = "110px";
w.style.visibility = "hidden";
b.style.color = "#fff";
a.style.color = "#000";
}
function login() {
x.style.left = "50px";
y.style.left = "450px";
z.style.left = "0px";
w.style.visibility = "visible";
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, #0074E4, #4E91FF);';
}
else{
document.getElementById('btnSubmit').style = 'background: lightgray;';
}
}
function google() {
window.location.assign("https://accounts.google.com/signin/v2/identifier?service=accountsettings&continue=https%3A%2F%2Fmyaccount.google.com%2F%3Futm_source%3Dsign_in_no_continue&csig=AF-SEnbZHbi77CbAiuHE%3A1585466693&flowName=GlifWebSignIn&flowEntry=AddSession", "_blank");
}
// QUIZ Page
function quizt(frame) {
document.getElementById('f1').style='display: none;';
document.getElementById('f2').style='display: none;';
document.getElementById('f3').style='display: none;';
document.getElementById('f4').style='display: none;';
document.getElementById('f5').style='display: none;';
document.getElementById('f6').style='display: none;';
document.getElementById('f7').style='display: none;';
if(frame == 1) document.getElementById('f1').style = 'display: block';
else if(frame == 2) document.getElementById('f2').style = 'display: block';
else if(frame == 3) document.getElementById('f3').style = 'display: block';
else if(frame == 4) document.getElementById('f4').style = 'display: block';
else if(frame == 5) document.getElementById('f5').style = 'display: block';
else if(frame == 6) document.getElementById('f6').style = 'display: block';
else if(frame == 7) document.getElementById('f7').style = 'display: block';
else alert('error');
}
function startquiz() {
document.getElementById('title').style = 'display: none;';
document.getElementById('panel').style = 'display: inline-flex;';
document.getElementById('left').style = 'display: block;';
document.getElementById('right').style = 'display: block;';
}
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: #4E91FF; color: #FFF;';
s2.style = 'background: #4E91FF; color: #FFF;';
s3.style = 'background: #4E91FF; color: #FFF;';
s4.style = 'background: #4E91FF; color: #FFF;';
if(n==1) {
img1.style = 'display: block;';
s1.style = 'background: #E5E8EF; color: #4E91FF;';
}
if(n==2) {
img2.style = 'display: block;';
s2.style = 'background: #E5E8EF; color: #4E91FF;';
}
if(n==3) {
img3.style = 'display: block;';
s3.style = 'background: #E5E8EF; color: #4E91FF;';
}
if(n==4) {
img4.style = 'display: block;';
s4.style = 'background: #E5E8EF; color: #4E91FF;';
}
}
function sideMenu(side) {
var menu = document.getElementById('side-menu');
if(side==0) {
menu.style = 'transform: translateX(0vh); position:fixed;';
}
else {
menu.style = 'transform: translateX(-100%);';
}
side++;
}