@@ -55,35 +55,11 @@ document.addEventListener('DOMContentLoaded', function() {
5555 } ) ;
5656 } , observerOptions ) ;
5757
58- // Observe sections for animation, excluding the hero section which has custom animation
58+ // Observe sections for animation
5959 document . querySelectorAll ( 'section' ) . forEach ( section => {
60- if ( section . id !== 'home' ) {
61- observer . observe ( section ) ;
62- }
60+ observer . observe ( section ) ;
6361 } ) ;
6462
65- // Specific animation for hero section elements
66- const heroSection = document . getElementById ( 'home' ) ;
67- if ( heroSection ) {
68- const heroElements = heroSection . querySelectorAll ( '.hero-content > *' ) ; // Select direct children
69- const heroObserver = new IntersectionObserver ( function ( entries ) {
70- entries . forEach ( entry => {
71- if ( entry . isIntersecting ) {
72- heroElements . forEach ( ( element , index ) => {
73- // Apply fade-in-up with staggered delays
74- setTimeout ( ( ) => {
75- element . classList . add ( 'fade-in-up' ) ;
76- } , index * 150 ) ; // Stagger by 150ms per element
77- } ) ;
78- // Once animated, disconnect observer for this section if only needed once
79- heroObserver . unobserve ( entry . target ) ;
80- }
81- } ) ;
82- } , observerOptions ) ;
83-
84- heroObserver . observe ( heroSection ) ;
85- }
86-
8763 // GitHub repositories fetching
8864 async function fetchGitHubRepos ( ) {
8965 const projectsGrid = document . getElementById ( 'projects-grid' ) ;
@@ -275,4 +251,4 @@ document.addEventListener('DOMContentLoaded', function() {
275251 document . getElementById ( 'current-year' ) . textContent = new Date ( ) . getFullYear ( ) ;
276252
277253 console . log ( 'Portfolio website loaded successfully!' ) ;
278- } ) ;
254+ } ) ;
0 commit comments