From ad4fb7964b87fbc4d455de1d61331f4abfcd0adc Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:24:38 +0100 Subject: [PATCH] Refactor CSS comments and improve observer configuration in spring.js for clarity --- Jellyfin.Plugin.Seasonals/Web/spring.css | 5 ++--- Jellyfin.Plugin.Seasonals/Web/spring.js | 9 ++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Jellyfin.Plugin.Seasonals/Web/spring.css b/Jellyfin.Plugin.Seasonals/Web/spring.css index 0931534..26d2248 100644 --- a/Jellyfin.Plugin.Seasonals/Web/spring.css +++ b/Jellyfin.Plugin.Seasonals/Web/spring.css @@ -49,7 +49,7 @@ transform-origin: bottom; } -/* HTML Grass Overlayer */ +/* Grass Overlayer */ .spring-grass { position: absolute; bottom: 0; @@ -157,7 +157,6 @@ z-index: 1002; } -/* Generic Wrappers */ .spring-anim-wrapper { position: fixed; z-index: 1001; @@ -225,7 +224,7 @@ 100% { transform: translateY(0) rotate(0deg); } } -/* Bee Buzz - Reduced Intensity */ +/* Bee Buzz */ @keyframes spring-buzz { 0% { transform: translate(0, 0); } 25% { transform: translate(2px, -2px); } diff --git a/Jellyfin.Plugin.Seasonals/Web/spring.js b/Jellyfin.Plugin.Seasonals/Web/spring.js index 1b265b1..c922e57 100644 --- a/Jellyfin.Plugin.Seasonals/Web/spring.js +++ b/Jellyfin.Plugin.Seasonals/Web/spring.js @@ -51,7 +51,11 @@ function toggleSpring() { } const observer = new MutationObserver(toggleSpring); -observer.observe(document.body, { childList: true, subtree: true, attributes: true }); +observer.observe(document.body, { + childList: true, + subtree: true, + attributes: true +}); function createPollen(container) { @@ -145,7 +149,7 @@ function createGrass(container) { const x = Math.random() * w; const h = 20 + Math.random() * 50; const cY = hSVG - h; - const bend = x + (Math.random() * 40 - 20); + const bend = x + (Math.random() * 15 - 7.5); // curvature const color = Math.random() > 0.5 ? '#4caf50' : '#45a049'; const width = 1 + Math.random() * 2; const path = ``; @@ -428,7 +432,6 @@ function createLadybugGif(container) { bug.style.animation = `spring-crawl 2s ease-in-out infinite`; - // Target the Ladybug to walk on the ground visually (aligning properly with the CSS/SVG grass size) alignY.style.transform = `translateY(calc(100vh - 5px - 30px))`; mirror.appendChild(bug);