Skip to content

Commit d588b58

Browse files
ui: update hero image
1 parent 4be8481 commit d588b58

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

script.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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.
509509
function 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

0 commit comments

Comments
 (0)