From 296873f89e57a1c7030fded0427d481afe89b5a3 Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:58:53 +0100 Subject: [PATCH] Fix rabbit animation transform origin and improve GIF reset logic --- Jellyfin.Plugin.Seasonals/Web/easter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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;