This repository was archived by the owner on Apr 24, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
271 lines (243 loc) · 8.57 KB
/
Copy pathscript.js
File metadata and controls
271 lines (243 loc) · 8.57 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
// Smooth scrolling for anchor links
document.addEventListener('DOMContentLoaded', function() {
// Add smooth scrolling behavior
const links = document.querySelectorAll('a[href^="#"]');
links.forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Add animation on scroll
const observerOptions = {
threshold: 0.1,
rootMargin: '0px 0px -50px 0px'
};
const observer = new IntersectionObserver(function(entries) {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.style.opacity = '1';
entry.target.style.transform = 'translateY(0)';
}
});
}, observerOptions);
// Observe all sections for animation
const sections = document.querySelectorAll('.section');
sections.forEach(section => {
section.style.opacity = '0';
section.style.transform = 'translateY(20px)';
section.style.transition = 'opacity 0.6s ease, transform 0.6s ease';
observer.observe(section);
});
// Add typing effect to the title
const title = document.querySelector('.profile-info h1');
if (title) {
const text = title.textContent;
title.textContent = '';
let i = 0;
function typeWriter() {
if (i < text.length) {
title.textContent += text.charAt(i);
i++;
setTimeout(typeWriter, 100);
}
}
// Start typing effect after a short delay
setTimeout(typeWriter, 500);
}
// Add skill bars animation
const skillCategories = document.querySelectorAll('.skill-category');
skillCategories.forEach(category => {
const items = category.querySelectorAll('li');
items.forEach((item, index) => {
item.style.opacity = '0';
item.style.transform = 'translateX(-20px)';
item.style.transition = `opacity 0.5s ease ${index * 0.1}s, transform 0.5s ease ${index * 0.1}s`;
});
});
// Animate skill items when they come into view
const skillObserver = new IntersectionObserver(function(entries) {
entries.forEach(entry => {
if (entry.isIntersecting) {
const items = entry.target.querySelectorAll('li');
items.forEach(item => {
item.style.opacity = '1';
item.style.transform = 'translateX(0)';
});
}
});
}, observerOptions);
skillCategories.forEach(category => {
skillObserver.observe(category);
});
// Add hover effects to contact items
const contactItems = document.querySelectorAll('.contact-item');
contactItems.forEach(item => {
item.addEventListener('mouseenter', function() {
this.style.transform = 'translateX(5px)';
this.style.transition = 'transform 0.3s ease';
});
item.addEventListener('mouseleave', function() {
this.style.transform = 'translateX(0)';
});
});
// Add click-to-copy functionality for email and phone
const emailItem = document.querySelector('.contact-item a[href*="gmail"]');
const phoneItem = document.querySelector('.contact-item span');
if (emailItem) {
emailItem.addEventListener('click', function(e) {
e.preventDefault();
navigator.clipboard.writeText('jbanmol9@gmail.com').then(() => {
showNotification('Email copied to clipboard!');
});
});
}
if (phoneItem && phoneItem.textContent.includes('9962775663')) {
phoneItem.style.cursor = 'pointer';
phoneItem.addEventListener('click', function() {
navigator.clipboard.writeText('+919962775663').then(() => {
showNotification('Phone number copied to clipboard!');
});
});
}
// Add print functionality
const printButton = document.createElement('button');
printButton.innerHTML = '<i class="fas fa-print"></i> Print Resume';
printButton.className = 'print-button';
printButton.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
background: #667eea;
color: white;
border: none;
padding: 10px 15px;
border-radius: 25px;
cursor: pointer;
font-size: 14px;
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
transition: all 0.3s ease;
z-index: 1000;
`;
printButton.addEventListener('click', function() {
window.print();
});
printButton.addEventListener('mouseenter', function() {
this.style.transform = 'translateY(-2px)';
this.style.boxShadow = '0 6px 20px rgba(102, 126, 234, 0.4)';
});
printButton.addEventListener('mouseleave', function() {
this.style.transform = 'translateY(0)';
this.style.boxShadow = '0 4px 12px rgba(102, 126, 234, 0.3)';
});
document.body.appendChild(printButton);
// Add theme toggle (optional)
const themeToggle = document.createElement('button');
themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
themeToggle.className = 'theme-toggle';
themeToggle.style.cssText = `
position: fixed;
top: 20px;
right: 150px;
background: #2d3748;
color: white;
border: none;
padding: 10px;
border-radius: 50%;
cursor: pointer;
font-size: 16px;
width: 45px;
height: 45px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
transition: all 0.3s ease;
z-index: 1000;
`;
let isDarkMode = false;
themeToggle.addEventListener('click', function() {
isDarkMode = !isDarkMode;
document.body.classList.toggle('dark-mode', isDarkMode);
this.innerHTML = isDarkMode ? '<i class="fas fa-sun"></i>' : '<i class="fas fa-moon"></i>';
this.style.background = isDarkMode ? '#f7fafc' : '#2d3748';
this.style.color = isDarkMode ? '#2d3748' : '#f7fafc';
});
document.body.appendChild(themeToggle);
});
// Notification function
function showNotification(message) {
const notification = document.createElement('div');
notification.textContent = message;
notification.style.cssText = `
position: fixed;
top: 80px;
right: 20px;
background: #48bb78;
color: white;
padding: 12px 20px;
border-radius: 6px;
font-size: 14px;
box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
z-index: 1001;
animation: slideIn 0.3s ease;
`;
// Add animation keyframes
const style = document.createElement('style');
style.textContent = `
@keyframes slideIn {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOut {
from { transform: translateX(0); opacity: 1; }
to { transform: translateX(100%); opacity: 0; }
}
`;
document.head.appendChild(style);
document.body.appendChild(notification);
setTimeout(() => {
notification.style.animation = 'slideOut 0.3s ease';
setTimeout(() => {
document.body.removeChild(notification);
}, 300);
}, 2000);
}
// Dark mode styles
const darkModeStyles = `
.dark-mode {
background-color: #1a202c !important;
color: #e2e8f0 !important;
}
.dark-mode .section {
background-color: #2d3748 !important;
border-color: #4a5568 !important;
}
.dark-mode .section-title {
color: #e2e8f0 !important;
}
.dark-mode .about-text,
.dark-mode .education-item h3,
.dark-mode .skill-category h3,
.dark-mode .experience-header h3,
.dark-mode .project-item h3 {
color: #e2e8f0 !important;
}
.dark-mode .institution,
.dark-mode .skill-category li,
.dark-mode .achievements li,
.dark-mode .project-item p {
color: #a0aec0 !important;
}
.dark-mode .education-item,
.dark-mode .skill-category,
.dark-mode .project-item {
background-color: #4a5568 !important;
}
`;
const darkModeStyleSheet = document.createElement('style');
darkModeStyleSheet.textContent = darkModeStyles;
document.head.appendChild(darkModeStyleSheet);