File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -505,19 +505,21 @@ function updateCurrentYear() {
505505 document . getElementById ( 'currentYear' ) . textContent = new Date ( ) . getFullYear ( ) ;
506506}
507507
508- // Keep the landing hero on its default asset; only repo cards are theme-swapped .
508+ // Theme-swap the landing hero and repo cards using explicit asset paths .
509509function initializeHeroImageSwap ( ) {
510510 const heroFigure = document . getElementById ( 'heroFigure' ) ;
511511
512512 const updateHeroImage = ( ) => {
513513 const currentTheme = document . documentElement . dataset . theme || 'light' ;
514514 const variant = currentTheme === 'dark' ? 'dark' : 'light' ;
515515
516- // Preserve the default landing hero image from the markup.
516+ // Update main hero figure using explicit asset paths from the markup.
517517 if ( heroFigure ) {
518518 const defaultSrc = heroFigure . dataset . heroDefault || heroFigure . getAttribute ( 'src' ) ;
519- heroFigure . src = defaultSrc ;
520- heroFigure . alt = 'Accuracy vs Identifiability' ;
519+ const lightSrc = heroFigure . dataset . heroLight || defaultSrc ;
520+ const darkSrc = heroFigure . dataset . heroDark || defaultSrc ;
521+ heroFigure . src = variant === 'dark' ? darkSrc : lightSrc ;
522+ heroFigure . alt = `Accuracy vs Identifiability (${ variant } mode)` ;
521523 }
522524
523525 // Update repo card hero images
You can’t perform that action at this time.
0 commit comments