Skip to content

Commit dd2ca8f

Browse files
committed
Add entrance animations for project cards and sponsor items
- Added fade-in and scale animations for project cards - Added fade-in and scale animations for sponsor items - Updated JavaScript to observe and trigger animations on scroll - Animations are staggered for a cascading effect - Maintains consistency with existing title animations
1 parent 3cc1854 commit dd2ca8f

2 files changed

Lines changed: 30 additions & 10 deletions

File tree

home/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
});
335335

336336
// Observe all elements with reveal classes
337-
document.querySelectorAll('.reveal, .scale-reveal, .code-reveal').forEach(element => {
337+
document.querySelectorAll('.reveal, .scale-reveal, .code-reveal, .project-card, .sponsor-item').forEach(element => {
338338
revealObserver.observe(element);
339339
});
340340
}
@@ -445,7 +445,7 @@
445445

446446
// Performance optimization for animations
447447
function optimizeAnimationPerformance() {
448-
const animatedElements = document.querySelectorAll('.reveal, .scale-reveal, .code-reveal');
448+
const animatedElements = document.querySelectorAll('.reveal, .scale-reveal, .code-reveal, .project-card, .sponsor-item');
449449

450450
const performanceObserver = new IntersectionObserver((entries) => {
451451
entries.forEach(entry => {

home/styles.css

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ main {
203203
border-radius: 8px;
204204
padding: 1.5rem;
205205
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
206-
transition: all 0.3s ease;
207206
text-decoration: none;
208207
color: inherit;
209208
display: block;
@@ -297,8 +296,6 @@ main {
297296

298297
.sponsor-item {
299298
display: inline-block;
300-
transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
301-
opacity: 0.9;
302299
}
303300

304301
.sponsor-item:hover {
@@ -821,11 +818,7 @@ header {
821818
}
822819
}
823820

824-
/* Enhanced project cards */
825-
.project-card {
826-
will-change: transform, box-shadow;
827-
transition: transform 0.2s ease, box-shadow 0.2s ease;
828-
}
821+
/* Enhanced project cards hover state */
829822

830823
.project-card:hover {
831824
transform: translateY(-4px);
@@ -902,6 +895,33 @@ header {
902895
transform: translateY(0);
903896
}
904897

898+
/* Project cards entrance animation */
899+
.project-card {
900+
opacity: 0;
901+
transform: translateY(30px) scale(0.95);
902+
transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.2s ease;
903+
will-change: transform, opacity;
904+
}
905+
906+
.project-card.revealed {
907+
opacity: 1;
908+
transform: translateY(0) scale(1);
909+
}
910+
911+
/* Sponsor items entrance animation */
912+
.sponsor-item {
913+
opacity: 0;
914+
transform: translateY(30px) scale(0.9);
915+
transition: opacity 0.8s ease, transform 0.8s ease;
916+
will-change: transform, opacity;
917+
}
918+
919+
.sponsor-item.revealed {
920+
opacity: 1;
921+
transform: translateY(0) scale(1);
922+
}
923+
924+
905925
/* Scale reveal for cards */
906926
.scale-reveal {
907927
opacity: 0;

0 commit comments

Comments
 (0)