-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathscript.js
More file actions
253 lines (252 loc) · 7.38 KB
/
script.js
File metadata and controls
253 lines (252 loc) · 7.38 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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
function accept_cookie() {
(notify_va.style.padding = "0vw 0vw"),
(notify_va.style.opacity = "0"),
(notify_va.style.zIndex = "-1");
}
function deccept_cookie() {
(notify_va.style.zIndex = "100"),
(notify_va.style.padding = "1.8vw 1vw"),
(notify_va.style.opacity = "1");
}
function notify(e, l) {
(not_con.innerHTML = e),
deccept_cookie(),
-1 != l &&
setTimeout(function () {
accept_cookie();
}, l);
}
var login_error_list = [
"Error !",
"Invalid email !",
"Wrong Credentials, Try again !",
"Try again..",
];
function login_error(e = null) {
e && notify(login_error_list[e], 3e3);
}
function popstasticopener(
e = "/",
l = "Takshashila Google Authentication",
n = "height=600,width=450"
) {
var a = window.open(e, l, n);
window.focus && a.focus();
}
function password_eye() {
onload = function () {
let e = document.getElementById("passwordEye"),
l = document.getElementById("password_input");
e.onclick = function (e) {
let n = "password" === l.getAttribute("type") ? "text" : "password";
l.setAttribute("type", n), this.classList.toggle("fa-eye-slash");
};
var n = document.getElementById("password_input"),
a = document.getElementById("passwordEye");
n.addEventListener(
"input",
function () {
a.style.display = "block";
},
{ passive: !0 }
),
(n.onblur = function () {
"" == this.value && (a.style.display = "none");
});
};
}
function validatePassword() {
let e = document.getElementById("password"),
l = document.getElementById("repassword");
e.value != l.value
? (l.setCustomValidity("Password Does Not Match !"),
console.log("Password Does Not Match !"))
: l.setCustomValidity("");
}
function set_deafult_graduation_date() {
let e = document.getElementById("graduate_year"),
l = new Date(),
n = ("0" + (l.getMonth() + 1)).slice(-2),
a = l.getFullYear();
e.value = `${a + 3}-${n}`;
}
function getCookie(e) {
let l = e + "=",
n = decodeURIComponent(document.cookie).split(";");
for (let a = 0; a < n.length; a++) {
let s = n[a];
for (; " " == s.charAt(0); ) s = s.substring(1);
if (0 == s.indexOf(l)) return s.substring(l.length, s.length);
}
return "";
}
function load_hash() {
var e = getCookie("hash");
return (document.getElementById("hash").value = e), e;
}
function load_details() {
load_hash();
var e = getCookie("first_name");
document.getElementById("first_name").value = e;
var l = getCookie("last_name");
document.getElementById("last_name").value = l;
var n = getCookie("phone");
document.getElementById("ph_number").value = n;
}
function load_date(e = !1) {
var l = new Date().getFullYear();
let n = l + 8;
var a = document.getElementById("graduate_year");
for (i = l - 8; i < n; i++) a.add(new Option(i));
!0 == e && (a.selectedIndex = 12);
}
function sign_in_check(e) {
h = getCookie("hash");
var l = getCookie("session");
if ((console.log(h && l), h))
switch (e) {
case 0:
window.location.replace("/");
break;
case 1:
getCookie("user_details") && window.location.replace("/"),
window.location.replace("/login");
}
else 0 === e && window.location.replace("/login");
}
function get_acc() {
(t = getCookie("hash")) &&
((top_link.innerHTML = "Account"), (top_link.href = "/profile/" + t));
}
function profile_edit(e) {
var l = document.getElementById(e);
(l.disabled = !1), (l.readOnly = !1), l.focus();
var n = l.nextElementSibling.firstElementChild;
n.classList.remove("fa-edit"), n.classList.add("fa-save");
}
function profile_onblur(e, l) {
(e.disabled = !0), (e.readOnly = !0), e.value || (e.value = l);
var n = e.nextElementSibling.firstElementChild;
n.classList.remove("fa-save"), n.classList.add("fa-edit");
}
function single_page_login(e) {
let l = document.getElementById("regi");
1 == e
? ((l.style.transform = "translate(-50%, 100%) scale(0)"),
window.history.pushState(
"page2",
"Title",
"/Takshashila-2023-Web-Design/login.html"
))
: ((l.style.transform = "translate(-50%, -52%) scale(1)"),
window.history.pushState(
"page2",
"Title",
"/Takshashila-2023-Web-Design/login.html#/signup"
));
}
var slideIndex = 1;
function plusSlides(e) {
showSlides((slideIndex += e));
}
function currentSlide(e) {
showSlides((slideIndex = e));
}
function showSlides(e) {
var l,
n = document.getElementsByClassName("locac"),
a = document.getElementsByClassName("dot");
for (
e > n.length && (slideIndex = 1), e < 1 && (slideIndex = n.length), l = 0;
l < n.length;
l++
)
n[l].style.display = "none";
for (l = 0; l < a.length; l++)
a[l].className = a[l].className.replace(" current", "");
(n[slideIndex - 1].style.display = "block"),
(a[slideIndex - 1].className += " current"),
1 == e
? (document.getElementById("Loconn").innerHTML = "Location")
: (document.getElementById("Loconn").innerHTML = "Contact");
}
function myFunction(e) {
e >= 200 ? myvid.classList.add("blur") : myvid.classList.remove("blur");
}
function nav_hide(e) {
let l = e;
prevScrollpos > l
? (document.getElementById("navbar").style.top = "89%")
: (document.getElementById("navbar").style.top = "100%"),
(prevScrollpos = l);
}
function fly_in(e, l) {
l ? e.classList.add("fly_in") : e.classList.remove("fly_in");
}
function lin() {
let e = $(".card_l");
$(".day_l").addClass("l_in"), e.addClass("l_in");
}
function l_in(e, l) {
lin();
}
function r_in(e, l) {
let n = $(".card_r"),
a = $(".day_r");
l && (a.addClass("l_in"), n.addClass("l_in")), lin();
}
function opa_rev(e, l) {
l ? e.classList.add("fade_rot") : e.classList.remove("fade_rot");
}
function fade_opaci(e, l) {
l ? e.classList.add("opaci") : e.classList.remove("opaci");
}
function splash_pop(e, l) {
l && e.classList.add("splash_slide");
}
function callbackRouter(e, l) {
let n = e[0],
a = n.target;
n.intersectionRatio > 0
? a.dataset.callback &&
(window[a.dataset.callback](a, !0),
"true" == a.dataset.once && (a.classList.remove("jos"), l.unobserve(a)))
: a.dataset.callback && window[a.dataset.callback](a, !1);
}
function graphic() {
1 == graphic_high
? ((graphic_high = 0),
(myvid.style.display = "none"),
// (image4.style.display = "block"),
// (image3.style.display = "block"),
// (image9.style.display = "block"),
(pro_sec.style.background = "#131313"),
ripple.classList.remove("rypol"),
notify("Acrylic Theme Deactivated !", 3e3))
: ((graphic_high = 1),
(myvid.style.display = "block"),
// (image4.style.display = "none"),
// (image3.style.display = "none"),
// (image9.style.display = "none"),
(pro_sec.style.background = "transparent"),
ripple.classList.add("rypol"),
notify("Acrylic Theme Activated !", 3e3));
}
(onload = function () {
showSlides(slideIndex);
}),
(onload = function () {
document.getElementById("image4"),
document.getElementById("image3"),
document.getElementById("image9"),
document.getElementById("pro_sec"),
document.getElementById("ripple");
}),
"serviceWorker" in navigator
? navigator.serviceWorker
.register("service-worker.js")
.then((e) => {})
.catch((e) => {
console.log("SW Registration Failed");
})
: console.log("Not supported");