-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
130 lines (107 loc) · 5.11 KB
/
script.js
File metadata and controls
130 lines (107 loc) · 5.11 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
document.addEventListener('DOMContentLoaded', function() {
// Add hover effects to grid items
const gridItems = document.querySelectorAll('.grid-item');
gridItems.forEach(item => {
item.addEventListener('mouseenter', function() {
this.style.backgroundColor = '#111';
});
item.addEventListener('mouseleave', function() {
this.style.backgroundColor = '#0a0a0a';
});
});
// Handle certifications section hover effects
const certificationsSection = document.querySelector('.certifications');
if (certificationsSection) {
const certificationItems = certificationsSection.querySelectorAll('.certification-item');
certificationItems.forEach(item => {
item.addEventListener('mouseenter', function() {
this.style.opacity = '1';
this.style.transform = 'translateX(5px)';
this.style.transition = 'all 0.3s ease';
});
item.addEventListener('mouseleave', function() {
this.style.opacity = '0.8';
this.style.transform = 'translateX(0)';
});
});
}
// Add click events to navigation links
const navLinks = document.querySelectorAll('.nav-button');
navLinks.forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
// Example of showing a contact form or modal
alert('Contact form would open here. Add your own modal or form implementation.');
});
});
// Enhanced skill items interaction
const skillItems = document.querySelectorAll('.skill-item');
const skillsContainer = document.querySelector('.skills-container');
// Ripple effect when clicking skills
skillItems.forEach(item => {
item.addEventListener('click', function(e) {
// Create ripple element
const ripple = document.createElement('span');
ripple.classList.add('ripple');
this.appendChild(ripple);
// Get position
const rect = this.getBoundingClientRect();
const size = Math.max(rect.width, rect.height);
// Set position and animate
ripple.style.width = ripple.style.height = `${size}px`;
ripple.style.left = `${e.clientX - rect.left - size/2}px`;
ripple.style.top = `${e.clientY - rect.top - size/2}px`;
// Remove after animation completes
setTimeout(() => {
ripple.remove();
}, 600);
});
});
// Projects tile link functionality - Personal Projects
const personalProjectsTile = document.getElementById('personal-projects-tile');
const personalTimelineLink = document.getElementById('personal-timeline-link');
if (personalProjectsTile && personalTimelineLink) {
personalProjectsTile.addEventListener('mouseenter', function() {
personalProjectsTile.style.backgroundColor = '#111';
personalTimelineLink.style.opacity = '0.2'; // Make link slightly visible on hover
});
personalProjectsTile.addEventListener('mouseleave', function() {
personalProjectsTile.style.backgroundColor = '#0a0a0a';
personalTimelineLink.style.opacity = '0';
});
// This will redirect on click anywhere in the tile
personalProjectsTile.addEventListener('click', function() {
window.location.href = personalTimelineLink.href;
});
}
// Projects tile link functionality - Course Projects
const courseProjectsTile = document.getElementById('course-projects-tile');
const courseTimelineLink = document.getElementById('course-timeline-link');
if (courseProjectsTile && courseTimelineLink) {
courseProjectsTile.addEventListener('mouseenter', function() {
courseProjectsTile.style.backgroundColor = '#111';
courseTimelineLink.style.opacity = '0.2'; // Make link slightly visible on hover
});
courseProjectsTile.addEventListener('mouseleave', function() {
courseProjectsTile.style.backgroundColor = '#0a0a0a';
courseTimelineLink.style.opacity = '0';
});
// This will redirect on click anywhere in the tile
courseProjectsTile.addEventListener('click', function() {
window.location.href = courseTimelineLink.href;
});
}
// Optional: Add interaction for featured projects
const featuredItems = document.querySelectorAll('.featured-project-item');
featuredItems.forEach(item => {
item.addEventListener('mouseenter', function() {
this.style.transform = 'translateY(-3px)';
this.style.transition = 'all 0.3s ease';
this.style.backgroundColor = 'rgba(255, 255, 255, 0.03)';
});
item.addEventListener('mouseleave', function() {
this.style.transform = 'translateY(0)';
this.style.backgroundColor = 'transparent';
});
});
});