From 4703ba48ed5b298121aff44e5d91db85bcf14c33 Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Sat, 28 Feb 2026 01:21:37 +0100 Subject: [PATCH] Refactor santa.js to improve mobile detection for snowflake count adjustment --- Jellyfin.Plugin.Seasonals/Web/santa.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Plugin.Seasonals/Web/santa.js b/Jellyfin.Plugin.Seasonals/Web/santa.js index 2a26abe..f2054f2 100644 --- a/Jellyfin.Plugin.Seasonals/Web/santa.js +++ b/Jellyfin.Plugin.Seasonals/Web/santa.js @@ -310,8 +310,8 @@ function initializeSanta() { } const container = document.querySelector('.santa-container'); if (container) { - const screenWidth = window.innerWidth; // get the screen width to detect mobile devices - if (screenWidth < 768) { // lower count of snowflakes on mobile devices + const isMobile = window.matchMedia("only screen and (max-width: 768px)").matches; // check if mobile device + if (isMobile) { // lower count of snowflakes on mobile devices isMobile = true; console.log('Mobile device detected. Reducing snowflakes count.'); snowflakesCount = snowflakesCountMobile;