-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
94 lines (74 loc) · 2.69 KB
/
index.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
let prevScrollpos = window.pageYOffset;
window.onscroll = function () {
let currentScrollPos = window.pageYOffset;
if (prevScrollpos > currentScrollPos) {
document.getElementById("nav").style.top = "0";
document.getElementById("right").style.top = "100";
document.getElementById("ham").style.top = "0";
} else {
document.getElementById("nav").style.top = "-100px";
document.getElementById("right").style.top = "0";
document.getElementById("ham").style.top = "-100";
}
prevScrollpos = currentScrollPos;
};
let TransitionEvent = () => {
let workOn = document.querySelector("body");
workOn.style.opacity = 1;
};
let workOn = document.getElementById("aboutSection");
workOn.addEventListener("pointerover", () => {
document.getElementById("aboutSection").style.opacity = 1;
});
let scrolledOn = () => {
let workOn = document.getElementById("aboutSection");
workOn.style.opacity = 1;
};
let removeAttr = () => {
if (checkBox.checked) {
checkBox.checked = false;
}
};
let checkBox = document.getElementById("checkBox");
let about = document.querySelector("#about");
let work = document.querySelector("#work").addEventListener("click", removeAttr);
let contact = document.querySelector("#contact").addEventListener("click", removeAttr);
let resume = document.querySelector("#resumeIn").addEventListener("click", removeAttr);
let skill = document.querySelector("#skill").addEventListener("click", removeAttr);
about.addEventListener("click", removeAttr);
new GitHubCalendar(".calendar", "gaurav7ingh");
let arr = ["Contact Me", "Email", "Linked In"];
setInterval(() => {
let text = document.getElementById("btn1").innerText;
switch (text) {
case "Contact Me":
document.getElementById("btn1").innerText = arr[1];
break;
case "Email":
document.getElementById("btn1").innerText = arr[2];
break;
case "Linked In":
text = document.getElementById("btn1").innerText = arr[0];
break;
default:
break;
}
}, 2000);
let btn = document.getElementById("btn1");
btn.addEventListener("click", () => {
let res = btn.innerText;
if (res == "Contact Me" || res == "Email") {
location.href = "mailto:[email protected]";
} else if (res == "Linked In") {
location.href = "https://www.linkedin.com/in/gaurav-singh0/";
}
});
function submitForm() {
let frm = document.getElementById("my_form");
frm.submit(); // Submit the form
frm.reset(); // Reset all form data
return false; // Prevent page refresh
}
function download() {
window.open("./source/Gaurav_Singh_Resume.pdf","_blank");
}