-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
104 lines (87 loc) · 3.36 KB
/
script.js
File metadata and controls
104 lines (87 loc) · 3.36 KB
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
// 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);
// 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 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");
}
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: #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 = 'transform: translateX(0vh); position:fixed;';
}
else {
menu.style = 'transform: translateX(-100%);';
}
side++;
}