Skip to content

Commit 4be8481

Browse files
ui: updated hero image
1 parent 046984a commit 4be8481

6 files changed

Lines changed: 12 additions & 8 deletions
File renamed without changes.
1.03 MB
Loading

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
<!-- Preload hero images -->
5151
<link rel="preload" href="assets/accuracy-vs-identifiability-light.jpeg" as="image" type="image/jpeg" />
52-
<link rel="preload" href="assets/accuracy-vs-identifiability-dark.jpeg" as="image" type="image/jpeg" />
52+
<link rel="preload" href="assets/accuracy-vs-identifiability-dark.png" as="image" type="image/png" />
5353

5454
<link rel="stylesheet" href="styles.css" />
5555

@@ -213,7 +213,10 @@ <h3 class="hero-hook reveal" data-delay="400">
213213
<img
214214
id="heroFigure"
215215
class="hero-figure-img"
216-
src="assets/accuracy-vs-identifiability-light.jpeg"
216+
src="assets/accuracy-vs-identifiability-dark.png"
217+
data-hero-default="assets/accuracy-vs-identifiability-dark.png"
218+
data-hero-light="assets/accuracy-vs-identifiability-light.jpeg"
219+
data-hero-dark="assets/accuracy-vs-identifiability-dark.png"
217220
alt="Accuracy vs Identifiability"
218221
decoding="async"
219222
/>

script.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,18 +505,19 @@ function updateCurrentYear() {
505505
document.getElementById('currentYear').textContent = new Date().getFullYear();
506506
}
507507

508-
// Hero Image Theme Swap (JPEG only for sharp text)
508+
// Keep the landing hero on its default asset; only repo cards are theme-swapped.
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-
// Update main hero figure (JPEG only for sharp text)
516+
// Preserve the default landing hero image from the markup.
517517
if (heroFigure) {
518-
heroFigure.src = `assets/accuracy-vs-identifiability-${variant}.jpeg`;
519-
heroFigure.alt = `Accuracy vs Identifiability (${variant} mode)`;
518+
const defaultSrc = heroFigure.dataset.heroDefault || heroFigure.getAttribute('src');
519+
heroFigure.src = defaultSrc;
520+
heroFigure.alt = 'Accuracy vs Identifiability';
520521
}
521522

522523
// Update repo card hero images

scripts/convert-hero-images.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -e
1515

1616
ASSETS_DIR="assets"
1717
LIGHT_JPEG="${ASSETS_DIR}/accuracy-vs-identifiability-light.jpeg"
18-
DARK_JPEG="${ASSETS_DIR}/accuracy-vs-identifiability-dark.jpeg"
18+
DARK_JPEG="${ASSETS_DIR}/accuracy-vs-identifiability-dark.png"
1919

2020
# Color codes for output
2121
GREEN='\033[0;32m'

scripts/make-transparent-background.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -e
1313

1414
ASSETS_DIR="assets"
1515
LIGHT_JPEG="${ASSETS_DIR}/accuracy-vs-identifiability-light.jpeg"
16-
DARK_JPEG="${ASSETS_DIR}/accuracy-vs-identifiability-dark.jpeg"
16+
DARK_JPEG="${ASSETS_DIR}/accuracy-vs-identifiability-dark.png"
1717

1818
# Color codes
1919
GREEN='\033[0;32m'

0 commit comments

Comments
 (0)