-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
316 lines (296 loc) · 11.9 KB
/
Copy pathmain.js
File metadata and controls
316 lines (296 loc) · 11.9 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
document.addEventListener(
"DOMContentLoaded",
async () => {
loadSkillsPage();
loadProjectsPage();
loadResearchPage();
},
false
);
function loadSkillsPage() {
var skills = [
{ name: "C", image: "https://raw.githubusercontent.com/devicons/devicon/master/icons/c/c-original.svg" },
{ name: "C++", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/cplusplus/cplusplus-original.svg" },
{ name: "Java", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/java/java-original.svg" },
{ name: "Python", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/python/python-original.svg" },
{ name: "HTML", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original.svg" },
{ name: "CSS", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/css3/css3-original.svg" },
{ name: "JavaScript", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/javascript/javascript-plain.svg" },
{ name: "ReactJs", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/react/react-original.svg" },
{ name: "AngularJs", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/angularjs/angularjs-original.svg" },
{ name: "NodeJs", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/nodejs/nodejs-original.svg" },
{ name: "ExpressJs", image: "./assets/express.png" },
{ name: "MongoDB", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/mongodb/mongodb-original-wordmark.svg" },
{ name: "Matlab", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/matlab/matlab-original.svg" },
{ name: "Git", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/git/git-original.svg" },
{ name: "GitHub", image: "./assets/github.png" },
{ name: "Discord.js", image: "./assets/discord.png" },
{ name: "VS Code", image: "./assets/vs_code.svg" },
{ name: "Manjaro", image: "https://user-images.githubusercontent.com/63140632/145705669-2050df14-6b64-44a9-aa66-dd62bafb4936.png" },
{ name: "NextJs", image: "https://user-images.githubusercontent.com/63140632/159057943-66bda3ce-5f77-41e7-814e-fc57f6e3540a.svg" },
{ name: "SASS", image: "https://user-images.githubusercontent.com/63140632/159058821-9e2c882c-b0cd-4248-9ec5-5f87c32e4f3c.svg" },
{ name: "JQuery", image: "https://user-images.githubusercontent.com/63140632/138343999-b14291bb-a436-47c8-8b6e-8e27843f2228.png" },
{ name: "Tailwind", image: "https://user-images.githubusercontent.com/63140632/155379705-ba343eb1-9336-49ed-8cb2-14e476320433.svg" },
{ name: "MySQL", image: "https://cdn.jsdelivr.net/gh/devicons/devicon/icons/mysql/mysql-original-wordmark.svg" },
{ name: "IntelliJ", image: "https://user-images.githubusercontent.com/63140632/159059401-30767299-0aff-471b-a4d5-f0cf1b740902.svg" },
{ name: "Figma", image: "https://user-images.githubusercontent.com/63140632/159059723-a6c20188-ea00-45b0-a930-fbcf1a4e804d.svg" },
];
var allSkills = document.getElementById("all-skills");
for (var i = 0; i < skills.length; i++) {
var element = document.createElement("div");
element.classList.add("skill-card");
element.innerHTML = `
<img src="${skills[i].image}" alt="${skills[i].name}">
<p>${skills[i].name}</p>
`;
allSkills.appendChild(element);
}
}
function loadProjectsPage() {
projects = [
{
title: "ADG-VIT Official Website",
image: "./assets/adg-official.png",
description:
"The official website of Apple Developers Group, VIT Technical Club. Built using ReactJs and various npm packages.",
deploy: "https://adgvit.com",
repo: "https://github.com/ADG-VIT/ADG-VIT-Website",
},
{
title: "DC Official Website",
image: "./assets/dc-official.png",
description:
"Contributing to and maintaining the official website for Design and Code built using ReactJs.",
deploy: "",
repo: "https://github.com/csivitu/CCS-Frontend-2022",
},
{
title: "Core Committee Selections",
image: "./assets/ccs-csivit.png",
description:
"The official website for Core Committee Selections for CSI-VIT built using MERN stack.",
deploy: "",
repo: "https://github.com/csivitu/CCS-Frontend-2022",
},
{
title: "Otôbus",
image: "./assets/otobus.png",
description:
"A MEAN Stack project for Bus Management System having features like view, book and cancel buses.",
deploy: "https://designandcode.us",
repo: "https://github.com/Design-and-Code/Design-and-Code",
},
{
title: "Riddler Frontend 2021",
image: "./assets/riddler.png",
description:
"Frontend of Riddler game website made using ReactJs framework and various npm packages.",
deploy: "https://riddler-sample.vercel.app/",
repo: "https://github.com/csivitu/riddler-frontend-2021",
},
{
title: "LaserTag Frontend 2021",
image: "./assets/lasertag.png",
description:
"Frontend of LaserTag Slot Booking Portal made using ReactJs framework.",
deploy: "",
repo: "https://github.com/csivitu/LaserTag-Frontend",
},
{
title: "CMS 2021",
image: "./assets/cms.png",
description:
"A contact management system built using MySQL and JavaFX.",
deploy: "",
repo: "https://github.com/nimishjn/contact-management-system-mysql-javafx",
},
{
title: "Portfolio Website",
image: "./assets/portfolio.png",
description:
"Portfolio website to display my skills, projects, research work, etc built using HTML, CSS and JavaScript.",
deploy: "https://www.nimish-jain.com/",
repo: "https://github.com/nimishjn/portfolio/",
},
{
title: "Links",
image: "./assets/links.png",
description: "Used to host all my skills and links in one website.",
deploy: "https://links.nimish-jain.com/",
repo: "https://github.com/nimishjn/links/",
},
];
var allProjects = document.getElementById("all-projects");
for (var i = 0; i < projects.length; i++) {
var element = document.createElement("div");
element.classList.add("project-card");
element.innerHTML = `
<img src="${projects[i].image}" alt="${projects[i].title}">
<h2>${projects[i].title}</h2>
<p>${projects[i].description}</p>
<div class="project-buttons">
${
projects[i].deploy !== ""
? `<a id="deploy-button" href="${projects[i].deploy}" target="_blank"><i class="fas fa-eye"></i> View</a>`
: ``
}
${
projects[i].repo !== ""
? `<a href="${projects[i].repo}" id="code-button" target="_blank"><i class="fas fa-file-code"></i> Code</a>`
: ``
}
</div>
`;
allProjects.appendChild(element);
}
}
function loadResearchPage() {
researchProfiles = [
{
name: "ORCID iD",
logo: "<i class='fab fa-orcid'></i>",
link: "https://orcid.org/0000-0001-9607-0764",
},
{
name: "Google Scholar",
logo: "<i class='fas fa-graduation-cap'></i>",
link: "https://scholar.google.com/citations?user=oKBKRQ0AAAAJ&hl=en",
},
{
name: "ResearchGate",
logo: "<i class='fab fa-researchgate'></i>",
link: "https://www.researchgate.net/profile/Nimish-Jain-4",
},
{
name: "Publons",
logo: "<i class='fas fa-file-powerpoint'></i>",
link: "https://publons.com/researcher/4167049/nimish-jain/",
},
{
name: "SciProfiles",
logo: "<i class='fas fa-graduation-cap'></i>",
link: "https://sciprofiles.com/profile/1689275",
},
];
var allResearchProfiles = document.getElementById("all-research-profiles");
for (var i = 0; i < researchProfiles.length; i++) {
var element = document.createElement("a");
element.rel = "noreferrer noopener";
element.href = `${researchProfiles[i].link}`;
element.target = "_blank";
element.innerHTML = `
<div class="research-card">
${researchProfiles[i].logo}
<p>${researchProfiles[i].name}</p>
<i class="fas fa-angle-right"></i>
</div>
`;
allResearchProfiles.appendChild(element);
}
researchPapers = [
{
title:
"Modeling of Predictable Variations in Multi-Time Instant Ambient Temperature Time Series",
link: "https://ieeexplore.ieee.org/document/9404497",
logo: "<i class='fas fa-file-alt'></i>",
},
{
title:
"Performance Comparison of Two Statistical Parametric Methods for Outlier Detection and Correction",
link: "https://www.sciencedirect.com/science/article/pii/S2405896321014919",
logo: "<i class='fas fa-file-alt'></i>",
},
{
title:
"New Performance Evaluation Metrics for Outlier Detection and Correction",
link: "https://link.springer.com/chapter/10.1007/978-981-16-9033-4_63",
logo: "<i class='fas fa-file-alt'></i>",
},
];
var allResearchPapers = document.getElementById("all-research-papers");
for (var i = 0; i < researchPapers.length; i++) {
var element = document.createElement("a");
element.rel = "noreferrer noopener";
element.href = `${researchPapers[i].link}`;
element.target = "_blank";
element.innerHTML = `
<div class="research-card">
${researchPapers[i].logo}
<p>${researchPapers[i].title}</p>
<i class="fas fa-angle-right"></i>
</div>
`;
allResearchPapers.appendChild(element);
}
}
function darkModeSwitch() {
var element = document.getElementById("dark-mode-switch");
setTimeout(function () {
element.style.opacity = 0;
setTimeout(function () {
if (element.name == "dark") {
element.innerHTML = '<i class="fas fa-sun"></i>';
element.name = "light";
document.documentElement.style.setProperty(
"--background1",
"var(--white1)"
);
document.documentElement.style.setProperty(
"--background2",
"var(--white2)"
);
document.documentElement.style.setProperty("--text", "var(--black1)");
document.documentElement.style.setProperty(
"--navbar",
"var(--navbar-light)"
);
} else {
element.innerHTML = '<i class="fas fa-moon"></i>';
element.name = "dark";
document.documentElement.style.setProperty(
"--background1",
"var(--black1)"
);
document.documentElement.style.setProperty(
"--background2",
"var(--black2)"
);
document.documentElement.style.setProperty("--text", "var(--white1)");
document.documentElement.style.setProperty(
"--navbar",
"var(--navbar-dark)"
);
}
element.style.opacity = 1;
}, 250);
});
}
function openNavbar() {
var nav = document.getElementById("mobile-navbar");
nav.style.transform = "translateX(-200px)";
}
function closeNavbar() {
var nav = document.getElementById("mobile-navbar");
nav.style.transform = "translateX(0px)";
}
const scriptURL =
"https://script.google.com/macros/s/AKfycbxhd-eQtInVaoQ_hWsLtgQSt7oEXjMMUkASrd2k-gObhuGQZx9STGuh_kX13yE9lLeVrA/exec";
const form = document.forms["say-hi-form"];
form.addEventListener("submit", (e) => {
e.preventDefault();
fetch(scriptURL, { method: "POST", body: new FormData(form) })
.then((response) => notification("Your message has been received!"))
.catch((error) => notification("Some error occured on form submit!"));
form.reset();
});
async function notification(message) {
const element = document.createElement("div");
element.id = "notification";
element.innerHTML = `
<h1>${message}</h1>
`;
document.querySelector("body").appendChild(element);
setTimeout(() => {
document.querySelector("body").removeChild(element);
}, 5000);
}