From f9b4b3c25d772b607ac8c79df0ffee2dbdfa12cb Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Tue, 24 Feb 2026 19:19:25 +0100 Subject: [PATCH] Refactor earthday.js: move flowerColors definition to a constant and use it in flower generation --- Jellyfin.Plugin.Seasonals/Web/earthday.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Plugin.Seasonals/Web/earthday.js b/Jellyfin.Plugin.Seasonals/Web/earthday.js index 0f19c0c..d3e5f8c 100644 --- a/Jellyfin.Plugin.Seasonals/Web/earthday.js +++ b/Jellyfin.Plugin.Seasonals/Web/earthday.js @@ -3,6 +3,8 @@ const config = window.SeasonalsPluginConfig?.EarthDay || {}; const enabled = config.EnableEarthDay !== undefined ? config.EnableEarthDay : true; const vineCount = config.VineCount || 4; +const flowerColors = ['#FF69B4', '#FFD700', '#87CEFA', '#FF4500', '#BA55D3', '#FFA500', '#FF1493']; + let msgPrinted = false; // Toggle Function @@ -66,12 +68,11 @@ function createElements() { } // Generate Flowers - const colors = ['#FF69B4', '#FFD700', '#87CEFA', '#FF4500', '#BA55D3', '#FFA500', '#FF1493']; const flowerCount = Math.max(10, vineCount * 15); for (let i = 0; i < flowerCount; i++) { const x = 10 + Math.random() * (w - 20); const y = hSVG * 0.1 + Math.random() * (hSVG * 0.5); - const col = colors[Math.floor(Math.random() * colors.length)]; + const col = flowerColors[Math.floor(Math.random() * flowerColors.length)]; paths += ``;