-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
281 lines (235 loc) · 10.7 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
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
const input = document.querySelector('input');
document.addEventListener('keydown', function(e) {
if (e.keyCode === 13 && input.value) {
var node = document.createElement("DIV");
node.style.color = "#888";
node.style.fontSize = "1.5vw";
node.style.paddingLeft = '5px';
const typeWriter = (text, element) => {
let i = 0;
const typing = () => {
if (i < text.length) {
element.innerHTML += text.charAt(i);
i++;
setTimeout(typing, 20);
}
};
typing();
};
if (input.value === 'help') {
const para = document.createElement("p");
para.style.display = 'block';
const text = 'rishabhchopda@rc9 ~ % Supported commands: about, clear, publications, projects, skills, contact, services';
typeWriter(text, para);
// Set the command label
document.querySelector(".commands").appendChild(para);
} else if (input.value === 'about') {
const para = document.createElement("p");
const lineBreak9 = document.createElement("br");
para.appendChild(lineBreak9);
para.style.display = 'block';
const text0 = "rishabhchopda@rc9 ~ % About Me: ";
const text1 = "Extremely motivated to constantly develop my skills and grow professionally.";
const text2 = " I am a passionate technologist with a keen eye for detail and precision. I excel in meticulously designing and implementing robust automation systems using Python, ensuring precision in execution and delivering exceptional performance.";
const text3 = " Skilled in languages like C, JavaScript, Python and SQL, I apply my knowledge to practical projects, transforming ideas into effective solutions. Currently, I work at Deloitte, where I leverage my background in computer engineering and passion for technology to drive innovation and make a positive impact.";
const text = `${text0}\n\n${text1}${text2}${text3}`;
document.querySelector(".commands").appendChild(para);
const typeWriter = (text, element) => {
let i = 0;
const typing = () => {
if (i < text.length) {
if (text.charAt(i) === '\n') {
element.appendChild(document.createElement("br"));
} else {
element.innerHTML += text.charAt(i);
}
i++;
setTimeout(typing, 20);
}
};
typing();
};
typeWriter(text, para);
}else if (input.value === 'contact') {
const para = document.createElement("p");
const lineBreak9 = document.createElement("br");
para.appendChild(lineBreak9);
para.style.display = 'block';
const link1 = document.createElement("a");
link1.href = '#';
link1.style.color = '#888';
link1.style.textDecoration = 'none';
const text1 = "rishabhchopda@rc9 ~ % Let's Connect Over:";
typeWriter(text1, link1);
para.appendChild(link1);
const lineBreak0 = document.createElement("br");
para.appendChild(lineBreak0);
const lineBreak1 = document.createElement("br");
para.appendChild(lineBreak1);
const link2 = document.createElement("a");
link2.href = 'https://wa.link/qoc7x2';
link2.style.color = '#fff';
const text2 = 'Whatsapp';
typeWriter(text2, link2);
para.appendChild(link2);
const lineBreak2 = document.createElement("br");
para.appendChild(lineBreak2);
const link3 = document.createElement("a");
link3.href = 'mailto:rishabhchopda79@gmail.com';
link3.style.color = '#fff';
const text3 = 'Email';
typeWriter(text3, link3);
para.appendChild(link3);
const lineBreak3 = document.createElement("br");
para.appendChild(lineBreak3);
const link4 = document.createElement("a");
link4.href = 'https://www.linkedin.com/in/rishabh-chopda-16b378151/';
link4.style.color = '#fff';
const text4 = 'Linkedin';
typeWriter(text4, link4);
para.appendChild(link4);
document.querySelector(".commands").appendChild(para);
} else if (input.value === 'skills') {
const para = document.createElement("p");
const lineBreak9 = document.createElement("br");
para.appendChild(lineBreak9);
para.style.display = 'block';
para.style.width = '100%';
para.style.wordWrap = 'break-word';
const skills = ['rishabhchopda@rc9 ~ % I Work Well With :',"- Python (Flask, Pandas, Selenium, PyAutoGUI, Scrapy, Beautiful Soup)", "- HTML", "- CSS", "- JS", "- PHP", "- SQL", "- C Language"];
for (let i = 0; i < skills.length; i++) {
const text = skills[i];
const skillPara = document.createElement("p");
skillPara.style.margin = '0';
typeWriter(text, skillPara);
para.appendChild(skillPara);
}
document.querySelector(".commands").appendChild(para);
} else if (input.value === 'services') {
const para = document.createElement("p");
const lineBreak9 = document.createElement("br");
para.appendChild(lineBreak9);
para.style.display = 'block';
para.style.width = '100%';
para.style.wordWrap = 'break-word';
const services = ['rishabhchopda@rc9 ~ % Services at a Glance :',"- Task Scheduling and Workflow Automation", "- Excel Automation", "- Web Scraping and Crawling", "- Telegram and Discord BOTs Development", "- Document Generation and Processing", "- Bot Detection Bypass and IP Rotations", "- Test Automation"];
for (let i = 0; i < services.length; i++) {
const text = services[i];
const servicePara = document.createElement("p");
servicePara.style.margin = '0';
typeWriter(text, servicePara);
para.appendChild(servicePara);
}
document.querySelector(".commands").appendChild(para);
} else if (input.value === 'projects') {
// Fetch the repositories from GitHub API
fetch('https://api.github.com/users/rishabhc9/repos?sort=created')
.then(response => response.json())
.then(data => {
// Sort repositories by creation date (latest first)
const repos = data.sort((a, b) => new Date(b.created_at) - new Date(a.created_at));
// Display repositories on the webpage
const para = document.createElement("p");
const lineBreak9 = document.createElement("br");
para.appendChild(lineBreak9);
para.style.display = 'block';
if (repos.length > 0) {
const text = ' rishabhchopda@rc9 ~ % Latest GitHub repositories: ↑';
typeWriter(text, para);
repos.slice(0, 5).forEach(repo => {
const repoName = document.createElement("span");
repoName.style.fontWeight = 'bold';
repoName.innerText = repo.name;
const repoDescription = document.createElement("span");
repoDescription.style.color = '#888';
repoDescription.innerText = repo.description || 'No description';
const repoLink = document.createElement("a");
repoLink.href = repo.html_url;
repoLink.target = '_blank';
repoLink.style.textDecoration = 'none';
repoLink.style.color = '#0366d6';
repoLink.innerText = 'View on GitHub';
const repoEntry = document.createElement("p");
repoEntry.appendChild(repoName);
repoEntry.appendChild(document.createElement("br"));
repoEntry.appendChild(repoDescription);
repoEntry.appendChild(document.createElement("br"));
repoEntry.appendChild(repoLink);
repoEntry.style.marginBottom = '10px';
para.appendChild(repoEntry);
});
} else {
const text = ' rishabhchopda@rc9 ~ % No GitHub repositories found.';
typeWriter(text, para);
}
document.querySelector(".commands").appendChild(para);
})
.catch(error => {
console.error('Error:', error);
});
}
else if (input.value === 'clear') {
const commandsContainer = document.querySelector(".commands");
while (commandsContainer.firstChild) {
commandsContainer.removeChild(commandsContainer.firstChild);
}
} else if (input.value === 'cls') {
const commandsContainer = document.querySelector(".commands");
while (commandsContainer.firstChild) {
commandsContainer.removeChild(commandsContainer.firstChild);
}
}
else if (input.value === 'publications') {
// Fetch publications from ORCID API
fetch('https://pub.orcid.org/v3.0/0000-0003-4840-8673/works', {
headers: {
Accept: 'application/json',
},
})
.then(response => response.json())
.then(data => {
console.log(data); // Log the API response to examine its structure
const publications = data.group;
// Display publications on the webpage
const para = document.createElement("p");
const lineBreak9 = document.createElement("br");
para.appendChild(lineBreak9);
para.style.display = 'block';
if (publications && publications.length > 0) {
const text = ' rishabhchopda@rc9 ~ % My publications: ↑';
typeWriter(text, para);
publications.forEach(group => {
const workSummaries = group['work-summary'];
workSummaries.forEach(work => {
const title = work.title.title?.value || 'Untitled';
const journal = work['journal-title']?.value || 'Unknown Journal';
const year = work['publication-date']?.year?.value || 'Unknown Year';
const publicationEntry = document.createElement("p");
publicationEntry.innerHTML = `<strong>${title}</strong><br>${journal}, ${year}`;
publicationEntry.style.marginBottom = '10px';
para.appendChild(publicationEntry);
});
});
} else {
const text = ' rishabhchopda@rc9 ~ % No publications found.';
typeWriter(text, para);
}
document.querySelector(".commands").appendChild(para);
})
.catch(error => {
console.error('Error:', error);
});
}
else {
const para = document.createElement("p");
para.style.display = 'block';
const text = 'rishabhchopda@rc9 ~ % command not found: ' + input.value;
typeWriter(text, para);
document.querySelector(".commands").appendChild(para);
}
input.value = "";
}
});
function f() {
document.querySelector('input').focus();
}