From e9fe356ceeb7d7413058f8691e2f5faaaa8a7b3f Mon Sep 17 00:00:00 2001 From: CodeDevMLH <145071728+CodeDevMLH@users.noreply.github.com> Date: Mon, 23 Mar 2026 17:25:48 +0100 Subject: [PATCH] Enhance slideshow responsiveness by adjusting dot display for small screens --- .../Web/mediaBarEnhanced.css | 8 ++++++++ .../Web/mediaBarEnhanced.js | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.css b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.css index 032becb..969a8db 100644 --- a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.css +++ b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.css @@ -749,6 +749,14 @@ left: 50%; transform: translateX(-50%) scale(0.8); background-color: #ffffff00; + width: max-content; + max-width: 90vw; + flex-wrap: nowrap; + overflow: hidden; + } + + .dot { + flex-shrink: 0; } .dot.active { diff --git a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js index 69bee98..5b2ae74 100644 --- a/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js +++ b/Jellyfin.Plugin.MediaBarEnhanced/Web/mediaBarEnhanced.js @@ -1,4 +1,4 @@ -/* +/* * Jellyfin Slideshow by M0RPH3US v4.0.1 * Modified by CodeDevMLH * @@ -2363,8 +2363,17 @@ const SlideshowManager = { const totalItems = STATE.slideshow.totalItems || 0; + // dynamically lower the max dots threshold on small screens + let effectiveMaxDots = CONFIG.maxPaginationDots; + if (window.matchMedia("(max-width: 767px) and (orientation: portrait)").matches) { + const availableWidth = window.innerWidth * 0.9; + const dotWidth = 18; // approximate width per dot + const fittingDots = Math.floor(availableWidth / dotWidth) - 1; + effectiveMaxDots = Math.min(effectiveMaxDots, fittingDots); + } + // Switch to counter style if too many items - if (totalItems > CONFIG.maxPaginationDots) { + if (totalItems > effectiveMaxDots) { const counter = document.createElement("span"); counter.className = "slide-counter"; counter.id = "slide-counter";