diff --git a/Jellyfin.Plugin.Seasonals/Web/easter.js b/Jellyfin.Plugin.Seasonals/Web/easter.js index 3aa7b84..28da845 100644 --- a/Jellyfin.Plugin.Seasonals/Web/easter.js +++ b/Jellyfin.Plugin.Seasonals/Web/easter.js @@ -197,6 +197,8 @@ function animateRabbit(rabbit) { rabbit.style.transition = 'none'; const transformScale = startFromLeft ? 'scaleX(-1)' : ''; + // Fix bounding box center-of-gravity shift when graphic is flipped + rabbit.style.transformOrigin = startFromLeft ? '59% 50%' : '50% 50%'; rabbit.style.transform = `translateX(${currentX}vw) ${transformScale}`; const loopDurationMs = jumpDurationMs + pauseDurationMs; @@ -211,10 +213,10 @@ function animateRabbit(rabbit) { if (!startTime) { startTime = timestamp; - // resetting gif, forces the browser to restart the GIF from the first frame (crucial for syncing hops with movement) + // resetting gif, appending a timestamp cache-buster forces the browser + // to reload and start the GIF strictly from the first frame. const currSrc = rabbit.src.split('?')[0]; - rabbit.src = ''; - rabbit.src = currSrc; + rabbit.src = currSrc + '?t=' + Date.now(); } const elapsed = timestamp - startTime;