diff --git a/src/serena/resources/dashboard/dashboard.js b/src/serena/resources/dashboard/dashboard.js
index ccf8c80c..689fda4c 100644
--- a/src/serena/resources/dashboard/dashboard.js
+++ b/src/serena/resources/dashboard/dashboard.js
@@ -40,6 +40,18 @@ class LogMessage {
};
}
+function updateThemeAwareImage($img, theme=null) {
+ if (!theme) {
+ const isDarkMode = $('html').data("theme") == 'dark';
+ theme = isDarkMode ? 'dark' : 'light';
+ }
+ console.log("updating theme-aware image to theme:", theme);
+ const newSrc = $img.data('src-' + theme);
+ if (newSrc) {
+ $img.attr('src', newSrc);
+ }
+}
+
class BannerRotation {
constructor() {
this.platinumIndex = 0;
@@ -70,6 +82,12 @@ class BannerRotation {
function fillSponsors($container, sponsors, className) {
$.each(sponsors, function (index, sponsor) {
let $img = $('');
+ if (sponsor.image_dark) {
+ $img.addClass('theme-aware-img');
+ $img.attr('data-src-dark', sponsor.image_dark);
+ $img.attr('data-src-light', sponsor.image);
+ updateThemeAwareImage($img);
+ }
let $anchor = $('');
$anchor.append($img);
let $sponsor = $('
+